Authentication

Authentication requirements for Skedulo API users.

Skedulo or Skedulo for Salesforce users require an API key to access the Skedulo Lens API and follow the majority of the procedures included in this developer documentation. The API key can be either long-lived or time-limited, and is used to authenticate users to the API.

Skedulo API token users

Skedulo users with administrator permissions can obtain an access token through the Developer Tools section of the Skedulo web application.

Skedulo for Salesforce API token users

Salesforce users must have the following Salesforce permissions in addition to having Skedulo administrator permissions:

  • The user must have permission to perform any necessary action in Salesforce on behalf of normal users.
  • The user must have the Skedulo Scheduler permission set assigned.
  • The user must have the value Administrator in the field skeduloUserType of its user record.

Creating a long-lived API token for Skedulo Lens API

  1. Log in to the Skedulo web application as an admin user.
  2. Click your user profile in the upper-right corner, then click Settings -> Developer Tools -> API Tokens.
  3. Click the Create button and select Expires: Never to create a long-lived API token.
  4. Copy the API token and save it in a secure place.

For more information about obtaining an API access token, see Admin Setting: Developer Tools.

Using the access token

The access token obtained above is a Base64 encoded JavaScript Web Token (JWT). Place it into the Authorization header using the Bearer method when making REST API requests.

For example:

curl -X GET https://api.skedulo.com/auth/whoami -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Ik9ESkNORFE0TkRJMVJUTkJNekE1TlRFNVJqVTFORGxDUXpjME9EZEJOVEF3T1RjNE1rVkZSUSJ9.eyJodHRwczovL2FwaS5za2VkdWxvLmNvbS92ZW5kb...-dpYZm_8YuaUYTnMrS4Fs3fQTDxM0oEkt9CWWJxPQTOv3l3pjp3sgDeuRvzYcaFZuoVTVLPYNidL9Pc5gPMrsXpTxOJL3nMF-2GmJJ5YHAXgG2cQc9MmL74u7IsGbQ-qg"

This will return a result like the following:

{  
  "result":{  
    "username":"apiuser@skedulo.com",
    "userId":"auth0|97056322c44eb888e6a351fa",
    "tenantId":"sk_6b03bcfe283f2b49df9cc30a40cf42ac",
    "roles":[  
      "administrator"
    ],
    "resourceId":null,
    "vendorInfo":{  
      "vendor":"skedulo"
    }
  }
}

Example using Postman

Auth settings using Postman

Example using Paw

Auth settings using Paw

Example using Insomnia

Auth settings using Insomnia

Setting the API key as an environment variable

This documentation uses $AUTH_TOKEN to represent a long-lived API token as an environment variable. You can create an environment variable for your own environment to avoid having to look up your key for every request.

Set your API key as the AUTH_TOKEN variable by adding the following to your local configuration file:

export AUTH_TOKEN="123456789YOURAPIKEYGOESHERE"

Skedulo Lens API requests

Requests to the Skedulo Lens API REST and GraphQL endpoints must be made using HTTPS protocol for additional security and encryption.

You can use any HTTP-enabled API client to call the Skedulo API using a standard HTTP method (GET, POST, PUT, DELETE) to call a valid Skedulo REST endpoint.

REST API endpoints expect requests to be made in JSON format. See the Skedulo API Reference Documentation for a full list of supported Skedulo REST API endpoints.

The Skedulo GraphQL API endpoints only support POST requests and expect requests in GraphQL format. GraphQL queries allow you to request specific information from the API using a single request.

The Skedulo web application includes the GraphiQL connected page for creating and testing GraphQL queries and exploring the schema. You can enable this connected page using the Developer Tools. To explore the standard Skedulo GraphQL Schema, see the GraphQL Schema Documentation.