API Integration Guides

Step-by-step guides for common aXcelerate API workflows.

1. Authentication

Learn how to authenticate with the aXcelerate API using API and WS tokens.

Steps:

  1. 1 Obtain your API token and WS token from your aXcelerate instance
  2. 2 Configure tokens in your .env file: AXCELERATE_API_TOKEN and AXCELERATE_WS_TOKEN
  3. 3 Include both tokens in the request headers: "apitoken" and "wstoken"
  4. 4 The tokens authenticate and authorize your requests to the API

API Endpoints Used:

All API endpoints require authentication tokens in the headers

2. Display Courses

Search and display available courses from aXcelerate.

Steps:

  1. 1 Call GET /courses to retrieve all courses
  2. 2 Optionally filter by course ID using the "id" parameter
  3. 3 Display course information including name, code, and type
  4. 4 Use GET /course/detail?id={courseId} for detailed information

API Endpoints Used:

GET /courses - Search for courses
GET /course/detail - Get detailed course information

3. View Course Instances

Display available instances (scheduled classes) for a course.

Steps:

  1. 1 Call GET /course/instances?id={courseId} to get instances
  2. 2 Display instance details like start date, end date, location
  3. 3 Show pricing information for each instance
  4. 4 Use POST /course/instance/search for advanced filtering

API Endpoints Used:

GET /course/instances - Get instances for a course
GET /course/instance/detail - Get detailed instance information
POST /course/instance/search - Advanced instance search

4. Create Enrolment

Enrol a student into a course instance.

Steps:

  1. 1 Search for existing contact using GET /contacts/search?q={query}
  2. 2 Or create new contact using POST /contact with student details
  3. 3 Call POST /course/enrol with instanceID and contactID
  4. 4 Optionally specify payerID if different from student
  5. 5 System will create the enrolment and send confirmation emails

API Endpoints Used:

GET /contacts/search - Search for existing contacts
POST /contact - Create a new contact
POST /course/enrol - Create an enrolment

5. Handle Discounts

Calculate and apply discounts to enrolments.

Steps:

  1. 1 Call GET /course/discounts with course and contact details
  2. 2 System returns applicable discounts and revised price
  3. 3 Include discount IDs when creating the enrolment
  4. 4 Discounts are automatically applied to the invoice

API Endpoints Used:

GET /course/discounts - Calculate applicable discounts

Implementation Note

This application implements all of these workflows. Navigate through the application to see each guide in action, with full API transparency showing the exact endpoints, parameters, and responses being used.