Command Objects
Some TIBCO Scribe® API resources support command operations. These commands execute actions other than CRUD operations on the resource. See the documentation for the specific methods supported by each resource. While the commands are implemented as POST operations, there are different types of commands, each with different behavior: asynchronous, synchronous with results, and synchronous without results.
Command Type |
HTTP Verb |
HTTP Response On Success |
Notes |
---|---|---|---|
Asynchronous |
POST |
200 OK |
Used for commands that may take some time to return their results. To return the result of the command, use a corresponding GET method with the ID returned in the command model from the POST method. See the Asynchronous example. |
Synchronous with results |
POST |
200 OK |
Used for commands that return their results quickly. The POST returns a model with the result of the command. See the Synchronous With Results example. |
Synchronous without results |
POST |
204 NO CONTENT |
Used for commands that do not return results. See the Synchronous Without Results example. |
POST Examples
Asynchronous
The following asynchronous command tests an existing Connection against an Agent:
POST https://api.scribesoft.com/v1/orgs/12345678/connections/ec312f57-c4ab-46fb-b109-6c0020b58c0d/test?agentId=ec312f57-c4ab-46fb-b109-4c0020b68c0d
Returns the following model:
{
"id": "ec312f57-60ab-46fb-b109-4c00b0b68c0d",
"name": "TestConnection",
"reply": null,
"status": null
}
Then, when you use the ID returned from the above model with the following GET method:
GET https://api.scribesoft.com/v1/orgs/12345678/connections/test/?ec312f57-60ab-46fb-b109-4c00b0b68c0d
The actual results of the Connection test are returned:
{
"id": "ec312f57-60ab-46fb-b109-4c00b0b68c0d",
"name": "TestConnection",
"reply": "Success",
"status": "Success"
}
Synchronous With Results
The following POST method:
POST https://api.scribesoft.com/v1/orgs/12345678/agents/provision_onpremise_agent
Immediately returns the command model with the results of the command:
{
"AgentInstallationKey": "ec312f57-60ab-46fb-b109-4c00b0b68c0d",
"AgentInstallerLocation": ""
}
Synchronous Without Results
The following POST method:
POST https://api.scribesoft.com/v1/orgs/12345678/agents/provision_cloud_agent
Immediately returns the proper HTTP Response code.
See