Simulation API

post
Run a template

https://api.iotify.io/v1/template
This endpoint allows you to simulate a template
Request
Response
Request
Headers
Content-Type
optional
string
application/json
X-Auth
required
string
Secret Token obtained through settings page
Body Parameters
delay
optional
number
parallel
optional
number
clients
required
number
interval
required
number
repeat
required
number
template
required
string
Response
200: OK
Template Successfully run
{ success: true, job: “name of the simulation” }
400: Bad Request
Failed to launch the template.
{ success: false, reason: "Error Reason"}

get
Get Job Status

https://api.iotify.io/v1/job
This API returns the status of the simulation job
Request
Response
Request
Query Parameters
job
required
string
Simulation ID as seen in the UI or returned by job key while launching the simulation through the API.
latency
optional
boolean
Whether the include latency measurement in the results.
Response
200: OK
The response contains various fields of the simulation result. Important one are shown as follows:- success: true result: The current status of job, updated in the real time. The status object has several subkeys: success: The total count of succeeded iterations (including all clients) failure: Total failed iterations abandoned: Iterations which could not be executed. status: Current Status of the job. Could be 'pending/running/finished/aborted' latency: (optional) if request has a latency flag, a top level object containing aggregates of Packet sending latency, Message generation latency and Subscription response latency across each iteration. The min, max and average values are calculated across all the clients. start: start timestamp of simulation end: ending timestamp of the simulation.
{
"success": true,
"status": {
"success": 1,
"failure": 9,
"abandoned": 0,
"status": "finished",
"latency": {
"send": {
"0": {
"min": 1,
"max": 1,
"avg": 1
},
...
"9": {
"min": 1,
"max": 1,
"avg": 1
}
},
"msg": {
"0": {
"min": 1,
"max": 1,
"avg": 1
},
...
"9": {
"min": 1,
"max": 1,
"avg": 1
}
},
"sub": {
"0": {
"min": 0,
"max": 0,
"avg": 0
},
...
"9": {
"min": 0,
"max": 0,
"avg": 0
}
}
},
"start": "2020-05-28T15:07:21.620Z",
"end": "2020-05-28T15:08:10.829Z"
}
}
400: Bad Request
{ success: false, reason: "Couldn't find the job" }