Introduction
Welcome to the Stratumn API! You can use our API to access stratumn endpoints to create and interact with Traces.
Authentication
To authenticate against Stratumn API, you can use two methods that will return a JWT token.
Email and password
To authorize, use this code:
import axios from "axios";
const url = "https://api.<ENVIRONMENT>.stratumn.com/login/credential";
const payload = { email: "email", password: "password" };
axios
.post(url, payload, {
headers: {
"Content-Type": "application/json",
},
})
.then((response) => {
const rsp = response.data;
console.log(rsp);
});
export URI="https://api.<ENVIRONMENT>.stratumn.com/login/credential"
export bodycreation='{"email":"admin@stratumn.com", "password": "password"}'
export header="accept: */*"
export header2="Content-Type: application/json"
curl -X POST "$URI" -H "$header" -H "$header2" -d "$bodycreation"
The above command returns a JSON structured like this:
{
"token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoidG9rZW4iLCJzZXNzaW9uSWQiOiI5OTU0ZTJjZS1lMjhhLTQ0MDAtOTcyNS04OTNhYWZlMTQ4YjgiLCJ1c2VySWQiOiIyIiwiYWNjb3VudElkIjoiMiIsImlhdCI6MTY3OTY3NzE3NCwiZXhwIjoxNjc5NjgwNzc0fS.b-4utR-vEigt4TlcvN8_a3fO-9HQ6lI8-MJLJD7AGqwOilqm1BCrP5e40lAfqyLhgtL06LalIQIco3pmcdhH81GZbW4XJXEoAlCPKBQeFppLCU2LJv6ag64IiI-cB0qEuyZy0YiEnq7hy4EH1v3CymYC55Lbv4cRXp-UI3NbWf7qp899MqHF5_kN9mJV1uYUzhGTr3khHp8j3fyICYLwfoUMzyyqLzAVMjAqal8IQovutWwOCDnN1v3Z4t6zxO-Pdgf6N2p53kjMo1ZwwOmsHgM3gOIR8vIuKQU7EpTljdQ5BB5cW0Za95Gdb7BrSgpgcuekr0sUOFGYLvNEJiYKZw"
}
You can authenticate using your email and password.
HTTP Request
POST https://api.<ENVIRONMENT>.stratumn.com/login/credential
Body Parameters
Parameter | Description |
---|---|
email of the user used to login | |
password | password of the user used to login |
Private key
To authorize, use this code:
import axios from "axios";
const url = "https://api.<ENVIRONMENT>.stratumn.com/login/privateKey";
const payload = {
privateKey:
"-----BEGIN ED25519 PRIVATE KEY-----MFACAQAwBwYDK2VwBQAEQgRAZHookpbRb/tFUR1huz4Hlo+F4iBplYjSN0bpB1E4j2llcI3alpEisMEIdUbjZoENrazks6S9a7u8RsddmROesw==-----END ED25519 PRIVATE KEY-----",
};
axios
.post(url, payload, {
headers: {
"Content-Type": "application/json",
},
})
.then((response) => {
const rsp = response.data;
console.log(rsp);
});
export URI="https://api.<ENVIRONMENT>.stratumn.com/login/privateKey"
export bodycreation='{"privateKey":"-----BEGIN ED25519 PRIVATE KEY-----MFACAQAwBwYDK2VwBQAEQgRAZHookpbRb/tFUR1huz4Hlo+F4iBplYjSN0bpB1E4j2llcI3alpEisMEIdUbjZoENrazks6S9a7u8RsddmROesw==-----END ED25519 PRIVATE KEY-----"}'
export header="accept: */*"
export header2="Content-Type: application/json"
curl -X POST "$URI" -H "$header" -H "$header2" -d "$bodycreation"
The above command returns a JSON structured like this:
{
"token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoidG9rZW4iLCJzZXNzaW9uSWQiOiI5OTU0ZTJjZS1lMjhhLTQ0MDAtOTcyNS04OTNhYWZlMTQ4YjgiLCJ1c2VySWQiOiIyIiwiYWNjb3VudElkIjoiMiIsImlhdCI6MTY3OTY3NzE3NCwiZXhwIjoxNjc5NjgwNzc0fS.b-4utR-vEigt4TlcvN8_a3fO-9HQ6lI8-MJLJD7AGqwOilrm1BCrP5e40lAfqyLhgtL06LalIQIco3pmcdhH81GZbW4XJXEoAlCPKBQeFppLCU2LJv6ag64IiI-cB0qEuyZy0YiEnq7hy4EH1v3CymYC55Lbv4cRXp-UI3NbWf7qp899MqHF5_kN9mJV1uYUzhGTr3khHp8j3fyICYLwfoUMzyyqLzAVMjAqal8IQovutWwOCDnN1v3Z4t6zxO-Pdgf6N2p53kjMo1ZwwOmsHgM3gOIR8vIuKQU7EpTljdQ5BB5cW0Za95Gdb7BrSgpgcuekr0sUOFGYLvNEJiYKZw"
}
You can authenticate using a private key.
HTTP Request
POST https://api.<ENVIRONMENT>.stratumn.com/login/privateKey
Body Parameters
Parameter | Description |
---|---|
privateKey | the private key of the account used to login |
Traces
The following routes are used to:
- create a new Trace
- perform an action on an existing Trace
- get the Trace state
- get the Trace details
- search Traces by state data
Create a new Trace
import axios from "axios";
import * as FormData from "form-data";
const url = "https://api.<ENVIRONMENT>.stratumn.com/trace";
const formData = new FormData();
formData.append("userFile", readFileSync("/userfile.txt", "utf8"), "file");
formData.append(
"body",
JSON.stringify({
data: {
name: "John Doe",
age: 42,
file: [{ file: "userFile" }],
},
actionKey: "createUser",
workflowId: "1",
groupLabel: "userCreator",
})
);
axios
.post(url, formData, {
headers: {
...formData.getHeaders(),
"Content-Length": formData.getLengthSync(),
Authorization: `Bearer ${token}`,
},
})
.then((response) => {
const traceId = response.data;
console.log(traceId);
});
export URI="https://api.<ENVIRONMENT>.stratumn.com/trace"
export bodycreation='body={"data":{"reinsurer":"Reinsurer 1","entity":"AXA XL/AXL","submissionPeriod":"2015.Q1","programName":"ACS/PARAMETRIC/QS"},"actionKey":"setup","workflowId":"1058","groupLabel":"acorAutomation"}'
export Authorization="Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoidG9rZW4iLCJzZXNzaW9uSWQiOiI0Y2IzNjYwMy0wYTE4LTQwYjItYTc2YS0xZjRhMTIyZDI0YWUiLCJ1c2VySWQiOiIxIiwiYWNjb3VudElkIjoiMSIsImlhdCI6MTY5NTY0NTA2OSwiZXhwIjoxNjk1NjU5NDY5fQ.BJACV-VsF4O74kLaU5jXb5H91xTVNACRhUOENotwWaMNClHl19X6flJeDm2rMeodJeVbc1tM7xrZTYnyB_Q3476Pkrr65gFFEyTyzJfzCYAR882koXsKpUZsSWUz2YJG-1Qsoa9EVVmqwjnNqvNH7g3P7jlieXngjcEAJUIEhIVWwGVukKAcjYEnEso7za7fXfaUrjbh3yPLwZJ-LDZ0dpYchy9pa4FQFb0LIHWl1aPszEaqFQoK4ghUIty3PPP-LG3EIAYiC7Q67VL5iGB8l4GrWHB-vq9my-nL9i31zQTeXn1IUyx_rgconSprdiIytaK09XLEq9TqSWVXRkGs0Q"
export header="accept: */*"
curl -X POST "$URI" -H "$header" -H "$Authorization" -F "$bodycreation"
The above command returns the Trace id:
"50b09389-bbeb-40b9-a76e-af42b99w1a20"
This endpoint creates a new Trace
HTTP Request
POST https://api.<ENVIRONMENT>.stratumn.com/trace
Body Parameters
Parameter | Description |
---|---|
body | contains the new Trace input data (must contain keysdata , actionKey , workflowId , groupLabel ) |
* (except body ) |
contains a file to upload |
Responses
Code | Description |
---|---|
201 | Successfully created trace |
400 | Bad request |
401 | Unauthorized |
In the body, the following keys are required:
data
: the input data of the TraceactionKey
: the action initiating the new TraceworkflowId
: the id of the workflow to usegroupLabel
: the group label performing the action
To upload a file, add a new body parameter with the file as value. The parameter must be added to the body as a key-value pair where the key file
and the value is the parameter. In the example, the file is uploaded in the userFile
parameter. This parameter is then used in the data
object to reference the file file: [{file: 'userFile'}]
. If several files need to be uploaded, they can be added to the body as new parameters. The data
object must then be updated to reference the files : file: [{file: 'userFile'}, {file: 'userFile2'}]
In the shell example, we just set a body with the required action fields. Notify that we have to set 'body=...' inside the body variable to specify that this is the body since we have to seperate the body from the file (see /link example).
Add an action to a Trace
import axios from "axios";
import * as FormData from "form-data";
const url =
"https://api.<ENVIRONMENT>.stratumn.com/trace/50b09389-bbeb-40b9-a76e-af42b9941a20/link";
const formData = new FormData();
formData.append(
"body",
JSON.stringify({
data: {
validation: true,
},
actionKey: "validateUser",
workflowId: "1",
groupLabel: "userValidator",
})
);
axios
.post(url, formData, {
headers: {
...formData.getHeaders(),
"Content-Length": formData.getLengthSync(),
Authorization: `Bearer ${token}`,
},
})
.then((response) => {
const traceId = response.data;
console.log(traceId);
});
export URI="https://api.<ENVIRONMENT>.stratumn.com/trace/0c99c735-81a8-4af2-99bc-a2faa53e6864/link"
export file="xml=@./test.xml;type=application/xml"
export bodycreation='body={
"data": {
"TASumFull": [
{
"correctionIndicator": "",
"amtStatus": "",
"amount": 23054.31,
"cedent": "AXA ASS. MAROC",
"cedentBuid": "2222",
"currency": "MAD",
"endDate": "2020-12-31",
"financialReinsurer": "test",
"flowId": "333333-333333",
"posting": "deposit_retained_premium_fund",
"program": "MA/CAR and EAR SP/AXA CESSIONS BROKER",
"reinsurer": "SCOR GLOBAL P&C",
"reinsurerBuid": "2222",
"reinsurerShare": 22,
"section": "1 MA + AFR / EAR CAR SP",
"sectionNb": "1",
"taRef": "170948",
"treaty": "MA + AFR / EAR CAR SP",
"treatyNb": "2222-376602"
},
{
"correctionIndicator": "",
"amtStatus": "",
"amount": 23054.31,
"amtStatus": "informational",
"cedent": "AXA ASS. MAROC",
"cedentBuid": "2222",
"currency": "MAD",
"endDate": "2020-12-31",
"financialReinsurer": "2222-SCOR SE /FR",
"flowId": "222222-222222",
"posting": "unearned_premium_reserve_net",
"program": "MA/CAR and EAR SP/AXA CESSIONS BROKER",
"reinsurer": "SCOR GLOBAL P&C",
"reinsurerBuid": "2222",
"reinsurerShare": 22,
"section": "1 MA + AFR / EAR CAR SP",
"sectionNb": "1",
"taRef": "222222",
"treaty": "MA + AFR / EAR CAR SP",
"treatyNb": "2222-376602"
}
],
"file": {
"file": "xml"
}
},
"actionKey": "upload",
"workflowId": "1058",
"groupLabel": "acorAutomation"
}'
export Authorization="Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoidG9rZW4iLCJzZXNzaW9uSWQiOiI4ZjM4NDliNi1iNmE5LTQxMTQtYTRhOS1kNmJjNDMxNzVjNzIiLCJ1c2VySWQiOiIxIiwiYWNjb3VudElkIjoiMSIsImlhdCI6MTY5NTM5NDkxOCwiZXhwIjoxNjk1NDA5MzE4fQ.SOnkTMPmeqx7Pj6GNX00MjT6U2Y1wLipHLsJcojgNfusTZzvAyx_uWGTk7o04JqE2AF1QOuefrgRUyVDqw5K4G3tt1EklnCkDvnp7yvPB-4QQ9mn7iUA4izqXmA-UEmB3jKbsrreyuydbruV9KZlgTQ1gump0tJyWzOJroWHozEmHrq7NuA87qiEKzW8oJELP47aJXeGozwJeNv6A_83SU1UpHfOu6-U-HjHEfJ3jIHbbB7oon3mcfa0KjcckWmm5p7Xej9lTeR-bu145J8NwazoCC7QM343CNxmNNMZhsLTHkumZABypi4xdoe2k8L6u23FiGuCumvsQSEw2er6hQ"
export header="accept: */*"
curl -X POST "$URI" -H "$header" -H "$Authorization" -F "$file" -F "$bodycreation"
The above command returns the Trace state:
{
"traceId": "50b09389-bbeb-40w9-a76e-af42b9941a20",
"headLink": {
"link": {
"version": "1.0.0",
"data": "eyJhbGdvIjoic2hhMjU2IiwiaGFzaCI6IkNERzFpRkJrNlFYQi9UNHZacmJYYTFmNUxkMmg1QjB6VFlMV3luRWVOVU09In0=",
"meta": [Object],
"signatures": [Array]
},
"_formData": { "validation": true }
},
"updatedAt": "2023-03-27T07:13:51.582Z",
"updatedBy": "2",
"updatedByGroupId": "253",
"data": {
"name": "John Doe",
"age": 42,
"file":[
{
"key": "3InW2F0dqXnN8zKqxfQQ3XYBGi5E5MnZXqf4eJCsdxY=",
"name": "userFile",
"size": 130896,
"digest": "11141bd52b66dffdcda01d82352a3fa6e17a6e6c69f9",
"mimetype": "text/plain",
"createdAt": "2023-03-27T08:12:47.775Z"
}
],
"validation": true
},
"tags": []
}
This endpoint adds a link to an exising Trace.
HTTP Request
POST https://api.<ENVIRONMENT>.stratumn.com/trace/<traceID>/link
URL Parameters
Parameter | Description |
---|---|
traceID | The ID of the Trace where the link will be added |
Body Parameters
Parameter | Description |
---|---|
body | contains the new link input data (must contain keysdata , actionKey , workflowId , groupLabel ) |
(except body ) |
contains a file to upload |
Responses
Code | Description |
---|---|
201 | Successfully added link to trace |
400 | Bad request |
401 | Unauthorized |
To upload files, see example in previous route.
In the shell example, we deal with a Data Importer action. In that specific case, you must pass into the body data the name of the variable corresponding to the array's name defined in the workflow (TASumFull in our case) and the data of your xml file associated (1 object = 1 xml line). Moreover, if you want your xml file to be available in the frontend, you can pass it as a classic file variable as it's shown in the example (see the 'file' variable at the end of the body). The file variable is optionnal. Be aware that when we export the file variable (@./text.xml), the file is in the current directory ('./') .
Get the Trace state
import axios from "axios";
const url =
"https://api.<ENVIRONMENT>.stratumn.com/trace/50b09389-bweb-40b9-a76e-af42b9941a20/state";
axios
.get(url, {
headers: {
Authorization: `Bearer ${token}`,
},
})
.then((response) => {
const state = response.data;
console.log(state);
});
export URI="https://api.<ENVIRONMENT>.stratumn.com/trace/0c99c735-81a8-4af2-99bc-a2faa53e6864/state"
export Authorization="Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoidG9rZW4iLCJzZXNzaW9uSWQiOiI4ZjM4NDliNi1iNmE5LTQxMTQtYTRhOS1kNmJjNDMxNzVjNzIiLCJ1c2VySWQiOiIxIiwiYWNjb3VudElkIjoiMSIsImlhdCI6MTY5NTM5NDkxOCwiZXhwIjoxNjk1NDA5MzE4fQ.SOnkTMPmeqx7Pj6GNX00MjT6U2Y1wLipHLsJcojgNfusTZzvAyx_uWGTk7o04JqE2AF1QOuefrgRUyVDqw5K4G3tt1EklnCkDvnp7yvPB-4QQ9mn7iUA4izqXmA-UEmB3jKbsrreyuydbruV9KZlgTQ1gump0tJyWzOJroWHozEmHrq7NuA87qiEKzW8oJELP47aJXeGozwJeNv6A_83SU1UpHfOu6-U-HjHEfJ3jIHbbB7oon3mcfa0KjcckWmm5p7Xej9lTeR-bu145J8NwazoCC7QM343CNxmNNMZhsLTHkumZABypi4xdoe2k8L6u23FiGuCumvsQSEw2er6hQ"
export header="accept: */*"
curl -X GET "$URI" -H "$header" -H "$Authorization"
The above command returns the Trace state:
{
"traceId": "50b09389-bbeb-40w9-a76e-af42b9941a20",
"headLink": {
"link": {
"version": "1.0.0",
"data": "eyJhbGdvIjoic2hhMjU2IiwiaGFzaCI6IkNERzFpRkJrNlFYQi9UNHZacmJYYTFmNUxkMmg1QjB6VFlMV3luRWVOVU09In0=",
"meta": [Object],
"signatures": [Array]
},
"_formData": { "validation": true }
},
"updatedAt": "2023-03-27T07:13:51.582Z",
"updatedBy": "2",
"updatedByGroupId": "253",
"data": {
"name": "John Doe",
"age": 42,
"file":[
{
"key": "3InW2F0dqXnN8zKqxfQQ3XYBGi5E5MnZXqf4eJCsdxY=",
"name": "userFile",
"size": 130896,
"digest": "11141bd52b66dffdcda01d82352a3fa6e17a6e6c69f9",
"mimetype": "text/plain",
"createdAt": "2023-03-27T08:12:47.775Z"
}
],
"validation": true
},
"tags": []
}
This endpoint gets the Trace state.
HTTP Request
GET https://api.<ENVIRONMENT>.stratumn.com/trace/<traceID>/state
URL Parameters
Parameter | Description |
---|---|
traceID | The ID of the Trace |
Responses
Code | Description |
---|---|
200 | Success |
400 | Bad request |
401 | Unauthorized |
Get the Trace details
import axios from "axios";
const url =
"https://api.<ENVIRONMENT>.stratumn.com/trace/50b09389-bbeb-40w9-a76e-af42b9941a20/details";
const payload = {
last: 10,
};
axios
.post(url, payload, {
headers: {
Authorization: `Bearer ${token}`,
},
})
.then((response) => {
const details = response.data;
console.log(details);
});
export URI="https://api.<ENVIRONMENT>.stratumn.com/trace/0c99c735-81a8-4af2-99bc-a2faa53e6864/details"
export Authorization="Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoidG9rZW4iLCJzZXNzaW9uSWQiOiI4ZjM4NDliNi1iNmE5LTQxMTQtYTRhOS1kNmJjNDMxNzVjNzIiLCJ1c2VySWQiOiIxIiwiYWNjb3VudElkIjoiMSIsImlhdCI6MTY5NTM5NDkxOCwiZXhwIjoxNjk1NDA5MzE4fQ.SOnkTMPmeqx7Pj6GNX00MjT6U2Y1wLipHLsJcojgNfusTZzvAyx_uWGTk7o04JqE2AF1QOuefrgRUyVDqw5K4G3tt1EklnCkDvnp7yvPB-4QQ9mn7iUA4izqXmA-UEmB3jKbsrreyuydbruV9KZlgTQ1gump0tJyWzOJroWHozEmHrq7NuA87qiEKzW8oJELP47aJXeGozwJeNv6A_83SU1UpHfOu6-U-HjHEfJ3jIHbbB7oon3mcfa0KjcckWmm5p7Xej9lTeR-bu145J8NwazoCC7QM343CNxmNNMZhsLTHkumZABypi4xdoe2k8L6u23FiGuCumvsQSEw2er6hQ"
export header="accept: */*"
curl -X POST "$URI" -H "$header" -H "$Authorization"
The above command returns the Trace details:
{
"links": [
{ "link": [Object], "_formData": [Object] },
{ "link": [Object], "_formData": [Object] }
],
"totalCount": 2,
"info": {
"hasNext": false,
"hasPrevious": false,
"startCursor": "WyJuYXR1cmFsIiwxXQ==",
"endCursor": "WyJuYXR1cmFsIiwyXQ=="
}
}
This endpoint gets the Trace details.
HTTP Request
POST https://api.<ENVIRONMENT>.stratumn.com/trace/<traceID>/details
URL Parameters
Parameter | Description |
---|---|
traceID | The ID of the Trace |
Body Parameters
Parameter | Description |
---|---|
first | - |
after | - |
last | - |
before | - |
Responses
Code | Description |
---|---|
200 | Success |
400 | Bad request |
401 | Unauthorized |
Get Trace IDs by workflow ID filtered by their State data
import axios from "axios";
const worklowId = 600;
const filters = {
entityLabel: "france",
reference: 300,
startDate: "<=2023-02-20",
"status.progress": ">0.4",
entityName: "~Fran%",
};
const url = `https://api.<ENVIRONMENT>.stratumn.com/trace/search/${workflowId}`;
const payload = {
filters,
};
axios
.post(url, payload, {
headers: {
Authorization: `Bearer ${token}`,
},
})
.then((response) => {
const traceIds = response.data;
console.log(traceIds);
});
export URI="https://api.<ENVIRONMENT>.stratumn.com/trace/search/1058"
export Authorization="Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoidG9rZW4iLCJzZXNzaW9uSWQiOiI4ZjM4NDliNi1iNmE5LTQxMTQtYTRhOS1kNmJjNDMxNzVjNzIiLCJ1c2VySWQiOiIxIiwiYWNjb3VudElkIjoiMSIsImlhdCI6MTY5NTM5NzE4MiwiZXhwIjoxNjk1NDExNTgyfQ.caqiqYvUhEBehcZTrcuT8y4PgRNCcoUTUrkh4ZDjaIe-nC8BJcEeSl8W6CRZRGVMiqPEnCxRubjH5GulpfwFSV0EUzraKHJJJ9xIBOEZo3wcepwJ7pX_KHkJDOIgxU3WbRCg4Wn_lJFYA4VdNFwcBNPRROHIhReK8JP7jTtMwbhba67deHSPZJa7dII7FdSIBZsyXVhVoSXRjBlBWY-BlI7Em7mVVqIxqvW5PQXXCTv4H5tfE7VSeB4A6axufbycmcTzUK0ghyM5ddU3cRn1JzEweIbOmWLc971x49hQrUtBY6-Vnlyvyb0eaP6-HD3zzl1gABVrip7mj8Ui4F1jSw"
export header="accept: */*"
export filters='{"entity": "=AXA XL/AXL"}'
curl -X POST "$URI" -H "$header" -H "$Authorization" -d "$filters"
The above command returns an array that contains the Traces' ID:
[
"cf201137-1101-4c67-a3da-66e3939b9d4f",
"47b51057-e033-3abf-872f-0726a5348804",
"d4300477-4520-4c0r-9109-7e27b22c33k8"
]
This endpoint returns an array of the IDs of all the Traces that match the provided filters
HTTP Request
POST https://api.<ENVIRONMENT>.stratumn.com/trace/search/<workflowID>
URL Parameters
Parameter | Description |
---|---|
workflowID | The Workflow ID in which Traces are searched on |
Body Parameters
If no body is provided, all the Traces' ID which belong to the provided Workflow ID will be returned.
filters (object, optionnal)
The filters
object is used to filter the data based on the specified key-value pairs. The keys in the filters
object should match the keys in the State data object. You can access nested keys by using dot notation: "status.value"
.
The values in the filters object can be any value or a combination of a value and an operator. The available operators are:
Symbol | Description |
---|---|
= | equal to (default operator) |
< | less than |
> | greater than |
<= | less than or equal to |
>= | greater than or equal to |
<> | not equal to |
~ | like (for string pattern matching) |
If no operator is provided, the equal operator (=) will be used by default. You can use the operators to perform various filtering operations.
Responses
Code | Description |
---|---|
200 | Success |
400 | Bad request |
401 | Unauthorized |
Download files using Trace ID and File Digests
import axios from "axios";
const traceId = debee65c-e4f7-452c-aa7e-fe6d5bfac432;
const digest = 11147accedb033273222aa09491eb860ace1af464114;
const url = `https://api.<ENVIRONMENT>.stratumn.com/trace/${traceId}/file/${digest}`
axios
.get(url, {
headers: {
Authorization: `Bearer ${token}`,
},
})
.then((response) => {
const files = response.data;
console.log(files);
});
export URI="https://api.<ENVIRONMENT>.stratumn.com/trace/0c99c735-81a8-4af2-99bc-a2faa53e6864/file/1114c0a26f6fcf22dfa8049d32e53de137400c911c1c"
export Authorization="Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoidG9rZW4iLCJzZXNzaW9uSWQiOiI4ZjM4NDliNi1iNmE5LTQxMTQtYTRhOS1kNmJjNDMxNzVjNzIiLCJ1c2VySWQiOiIxIiwiYWNjb3VudElkIjoiMSIsImlhdCI6MTY5NTM5NDkxOCwiZXhwIjoxNjk1NDA5MzE4fQ.SOnkTMPmeqx7Pj6GNX00MjT6U2Y1wLipHLsJcojgNfusTZzvAyx_uWGTk7o04JqE2AF1QOuefrgRUyVDqw5K4G3tt1EklnCkDvnp7yvPB-4QQ9mn7iUA4izqXmA-UEmB3jKbsrreyuydbruV9KZlgTQ1gump0tJyWzOJroWHozEmHrq7NuA87qiEKzW8oJELP47aJXeGozwJeNv6A_83SU1UpHfOu6-U-HjHEfJ3jIHbbB7oon3mcfa0KjcckWmm5p7Xej9lTeR-bu145J8NwazoCC7QM343CNxmNNMZhsLTHkumZABypi4xdoe2k8L6u23FiGuCumvsQSEw2er6hQ"
export header="accept: */*"
curl -X POST "$URI" -H "$header" -H "$Authorization"
The above command returns the downloaded file.
This endpoint returns the downloaded file.
HTTP Request
GET https://api.<ENVIRONMENT>.stratumn.com/trace/<traceID>/file/<digest>
URL Parameters
Parameter | Description |
---|---|
traceID | The ID of the Trace where the files will be downloaded |
digest | The Digest of the File that will be downloaded |
Responses
Code | Description |
---|---|
200 | Success |
400 | Bad request |
401 | Unauthorized |
Download files using Trace ID and File Digests
import axios from "axios";
const traceId = debee65c-e4f7-452c-aa7e-fe6d5bfac432;
const digests[] = [
11147accedb033273222aa09491eb860ace1af464114,
111418828734e69af6ca7341d53c262a392597c71d56
];
const url = `https://api.<ENVIRONMENT>.stratumn.com/trace/${traceId}/files?digests=${digests[]}`
axios
.get(url, {
headers: {
Authorization: `Bearer ${token}`,
},
})
.then((response) => {
const files = response.data;
console.log(files);
});
export URI="https://api.<ENVIRONMENT>.stratumn.com/trace/0c99c735-81a8-4af2-99bc-a2faa53e6864/files?digests=1114c0a26f6fcf22dfa8049d32e53de137400c911c1c"
export Authorization="Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoidG9rZW4iLCJzZXNzaW9uSWQiOiI4ZjM4NDliNi1iNmE5LTQxMTQtYTRhOS1kNmJjNDMxNzVjNzIiLCJ1c2VySWQiOiIxIiwiYWNjb3VudElkIjoiMSIsImlhdCI6MTY5NTM5NDkxOCwiZXhwIjoxNjk1NDA5MzE4fQ.SOnkTMPmeqx7Pj6GNX00MjT6U2Y1wLipHLsJcojgNfusTZzvAyx_uWGTk7o04JqE2AF1QOuefrgRUyVDqw5K4G3tt1EklnCkDvnp7yvPB-4QQ9mn7iUA4izqXmA-UEmB3jKbsrreyuydbruV9KZlgTQ1gump0tJyWzOJroWHozEmHrq7NuA87qiEKzW8oJELP47aJXeGozwJeNv6A_83SU1UpHfOu6-U-HjHEfJ3jIHbbB7oon3mcfa0KjcckWmm5p7Xej9lTeR-bu145J8NwazoCC7QM343CNxmNNMZhsLTHkumZABypi4xdoe2k8L6u23FiGuCumvsQSEw2er6hQ"
export header="accept: */*"
curl -X POST "$URI" -H "$header" -H "$Authorization"
The above command returns a zip file that contains the Decrypted Files.
This endpoint returns a zip file containing the downloaded decrypted files.
HTTP Request
GET https://api.<ENVIRONMENT>.stratumn.com/trace/<traceID>/files?digests=<digest>,<digest>
URL Parameters
Parameter | Description |
---|---|
traceID | The ID of the Trace where the files will be downloaded |
digest | The Digest of the File that will be downloaded |
Responses
Code | Description |
---|---|
200 | Success |
400 | Bad request |
401 | Unauthorized |
Workflows
The following routes are used to:
- Retrieve the workflows of a given organization by name
Get Workflows by organization name
import axios from "axios";
const url = "https://api.<ENVIRONMENT>.stratumn.com/workflow/orgName/myOrganizationName";
axios
.get(url, {
headers: {
Authorization: `Bearer ${token}`,
},
})
.then((response) => {
const workflows = response.data;
console.log(workflows);
});
export URI="https://api.<ENVIRONMENT>.stratumn.com/workflow/orgName/Stratumn"
export Authorization="Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoidG9rZW4iLCJzZXNzaW9uSWQiOiI4ZjM4NDliNi1iNmE5LTQxMTQtYTRhOS1kNmJjNDMxNzVjNzIiLCJ1c2VySWQiOiIxIiwiYWNjb3VudElkIjoiMSIsImlhdCI6MTY5NTM5NDkxOCwiZXhwIjoxNjk1NDA5MzE4fQ.SOnkTMPmeqx7Pj6GNX00MjT6U2Y1wLipHLsJcojgNfusTZzvAyx_uWGTk7o04JqE2AF1QOuefrgRUyVDqw5K4G3tt1EklnCkDvnp7yvPB-4QQ9mn7iUA4izqXmA-UEmB3jKbsrreyuydbruV9KZlgTQ1gump0tJyWzOJroWHozEmHrq7NuA87qiEKzW8oJELP47aJXeGozwJeNv6A_83SU1UpHfOu6-U-HjHEfJ3jIHbbB7oon3mcfa0KjcckWmm5p7Xej9lTeR-bu145J8NwazoCC7QM343CNxmNNMZhsLTHkumZABypi4xdoe2k8L6u23FiGuCumvsQSEw2er6hQ"
export header="accept: */*"
curl -X GET "$URI" -H "$header" -H "$Authorization"
The above command returns the infos of all the Workflows of the provided organization:
[
{
"workflowId": 1,
"workflowName": "Workflow1"
},
{
"workflowId": 2,
"workflowName": "Workflow2"
}
]
This endpoint gets the infos of all the Workflows of the provided organization. It returns an array of objects that contains the Workflow's ID and the Workflow's name.
HTTP Request
GET https://api.<ENVIRONMENT>.stratumn.com/workflow/orgName/<orgName>
URL Parameters
Parameter | Description |
---|---|
orgName | The name of the organization |
Responses
Code | Description |
---|---|
200 | Success |
400 | Bad request |
401 | Unauthorized |