The API is implemented as a RESTful web service, with appropriate GET, PUT, POST & DELETE verbs. To use the API, one needs to obtain an access token and pass this along in each call โ please see our authentication article for more information.
User Listing
Before anything useful can be accomplished, a list of users for the organization needs to be obtained. This can be obtained as follows:
GET https://api.devicemagic.com/api/v3/dispatch_authors.(json|xml)
*Note: The above call will return the first 100 users by default, items
and page
can be used additional parameters can be used to return more. For example
GET https://api.devicemagic.com/api/v3/dispatch_authors.json?items=200
GET https://api.devicemagic.com/api/v3/dispatch_authors.json?page=2
The identifier is what you will use in other calls for dispatch
JSON Example
{
"authors": [
{
"identifier": 123,
"type": "User",
"name": "Peter",
"email": "peter@company.com"
}
]
}
The identifier is what you will use in other calls for dispatching to this user. Note, this call will also return any devices (with a type=Device) and can be used to replace the previous API as it supports all the functionality in addition to users.
The flow for viewing, sending, updating, and deleting dispatches is the same as in the previous Dispatch API, but the endpoint changes to the following:
Dispatch List
GET https://api.devicemagic.com/api/v3/organization_dispatches.(json|xml)
Sending a Dispatch
POST https://api.devicemagic.com/api/v3/users/[identifier]/dispatches.(json|xml)
Updating a Dispatch
PATCH https://api.devicemagic.com/api/v3/users/[identifier]/dispatches/[dispatch_id].json
Deleting a Dispatch
DELETE https://api.devicemagic.com/api/v3/users/[identifier]/dispatches/[dispatch_id].json