Skedulo Lens API (1.0.0)

Overview

The Skedulo Lens API reference documentation is designed to assist developers integrate Skedulo platform functionality into their applications. The Skedulo API provides full data access to standard and custom objects via GraphQL, including the ability to create and schedule jobs, manage allocation to resources and customers, and handle contact information.

Skedulo Lens API also provides the capabilities to:

  • Dispatch jobs to resources and manage notifications, via SMS or push.
  • Call the optimization engine to schedule jobs efficiently to multiple resources.
  • Access tracking and summary information about job travel and service times.
  • Access current and historical information about resource locations.
  • Get information about resource availability.

Authentication

Authorization

Skedulo APIs can be accessed by an access token. This is either a perpetual or time-limited token which can be presented as proof of authentication. Access tokens can be obtained via the admin settings of the Skedulo web app.

Create long-lived access tokens via Admin Setting: Developer Tools.

Security scheme type: API Key
Header parameter name: Authorization

BearerAuth

The access token obtained above is a Base64 encoded JavaScript Web Token (JWT). You use this by placing it into the Authorization header of the REST API request using the Bearer method.

For example:

curl -X GET https://api.skedulo.com/auth/whoami -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Ik9ESkNORFE0TkRJMVJUTkJNekE1TlRFNVJqVTFORGxDUXpjME9EZEJOVEF3T1RjNE1rVkZSUSJ9.eyJodHRwczovL2FwaS5za2VkdWxvLmNvbS92ZW5kb...-dpYZm_8YuaUYTnMrS4Fs3fQTDxM0oEkt9CWWJxPQTOv3l3pjp3sgDeuRvzYcaFZuoVTVLPYNidL9Pc5gPMrsXpTxOJL3nMF-2GmJJ5YHAXgG2cQc9MmL74u7IsGbQ-qg"
Security scheme type: HTTP
HTTP Authorization Scheme bearer

Authentication API

Use the Authentication API to manage API permissions for your users, obtain delegation tokens, user metadata, and authentication configuration.

Whoami

get /auth/whoami
https://api.skedulo.com/auth/whoami

Return the current users authentication information.

Authorizations:
query Parameters
access_token
string

Access token. This is an alternative to passing the Authorization: Bearer header.

Responses

200

The current users authentication information was returned.

Response Schema: application/json
result
object (UserInfoClaims)

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    {
    }
}

Set a user as the API User for this tenant

post /auth/api_user
https://api.skedulo.com/auth/api_user

The user assigning the API user must be an administrator.

Note

If you make any modifications to the user assigned as the API User, you must set the user as the API User again to ensure that the data stored for the user is up to date. Otherwise, some claims in the access token will be outdated.

Authorizations:
Request Body schema: application/json
userId
required
string

Skedulo User ID of the user to be setup as the API User.

Responses

200

The user was successfully setup as the API User.

Response Schema: */*
result
required
object
403

The user is not an administrator.

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "userId": "string"
}

Remove the API User for this tenant

delete /auth/api_user
https://api.skedulo.com/auth/api_user

Removes the API User for this tenant if they have one. If the tenant is on Standalone this will reset their API user to the system user. The caller must be an administrator.

Authorizations:

Responses

200

Successfully removed the API User for this tenant.

403

The user is not an administrator.

Get client credentials information for the API user

get /auth/api_user/client_credentials
https://api.skedulo.com/auth/api_user/client_credentials

The user requesting this information must be an administrator for their organization.

Authorizations:

Responses

200

Client credentials information of the API user.

Response Schema: */*
result
required
object
403

User is not an administrator.

404

API user is not set up.

List API user candidates

get /auth/api_user/candidates
https://api.skedulo.com/auth/api_user/candidates

List candidates that can be set as the API user and the current API user. Only users with role Administrators or Schedulers are returned.

Authorizations:

Responses

200

List of candidates that can be assigned as the API User

Response Schema: application/json
result
required
object

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    {
    }
}

Check if the API user is verified

get /auth/api_user/verify
https://api.skedulo.com/auth/api_user/verify
Authorizations:

Responses

200

If the result contains success equal to true then the API user is verified, otherwise it is not.

Response Schema: application/json
result
required
object

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    {
    }
}

Current user metadata

get /auth/metadata/user
https://api.skedulo.com/auth/metadata/user

Fetch metadata about the current user.

Authorizations:

Responses

200

The current user's metadata.

Response Schema: application/json
created
object (UserMetadata)
412

The user belongs to a tenant that is not associated with a team.

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "created":
    {
    }
}

List all API tokens

get /auth/tokens
https://api.skedulo.com/auth/tokens

List all available and revoked API tokens.

Authorizations:

Responses

200

Return information about all of the available and revoked API tokens.

Response Schema: application/json
result
Array of objects (ApiTokenInfo)

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ]
}

Get API token using JTI

get /auth/token/{jti}
https://api.skedulo.com/auth/token/{jti}

Get an API token by specifying its JTI.

Authorizations:
path Parameters
jti
required
string

The JWT Identifier for the API token.

Responses

200

Return information about the requested API token.

Response Schema: application/json
result
object (ApiTokenInfo)

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    {
    }
}

Create API token

post /auth/token
https://api.skedulo.com/auth/token

Create an API token with an optional expiry. This token can be used to authenticate as the same user that created it (with the same claims) for as long as the token is valid. Tokens may be revoked.

Authorizations:
Request Body schema: application/json
expiry
string <date-time>

Optional expiry. If omitted the token is valid forever.

Responses

200

Return the API token

Response Schema: application/json
result
required
object

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "expiry": "2019-08-22T01:16:42Z"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    {
    }
}

Revoke API token

post /auth/token/revoke
https://api.skedulo.com/auth/token/revoke

Revoke an API Token so it can no longer be used. The token will be returned but marked as revoked. It cannot be used to authenticate once revoked.

Authorizations:
Request Body schema: application/json
jti
string

JWT Identfier of token to revoke

Responses

200

The token was revoked

Response Schema: application/json
result
required
object

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "jti": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result": { }
}

Notifications

The Notifications API dispatches jobs to resources and sends notifications via SMS or push. Notifications can also be sent to any phone number using the /notfications/sms endpoint.

Dispatch resources

post /notifications/dispatch
https://api.skedulo.com/notifications/dispatch

This endpoint will dispatch the resources for the job and notify them.

Authorizations:
Request Body schema: application/json
jobId
required
string
resourceId
string

Responses

200

Result

Response Schema: application/json
result
object
default

Error

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "jobId": "string",
  • "resourceId": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    {
    }
}

Notify resources

post /notifications/notify
https://api.skedulo.com/notifications/notify

This endpoint ONLY notifies, it does not dispatch.

Authorizations:
Request Body schema: application/json
jobId
required
string
resourceId
string

Responses

200

Result

Response Schema: application/json
result
object
default

Error

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "jobId": "string",
  • "resourceId": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{