This section guides you through using the Cyclr API to install a Template into an Account.
You must already have a Cyclr API Access Token.
Get a list of available Templates #
Templates are integrations built by you in your Console’s drag-and-drop builder and are located in your Console’s Template Library.
They can be installed in your end users’ Accounts.
Your own application could present a list of your available Templates to your end users by making this call to Cyclr’s API:
Request:
GET /v1.0/templates
Authorization Bearer ********************
Response:
[
{
"Name": "Pipedrive > MailChimp",
"Description": null,
"Id": "7ad2265e-2ff0-477b-b913-cae1dfde2ea8",
"Connectors": [
{
"Id": 2550,
"Name": "Pipedrive",
"Version": "1.0",
"StepCount": 1,
"Icon": null
},
{
"Id": 2582,
"Name": "MailChimp",
"Version": "v3",
"StepCount": 1,
"Icon": null
}
]
}
]
Install a Template #
Request:
POST /v1.0/templates/{Template ID}/install
Authorization: Bearer ********************
X-Cyclr-Account: 00000000-0000-0000-0000-000000000000
Response:
{
"Id": "cf636e9c-13dd-47ea-b0e8-88a5bf7f7b00",
"CreatedOnUtc": "2017-12-06T16:21:46.0499829Z",
"TasksUsed": 0,
"ErrorCount": 0,
"WarningCount": 0,
"Connectors": [
{
"Id": 2550,
"AccountConnectorId": 51,
"Name": "Pipedrive",
"Version": "1.0",
"Authenticated": true,
"StepCount": 1,
"Icon": null
},
{
"Id": 2582,
"AccountConnectorId": 52,
"Name": "MailChimp",
"Version": "v3",
"Authenticated": true,
"StepCount": 1,
"Icon": null
}
],
"Status": "Paused",
"LastSuccessfulRunDate": "0001-01-01T00:00:00",
"InProgressTransactionCount": 0,
"Name": "Pipedrive > MailChimp",
"Description": null,
"Shareable": false,
"ContinueOnStepError": true,
"LogStepDataRequests": true,
"StepDataSuccessRetentionHours": null,
"StepDataErroredRetentionHours": null,
"TemplateId": "7ad2265e-2ff0-477b-b913-cae1dfde2ea8"
}
Note: If you install a template, Cyclr also installs all of the connectors the cycle needs to run.
Get Cycle Prerequisites #
A Cycle installed in an Account from a Template may have prerequisites that need to be provided before the Cycle can be activated.
The Cyclr API can provide information on the prerequisites for a Cycle to run:
Request:
GET /v1.0/cycles/{Cycle Id}/prerequisites
Authorization Bearer ********************
X-Cyclr-Account: 00000000-0000-0000-0000-000000000000
Response
[
{
"ReasonCode": 20,
"Reason": "Unauthenticated connector",
"ObjectType": "AccountConnector",
"ObjectId": 36328
},
{
"ReasonCode": 20,
"Reason": "Unauthenticated connector",
"ObjectType": "AccountConnector",
"ObjectId": 36329
},
{
"ReasonCode": 30,
"Reason": "Missing mapping",
"ObjectType": "Action",
"ObjectId": "709b68ba-394e-4339-9550-abd0312e8dd5"
}
]
In this example, there are the following pre-requisites:
- Two Connectors that are unauthenticated
- A Step with a missing field mapping
Full list of potential prerequisites #
ReasonCode | Reason |
---|---|
0 | Unknown |
10 | Cycle must have at least two steps |
11 | All steps must be connected together and only one step can be the trigger |
20 | Unauthenticated connector |
30 | Missing mapping |
31 | Missing decision criteria |
32 | Missing delay time period |
33 | Missing date to wait until |
40 | Missing parameter mapping |
41 | Missing field mapping |
42 | Missing collection key mapping |
43 | Missing webhook key mapping |
50 | Missing left operand |
51 | Missing right operand |
60 | Missing delay unit |
61 | Missing delay interval |
70 | Missing wait until date |