All URIs are relative to https://ephemeral.api.factom.com/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
// Import classes:
//import harmony_connect_client.ApiClient;
//import harmony_connect_client.ApiException;
//import harmony_connect_client.Configuration;
//import harmony_connect_client.auth.*;
//import harmony_connect_client.api.ChainsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: AppId
ApiKeyAuth AppId = (ApiKeyAuth) defaultClient.getAuthentication("AppId");
AppId.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AppId.setApiKeyPrefix("Token");
// Configure API key authorization: AppKey
ApiKeyAuth AppKey = (ApiKeyAuth) defaultClient.getAuthentication("AppKey");
AppKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AppKey.setApiKeyPrefix("Token");
ChainsApi apiInstance = new ChainsApi();
String chainId = 285904; // String | Chain identifier
try {
Chain result = apiInstance.getChainByID(chainId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ChainsApi#getChainByID");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
chainId | String | Chain identifier |
- Content-Type: Not defined
- Accept: application/json
ChainList getChains(limit, offset, stages)
Get All Chains
Returns all of the chains on factomd.
// Import classes:
//import harmony_connect_client.ApiClient;
//import harmony_connect_client.ApiException;
//import harmony_connect_client.Configuration;
//import harmony_connect_client.auth.*;
//import harmony_connect_client.api.ChainsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: AppId
ApiKeyAuth AppId = (ApiKeyAuth) defaultClient.getAuthentication("AppId");
AppId.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AppId.setApiKeyPrefix("Token");
// Configure API key authorization: AppKey
ApiKeyAuth AppKey = (ApiKeyAuth) defaultClient.getAuthentication("AppKey");
AppKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AppKey.setApiKeyPrefix("Token");
ChainsApi apiInstance = new ChainsApi();
Integer limit = 15; // Integer | The number of items you would like back in each page.
Integer offset = 2; // Integer | 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.
String 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'`.
try {
ChainList result = apiInstance.getChains(limit, offset, stages);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ChainsApi#getChains");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
limit | Integer | The number of items you would like back in each page. | [optional] |
offset | Integer | 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.
// Import classes:
//import harmony_connect_client.ApiClient;
//import harmony_connect_client.ApiException;
//import harmony_connect_client.Configuration;
//import harmony_connect_client.auth.*;
//import harmony_connect_client.api.ChainsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: AppId
ApiKeyAuth AppId = (ApiKeyAuth) defaultClient.getAuthentication("AppId");
AppId.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AppId.setApiKeyPrefix("Token");
// Configure API key authorization: AppKey
ApiKeyAuth AppKey = (ApiKeyAuth) defaultClient.getAuthentication("AppKey");
AppKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AppKey.setApiKeyPrefix("Token");
ChainsApi apiInstance = new ChainsApi();
ChainCreate chainCreate = new ChainCreate(); // ChainCreate |
try {
ChainShort result = apiInstance.postChain(chainCreate);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ChainsApi#postChain");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
chainCreate | ChainCreate |
- Content-Type: application/json
- Accept: application/json
ChainList postChainSearch(searchBody, limit, offset)
Search Chains
Finds all of the chains with `external_ids` that match what you've entered. External IDs must be sent in Base64 format.
// Import classes:
//import harmony_connect_client.ApiClient;
//import harmony_connect_client.ApiException;
//import harmony_connect_client.Configuration;
//import harmony_connect_client.auth.*;
//import harmony_connect_client.api.ChainsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: AppId
ApiKeyAuth AppId = (ApiKeyAuth) defaultClient.getAuthentication("AppId");
AppId.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AppId.setApiKeyPrefix("Token");
// Configure API key authorization: AppKey
ApiKeyAuth AppKey = (ApiKeyAuth) defaultClient.getAuthentication("AppKey");
AppKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AppKey.setApiKeyPrefix("Token");
ChainsApi apiInstance = new ChainsApi();
SearchBody searchBody = new SearchBody(); // SearchBody |
Integer limit = 15; // Integer | The number of items you would like back in each page.
Integer offset = 2; // Integer | 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.
try {
ChainList result = apiInstance.postChainSearch(searchBody, limit, offset);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ChainsApi#postChainSearch");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
searchBody | SearchBody | ||
limit | Integer | The number of items you would like back in each page. | [optional] |
offset | Integer | 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