Skip to main content

API

The API service lets you read and manipulate Dime.Scheduler data over a RESTful interface. You can fetch, create, update, and delete data in a predictable, uniform way.

tip

The OpenAPI specification is available on api.dimescheduler.com/docs.

Environments​

Authentication​

Two authentication methods are supported:

  • API keyAPI keyA credential that authenticates calls to the Dime.Scheduler API. The preferred way to integrate over the deprecated JWT flow. (preferred)
  • JWT (deprecated)

JWT​

Deprecated

JWT authentication is deprecated. Please use API key authentication instead, which is the preferred method.

To get a JSON Web Token, call POST /tokens on the API service (https://sandbox.api.dimescheduler.com/tokens or https://api.dimescheduler.com/tokens). The older /token route is still served and behaves the same. See the REST API reference.

In the body, pass a JSON object with this shape:

{
"username": "myuser",
"password": "mypassword"
}

Set the Content-Type header to application/json. Here's an example cURL request:

curl --location 'https://sandbox.api.dimescheduler.com/tokens'
--header 'Content-Type: application/json'
--data-raw '{
"username": "[email protected]",
"password": "mypassword"
}

Run the request and take the access_token property from the response. The token is valid for 14 days; expires tells you when. Wrong credentials are answered with USR001, and an account that belongs to more than one tenant cannot be used here (USR003). Pass this value in the Authorization header of every subsequent request to the authenticated endpoints, prefixed with Bearer. The header should be formatted as Bearer YOURTOKENHERE. Here's an example cURL request to the import APIImport endpointThe /import API endpoint that accepts a batch of stored procedure calls, each named like mboc_upsertJob with its parameter names and values. It is the batch way to push jobs, tasks, resources and appointments in.:

curl --location 'https://sandbox.api.dimescheduler.com/import'
--header 'content-type: application/json'
--header 'Authorization: Bearer thetokencomeshere'
--data '[
{
"StoredProcedureName": "mboc_upsertJob",
"ParameterNames": ["SourceApp","SourceType","JobNo","ShortDescription","Description","SiteAddress","SiteCountry"],
"ParameterValues": ["BC1","SERVICE","SVC001","Service 1","Service 1","Street 1","USA"]
}
]'

API key​

Preferred Method

API key authentication is the preferred method for authenticating with the API.

Create an API key in Dime.Scheduler and pass its value in the X-API-KEY header of every request to the API.

Here's an example cURL request to the import API using an API key:

curl --location 'https://sandbox.api.dimescheduler.com/import'
--header 'content-type: application/json'
--header 'X-API-KEY: MYAPIKEYCOMESHERE'
--data '[
{
"StoredProcedureName": "mboc_upsertJob",
"ParameterNames": ["SourceApp","SourceType","JobNo","ShortDescription","Description","SiteAddress","SiteCountry"],
"ParameterValues": ["BC1","SERVICE","SVC001","Service 1","Service 1","Street 1","USA"]
}
]'

Endpoints​

For details on each group of endpoints, open one of the cards below:

Setup packages​

Entity data goes through /import. Configuration goes through POST /import/setup, which applies a setup packageSetup packageA portable JSON5 file describing a tenant’s configuration: profiles, layouts, users and settings. Also called a configuration package; it is composed, exported and applied from the Configuration packages page.: profiles, layouts, the links between them, users and configuration values, in the package format described under setup packages. It is the API behind the Configuration packages page, and the way to roll the same configuration out to several tenants from a script.

The payload needs at least one profile and an owner, the e-mail address of the user the imported records belong to; both are checked up front and a missing one is rejected with REQ002. The call does not apply the package itself. It queues it and answers 202 Accepted right away; the package is applied in the background and the owner (or notificationEmail, when set) receives an e-mail when it is done. Applying is idempotent: profiles and layouts are matched on their code and updated when they already exist, so the same package can be sent again safely. See the REST API reference.

Data model​