Connect Documentation

The Connect Developer Hub

Welcome to the Connect developer hub. You'll find comprehensive guides and documentation to help you start working with Connect as quickly as possible, as well as support if you get stuck.

Connect is your fast lane to the blockchain. Add blockchain capabilities to any software without needing to wrestle with currencies, wallets, or blockchain nodes. Instead, you get easy read and write access to the Factom blockchain. Connect will also track your data's path to immutability and will notify you along the way. To get started, you can use the guides below. Or if you're already familiar with Connect, you can jump straight to the API reference section.

Get Started    
Suggest Edits

API Info

Request general information about the Connect API such as the version and available endpoints.

 

Header Auth

 Authentication is required for this endpoint.
gethttps://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/
curl --request GET \
  --url https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/");

xhr.send(data);
import requests

url = "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/"

response = requests.request("GET", url)

print(response.text)
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/")
  .get()
  .build();

Response response = client.newCall(request).execute();
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
var client = new RestClient("https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
A binary file was returned

You couldn't be authenticated

Try the API to see results

Response

OK

api_versionstring

Connect version

linksobject

Links to internal paths of the application

links.chainsstring

Link to chain api

Suggest Edits

Get Chain Info

Get information about a specific chain on Connect

 

Header Auth

 Authentication is required for this endpoint.
gethttps://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id
curl --request GET \
  --url https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id");

xhr.send(data);
import requests

url = "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id"

response = requests.request("GET", url)

print(response.text)
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id")
  .get()
  .build();

Response response = client.newCall(request).execute();
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
var client = new RestClient("https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

chain_id
string
required

Chain identifier

Response

OK

dataobject
data.chain_idstring

This is the unique identifier created for each chain.

data.external_idsarray

Tags that have been used to identify this entry.

data.stagestring

The immutability stage that this chain has reached.

data.entriesobject
data.entries.hrefstring

An API link to all of the entries in this chain.

Suggest Edits

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.

 

Header Auth

 Authentication is required for this endpoint.
posthttps://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains
curl --request POST \
  --url https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains");

xhr.send(data);
import requests

url = "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains"

response = requests.request("POST", url)

print(response.text)
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains")
  .post(null)
  .build();

Response response = client.newCall(request).execute();
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains"

	req, _ := http.NewRequest("POST", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
var client = new RestClient("https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains");
var request = new RestRequest(Method.POST);
IRestResponse response = client.Execute(request);
A binary file was returned

You couldn't be authenticated

Try the API to see results

Body Params

external_ids
array of strings
required

Tags that can be used to identify your chain. You can search for records that contain a particular external_id using Connect. You must send External IDs in Base64 format.

content
string
required

This is the data that will make up the first entry in your new chain. It is customary to use this space to describe the entries that are to follow in the chain. You must send the content field in Base64 format.

callback_url
string

The URL where you would like to receive the callback from Connect. If this is not specified, callbacks will not activate.

callback_stages
array of strings

The stages that you would like to trigger a callback from Connect. This list can include any or all of the three stages: replicated, factom, and anchored. If callbacks are activated and this field is not sent, it will default to factom and anchored

Response

Created

chain_idstring

The Chain ID of the chain that you just created. You may use this unique ID to find or add to this chain in the future.

entry_hashstring

The hash of the first entry of this new chain.

stagestring

The current stage of this new chain. Only returned if callbacks are activated.

Suggest Edits

Get All Chains

Returns all of the chains on factomd.

 

Header Auth

 Authentication is required for this endpoint.
gethttps://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains
curl --request GET \
  --url https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains");

xhr.send(data);
import requests

url = "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains"

response = requests.request("GET", url)

print(response.text)
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains")
  .get()
  .build();

Response response = client.newCall(request).execute();
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
var client = new RestClient("https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
A binary file was returned

You couldn't be authenticated

Try the API to see results

Query Params

limit
integer

The number of items you would like back in each page.

offset
integer

The page you would like to request. The first page offset is Zero.

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: 'multi_az,factom'.

Response

OK

dataobject

An array that contains the chains on this page.

data.chain_idstring

The ID for this chain on the Factom blockchain.

data.external_idsarray

The external IDs attached to this chain on the Factom blockchain.

data.hrefstring

An API link to retrieve all information about this chain.

offsetstring

The page offset. (Current page -1)

limitstring

The maximum number of chains per page.

countstring

The total number of chains seen.

Suggest Edits

Search Chains

Finds all of the chains with external_ids that match what you've entered. External IDs must be sent in Base64 format.

 

Header Auth

 Authentication is required for this endpoint.
posthttps://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/search
curl --request POST \
  --url https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/search
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/search");

xhr.send(data);
import requests

url = "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/search"

response = requests.request("POST", url)

print(response.text)
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/search")
  .post(null)
  .build();

Response response = client.newCall(request).execute();
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/search",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/search"

	req, _ := http.NewRequest("POST", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
var client = new RestClient("https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/search");
var request = new RestRequest(Method.POST);
IRestResponse response = client.Execute(request);
A binary file was returned

You couldn't be authenticated

Try the API to see results

Query Params

limit
integer

The number of items you would like back in each page.

offset
integer

The page you would like to request. The first page offset is Zero.

Body Params

external_ids
array of strings
required

A list of external IDs.

Response

OK

dataobject

An array that contains the chains on this page.

data.chain_idstring

The ID for this chain on the Factom blockchain.

data.external_idsarray

The external IDs attached to this chain on the Factom blockchain.

data.hrefstring

An API link to retrieve all information about this chain.

offsetstring

The page offset. (Current page -1)

limitstring

The maximum number of chains per page.

countstring

The total number of chains seen.

 
Suggest Edits

Get Entry Info

Returns information about a specific entry on Connect. The requested entry must be specified using the Chain ID and Entry Hash.

 

Header Auth

 Authentication is required for this endpoint.
gethttps://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/entry_hash
curl --request GET \
  --url https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/entry_hash
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/entry_hash");

xhr.send(data);
import requests

url = "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/entry_hash"

response = requests.request("GET", url)

print(response.text)
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/entry_hash")
  .get()
  .build();

Response response = client.newCall(request).execute();
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/entry_hash",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/entry_hash"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
var client = new RestClient("https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/entry_hash");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

chain_id
string
required

Chain identifier

entry_hash
string
required

The SHA256 hash of the entry.

Response

OK

dataobject
data.entry_hashstring

The SHA256 Hash of this entry.

data.chainobject

An object that contains the Chain Hash (ID) as well as a URL for the chain.

data.chain.chain_idstring

The ID for this chain on the Factom blockchain.

data.chain.hrefstring

An API link to retrieve all information about this chain.

data.created_atstring

The time when this entry was created. Sent in ISO 8601 Format. For example: YYYY-MM-DDThh:mm:ssZ

data.external_idsarray

Tags that can be used to identify your entry. You can search for records that contain a particular external_id using Connect. External IDs are returned in Base64.

data.contentstring

This is the data that is stored by the entry. Content will be sent in Base64 format.

data.stagestring

The level of immutability that this entry has reached.

data.eblockobject
data.eblock.keymrstring

The Key Merkle Root for this entry block.

data.eblock.hrefstring

An API link to retrieve all information about this entry block.

Suggest Edits

Create an Entry

Create a new entry for the selected chain. Content and external id must be uploaded in Base64 format.

 

Header Auth

 Authentication is required for this endpoint.
posthttps://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries
curl --request POST \
  --url https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries");

xhr.send(data);
import requests

url = "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries"

response = requests.request("POST", url)

print(response.text)
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries")
  .post(null)
  .build();

Response response = client.newCall(request).execute();
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries"

	req, _ := http.NewRequest("POST", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
var client = new RestClient("https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries");
var request = new RestRequest(Method.POST);
IRestResponse response = client.Execute(request);
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

chain_id
string
required

Chain identifier

Body Params

external_ids
array of strings
required

Tags that can be used to identify your entry. You can search for records that contain a particular external_id using Connect. External IDs should be sent in Base64.

content
string
required

This is the data that will be stored directly on the blockchain. Please be sure that no private information is entered here. Content should be sent in Base64 format.

callback_url
string

The address you'd like the callback to be sent to. If this is not specified, callbacks will not activate.

callback_stages
array of strings

The immutability stages you'd like to be notified about. This list can include any or all of the three stages: replicated, factom, and anchored. If callbacks are activated and this field is not sent, it will default to factom and anchored

Response

Accepted

entry_hashstring

The SHA256 Hash of the entry you just created. You can use this hash to referece this entry in the future.

stagestring

The current immutability stage of the new entry. Only returned if callbacks are enabled.

Unprocessable entity

Suggest Edits

Get Chain's Entries

List all entries contained on the specified chain.

 

Header Auth

 Authentication is required for this endpoint.
gethttps://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries
curl --request GET \
  --url https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries");

xhr.send(data);
import requests

url = "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries"

response = requests.request("GET", url)

print(response.text)
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries")
  .get()
  .build();

Response response = client.newCall(request).execute();
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
var client = new RestClient("https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

chain_id
string
required

Chain identifier

Query Params

limit
integer

The number of items you would like back in each page.

offset
integer

The page you would like to request. The first page offset is Zero.

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: 'multi_az,factom'.

Response

OK

dataobject

An array that contains the entries on this page.

data.entry_hashstring

The SHA256 Hash of this entry.

data.chainobject

An object that contains the Chain Hash (ID) as well as a URL for the chain.

data.chain.chain_idstring

The ID for this chain on the Factom blockchain.

data.chain.hrefstring

An API link to retrieve all information about this chain.

data.created_atstring

The time at which this entry was created. Sent in ISO 8601 Format. For example: YYYY-MM-DDThh:mm:ssZ

data.hrefstring

An API link to retrieve all information about this entry.

offsetstring

The page offset. (Current page -1)

limitstring

The maximum number of entries per page.

countstring

The total number of entries seen.

Suggest Edits

Get Chain's First Entry

Retrieve the first entry that has been saved to this chain.

 

Header Auth

 Authentication is required for this endpoint.
gethttps://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/first
curl --request GET \
  --url https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/first
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/first");

xhr.send(data);
import requests

url = "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/first"

response = requests.request("GET", url)

print(response.text)
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/first")
  .get()
  .build();

Response response = client.newCall(request).execute();
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/first",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/first"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
var client = new RestClient("https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/first");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

chain_id
string
required

Chain identifier

Response

OK

dataobject
data.entry_hashstring

The SHA256 Hash of this entry.

data.chainobject

An object that contains the Chain Hash (ID) as well as a URL for the chain.

data.chain.chain_idstring

The ID for this chain on the Factom blockchain.

data.chain.hrefstring

An API link to retrieve all information about this chain.

data.created_atstring

The time when this entry was created. Sent in ISO 8601 Format. For example: YYYY-MM-DDThh:mm:ssZ

data.external_idsarray

Tags that can be used to identify your entry. You can search for records that contain a particular external_id using Connect. External IDs are returned in Base64.

data.contentstring

This is the data that is stored by the entry. Content will be sent in Base64 format.

data.stagestring

The level of immutability that this entry has reached.

data.eblockobject
data.eblock.keymrstring

The Key Merkle Root for this entry block.

data.eblock.hrefstring

An API link to retrieve all information about this entry block.

Suggest Edits

Get Chain's Last Entry

Retrieve the last entry that has been saved to this chain.

 

Header Auth

 Authentication is required for this endpoint.
gethttps://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/last
curl --request GET \
  --url https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/last
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/last");

xhr.send(data);
import requests

url = "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/last"

response = requests.request("GET", url)

print(response.text)
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/last")
  .get()
  .build();

Response response = client.newCall(request).execute();
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/last",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/last"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
var client = new RestClient("https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/last");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

chain_id
string
required

Chain identifier

Response

OK

dataobject
data.entry_hashstring

The SHA256 Hash of this entry.

data.chainobject

An object that contains the Chain Hash (ID) as well as a URL for the chain.

data.chain.chain_idstring

The ID for this chain on the Factom blockchain.

data.chain.hrefstring

An API link to retrieve all information about this chain.

data.created_atstring

The time when this entry was created. Sent in ISO 8601 Format. For example: YYYY-MM-DDThh:mm:ssZ

data.external_idsarray

Tags that can be used to identify your entry. You can search for records that contain a particular external_id using Connect. External IDs are returned in Base64.

data.contentstring

This is the data that is stored by the entry. Content will be sent in Base64 format.

data.stagestring

The level of immutability that this entry has reached.

data.eblockobject
data.eblock.keymrstring

The Key Merkle Root for this entry block.

data.eblock.hrefstring

An API link to retrieve all information about this entry block.

Suggest Edits

Search Chain's Entries

Find all of the entries within the specified chain that have the requested external_ids.

 

Header Auth

 Authentication is required for this endpoint.
posthttps://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/search
curl --request POST \
  --url https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/search
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/search");

xhr.send(data);
import requests

url = "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/search"

response = requests.request("POST", url)

print(response.text)
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/search")
  .post(null)
  .build();

Response response = client.newCall(request).execute();
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/search",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/search"

	req, _ := http.NewRequest("POST", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
var client = new RestClient("https://connect-shared-sandbox-2445582615332.production.gw.apicast.io/v1/chains/chain_id/entries/search");
var request = new RestRequest(Method.POST);
IRestResponse response = client.Execute(request);
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

chain_id
string
required

Chain identifier

Query Params

limit
integer

The number of items you would like back in each page.

offset
integer

The page you would like to request. The first page offset is Zero.

Body Params

external_ids
array of strings
required

A list of external IDs.

Response

OK

dataobject

An array of entries that match your search criterion.

data.entry_hashstring

The SHA256 Hash of this entry.

data.external_idsarray

Tags that can be used to identify this entry.

data.hrefstring

An API link to retrieve all information about this entry.

offsetstring

The page offset. (Current page -1)

limitstring

The maximum number of entries per page.

countstring

The total number of entries seen.

Suggest Edits

Immutability Stage Callbacks

Informs you about the status of an entry or chain. To activate this callback, include a callback_url field when creating your entry or chain. The callback response will include query parameters that will tell you the current stage of your entry and will give you a stage-specific reference to help you locate your entry.

For a more comprehensive guide on the use of callbacks, read the Bonus Round - Callbacks section of the guide.

 
posthttp://{callback_url}
curl --request POST \
  --url http://callback_url/
var request = require("request");

var options = { method: 'POST', url: 'http://callback_url/' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("http://callback_url/")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://callback_url/");

xhr.send(data);
import requests

url = "http://callback_url/"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

No response examples available

Query Params

entry_hash
string

The hash of the entry.

dblock_keymr
string

dblock_keymr stands for Directory Block Key Merkle Root. You can use this to identify the Factom directory block where Connect has stored your entry.

anchor_location
string

Indicates the specific public blockchain where this anchor is located. Currently, this is limited to Bitcoin, but more anchor locations will be available soon.

anchor_id_type
string

The type of the anchor ID changes based on the blockchain being referenced. For the Bitcoin blockchain, the anchor ID will be a block hash.

anchor_id
string

The actual ID of the anchor in question. This can be used to find your anchor in the corresponding blockchain.

stage
string

Indicates the stage of immutability that your entry has reached.

 

Callback Stages

can be set to notify you at three different stages of durability. You can select which stages you would like to be notified of by including the requested stages in the callback_stages field when you are creating a new chain or entry. You may include a single stage or multiple stages as you wish. The possible stages are as follows:

replicated

This stage means your entry or chain exists in multiple availability zones in the database. Your data isn't immutable quite yet; it's not stored on a blockchain. However, you've got replication across our networks as well as your local storage. When getting back your POST request, it'll include the entry_hash as one of the query parameters as well as the stage. This is the actual SHA256 hash of your entry.

factom

The entry has been submitted to a factom block and has been subsequently confirmed by the network. Your entry now exists in two different places: a replicated database and the Factom blockchain. If you include this string under callback_stages, you'll be sent a POST request with the stage as well as the dblock_keymr. dblock_keymr stands for Directory Block - Directory Block - Unlike in Bitcoin where all blocks are the same, Factom blocks are built with levels and hierarchy. Think of them like Russian nesting dolls where one block can contain many smaller blocks within. The big daddy of each set of blocks is the Directory block. These blocks are created every ten minutes and contain the hashes of all Entry blocks created within that period. These blocks also contain the serial hash of the previous block, allowing them to contribute to the immutability of the Factom blockchain. Key Merkle Root - Key Merkle Root - A Key Merkle Root is a Factom data structure which allows for rapid validation of a header. This unique structure combines the Merkle root of a Factom block with the hash of the header of the same block. This way you can validate the header and the block data using just one value. Much in the same way that the Merkle root in the header of a Bitcoin block can prove Bitcoin transactions, the entries of a Factom block can be validated by the Key Merkle root. . You can use this to identify the Factom directory block where has stored your entry.

anchored

Your entry reaches the final stage when we anchor it into a secondary public blockchain. Once this happens, your entry exists in two immutable blockchains and is nearly impossible to alter. The callback message will include the btc_block_hash of your entry as one of the query parameters. You can use this hash to locate the block that contains your Factom anchor in the Bitcoin blockchain.

Example Request to Initiate a Callback

curl --request POST \
  --url https:///v2/chains/36A2E...B027D/entries \
  --data '{"external_ids":["bXk=","bmV3","Y2hhaW4=","ZW50cnk="],"callback_stages":["replicated","factom","anchored"],"content":"V2FpdCwgYXJlIHlvdSByZWFsbHkgdGFraW5nIHRoZSB0aW1lIHRvIGNvbnZlcnQgdGhlc2UgYW5kIHJlYWQgdGhlbT8gV293Lg==","callback_url":"http://httpbin.org/post?my_id=12345"}' 
import requests

url = "https://apiplus-prod-mainnet.factom.com/chains/285904/entries"

payload = "{\"external_ids\":[\"bXk=\",\"bmV3\",\"Y2hhaW4=\",\"ZW50cnk=\"],\"content\":\"V2FpdCwgYXJlIHlvdSByZWFsbHkgdGFraW5nIHRoZSB0aW1lIHRvIGNvbnZlcnQgdGhlc2UgYW5kIHJlYWQgdGhlbT8gV293Lg==\",\"callback_url\":\"http://httpbin.org/post?my_id=\\\\\\\"12345\\\\\",\"callback_stages\":[\"multi_az\",\"factom\",\"public_witness\"]}"
response = requests.request("POST", url, data=payload)

print(response.text)
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://apiplus-prod-mainnet.factom.com/chains/285904/entries"

	payload := strings.NewReader("{\"external_ids\":[\"bXk=\",\"bmV3\",\"Y2hhaW4=\",\"ZW50cnk=\"],\"content\":\"V2FpdCwgYXJlIHlvdSByZWFsbHkgdGFraW5nIHRoZSB0aW1lIHRvIGNvbnZlcnQgdGhlc2UgYW5kIHJlYWQgdGhlbT8gV293Lg==\",\"callback_url\":\"http://httpbin.org/post?my_id=\\\\\\\"12345\\\\\",\"callback_stages\":[\"multi_az\",\"factom\",\"public_witness\"]}")

	req, _ := http.NewRequest("POST", url, payload)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
{
  "external_ids" : [ "bXk=", "bmV3", "Y2hhaW4=", "ZW50cnk=" ],
  "content" : "V2FpdCwgYXJlIHlvdSByZWFsbHkgdGFraW5nIHRoZSB0aW1lIHRvIGNvbnZlcnQgdGhlc2UgYW5kIHJlYWQgdGhlbT8gV293Lg==",
  "callback_url" : "http://httpbin.org/post?my_id=\"12345\"",
  "callback_stages" : [ "multi_az", "factom", "public_witness" ]
}

Example Callback Request

POST http://httpbin.org/post?my_id=12345&entry_hash=4DBA2...24C6D&stage=replicated
POST {callback_url}/?dblock_keymr={dblock_keymr}&stage=factom
POST {callback_url}/?btc_block_hash={bitcoin_block_hash}&stage=public_witness