Basics & Authentication

Making your first API call

Basics

The Adaptemy API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication and verbs.

Environments

There are 2 publicly accessible environments:

  • Test: https://api-qa.adaptemy.io

  • Live: https://api.adaptemy.io

You should perform all testing on the Test environment. All data on the Liveenvironment is used to build data models about each curriculum/content/learner, so be aware that any inaccurate data on the Liveenvironment may affect the accuracy of the models.

The data on the Test environment is an out-of-date snapshot of the data from the Live environment.

Authentication Mechanism

The Adaptemy API uses API keys to authenticate requests. You can obtain your API keys from your account manager. You will receive separate API keys for each environment.

Authentication to the API is performed via Bearer Token.

-H "Authorization: Bearer 1234567890abcdef"

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

Authentication of Learner calls

Your platform can communicate with the Adaptemy API in one of two ways:

  1. Back-end: your servers request the data directly from our servers, and the learner's app only communicates with your servers.

  2. Front-end: the learner's app communicates directly with our servers.

Option 1 (back-end communication) is easier to implement, and is the preferred method in most cases. One reasons you may need Option 2 (front-end communication) is if you make very frequent calls to the API and wish to reduce latency.

To implement Option 1, you authenticate all API calls in the Learner Service with your Organisation's secret key, as described above.

To implement Option 2, you authenticate all API calls in the Learner Service with a temporary user-specific secret key. You obtain this temporary secret key via the createSession method.

Making a Test API Request

To check that your account and authentication are working correctly, make a test API request using your test API key to list the curriculumsobjects in your account.

Sample Request: List all Curriculum objects

In the request below, replace the secret key with the test secret key for your account. We recommend using Postman for simple testing of any endpoint.

curl https://api-qa.adaptemy.io/curriculums \
  -H "Authorization: Bearer 1234567890abcdef"

This code sample uses curl. You should replicate this test in your chosen server language: PHP, Java, Node, .NET etc.

Last updated