All URIs are relative to https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1
Method | HTTP request | Description |
---|---|---|
getChainByID | GET /chains/{chain_id} | Get Chain Info |
getChains | GET /chains | Get All Chains |
postChain | POST /chains | Create a Chain |
postChainSearch | POST /chains/search | Search Chains |
Chain getChainByID(chainId)
Get Chain Info
Get information about a specific chain on Connect
var HarmonyConnectClient = require('harmony-connect-client');
var defaultClient = HarmonyConnectClient.ApiClient.instance;
// Configure API key authorization: AppId
var AppId = defaultClient.authentications['AppId'];
AppId.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AppId.apiKeyPrefix = 'Token';
// Configure API key authorization: AppKey
var AppKey = defaultClient.authentications['AppKey'];
AppKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AppKey.apiKeyPrefix = 'Token';
var apiInstance = new HarmonyConnectClient.ChainsApi();
var chainId = 285904; // String | Chain identifier
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.getChainByID(chainId, callback);
Name | Type | Description | Notes |
---|---|---|---|
chainId | String | Chain identifier |
- Content-Type: Not defined
- Accept: application/json
ChainList getChains(opts)
Get All Chains
Returns all of the chains on factomd.
var HarmonyConnectClient = require('harmony-connect-client');
var defaultClient = HarmonyConnectClient.ApiClient.instance;
// Configure API key authorization: AppId
var AppId = defaultClient.authentications['AppId'];
AppId.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AppId.apiKeyPrefix = 'Token';
// Configure API key authorization: AppKey
var AppKey = defaultClient.authentications['AppKey'];
AppKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AppKey.apiKeyPrefix = 'Token';
var apiInstance = new HarmonyConnectClient.ChainsApi();
var opts = {
'limit': 15, // Number | The number of items you would like back in each page.
'offset': 2, // Number | The offset parameter allows you to select which item you would like to start from when you get back a list from Connect. For example, if you've already seen the first 15 items and you'd like the next set, you would send an offset of 15. `offset=0` starts from the first item of the set and is the default position.
'stages': "stages_example" // String | The immutability stages you want to restrict results to. You can choose any from `replicated`, `factom`, and `anchored`. If you would like to search among multiple stages, send them in a comma separated string. For example: `'replicated,factom'`.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.getChains(opts, callback);
Name | Type | Description | Notes |
---|---|---|---|
limit | Number | The number of items you would like back in each page. | [optional] |
offset | Number | The offset parameter allows you to select which item you would like to start from when you get back a list from Connect. For example, if you've already seen the first 15 items and you'd like the next set, you would send an offset of 15. `offset=0` starts from the first item of the set and is the default position. | [optional] |
stages | String | The immutability stages you want to restrict results to. You can choose any from `replicated`, `factom`, and `anchored`. If you would like to search among multiple stages, send them in a comma separated string. For example: `'replicated,factom'`. | [optional] |
- Content-Type: Not defined
- Accept: application/json
ChainShort postChain(chainCreate)
Create a Chain
Create a new chain. Each chain functions as a mini-blockchain such that all of the entries are linked. Every entry relies on data from previous entries in the chain. Any unauthorized alterations to any of these entries can be detected. Be aware that data entered into the `content` and `external_ids` fields must be in Base64 format. Sending this request will cause Connect to create the first entry of the chain. The data entered into the `content` and `external_id` fields will be applied to this entry.
var HarmonyConnectClient = require('harmony-connect-client');
var defaultClient = HarmonyConnectClient.ApiClient.instance;
// Configure API key authorization: AppId
var AppId = defaultClient.authentications['AppId'];
AppId.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AppId.apiKeyPrefix = 'Token';
// Configure API key authorization: AppKey
var AppKey = defaultClient.authentications['AppKey'];
AppKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AppKey.apiKeyPrefix = 'Token';
var apiInstance = new HarmonyConnectClient.ChainsApi();
var chainCreate = new HarmonyConnectClient.ChainCreate(); // ChainCreate |
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.postChain(chainCreate, callback);
Name | Type | Description | Notes |
---|---|---|---|
chainCreate | ChainCreate |
- Content-Type: application/json
- Accept: application/json
ChainList postChainSearch(searchBody, opts)
Search Chains
Finds all of the chains with `external_ids` that match what you've entered. External IDs must be sent in Base64 format.
var HarmonyConnectClient = require('harmony-connect-client');
var defaultClient = HarmonyConnectClient.ApiClient.instance;
// Configure API key authorization: AppId
var AppId = defaultClient.authentications['AppId'];
AppId.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AppId.apiKeyPrefix = 'Token';
// Configure API key authorization: AppKey
var AppKey = defaultClient.authentications['AppKey'];
AppKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AppKey.apiKeyPrefix = 'Token';
var apiInstance = new HarmonyConnectClient.ChainsApi();
var searchBody = new HarmonyConnectClient.SearchBody(); // SearchBody |
var opts = {
'limit': 15, // Number | The number of items you would like back in each page.
'offset': 2 // Number | The offset parameter allows you to select which item you would like to start from when you get back a list from Connect. For example, if you've already seen the first 15 items and you'd like the next set, you would send an offset of 15. `offset=0` starts from the first item of the set and is the default position.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.postChainSearch(searchBody, opts, callback);
Name | Type | Description | Notes |
---|---|---|---|
searchBody | SearchBody | ||
limit | Number | The number of items you would like back in each page. | [optional] |
offset | Number | The offset parameter allows you to select which item you would like to start from when you get back a list from Connect. For example, if you've already seen the first 15 items and you'd like the next set, you would send an offset of 15. `offset=0` starts from the first item of the set and is the default position. | [optional] |
- Content-Type: application/json
- Accept: application/json