> For the complete documentation index, see [llms.txt](https://helpdesk.ldtsoft.work/ldt-online-course/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://helpdesk.ldtsoft.work/ldt-online-course/build-your-course/how-to-use-the-apis.md).

# How to use the APIs

Generate an access token and call the course, student, file and community endpoints from your own system

Generate one access token, then read and update courses, students, files and communities from your own system over HTTP.

Every call carries the token in an `LDT-X-Access-Token` header, and the data it can touch is the shop that generated the token.

### 1. Open the API settings

In Shopify admin, open **Apps** -> **LDT Online Courses** -> **Settings** (1a), then click **APIs** (1b) in the app's Settings menu.

<figure><img src="https://3532245007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRJ3j93eHyen8t2flj5y%2Fuploads%2Fgit-blob-ee8ddd7b572d22565986dc0ea62373c1dc1d9f22%2Fhow-to-use-the-apis-step-1.png?alt=media" alt="Opening Settings in Shopify admin and then APIs in the app menu"><figcaption></figcaption></figure>

### 2. Open Authorization

The APIs tab has its own menu: **General** holds **Authorization**, and **Endpoints** holds **File management**, **Course management**, **Student** and **Community management**. Open **Authorization**.

<figure><img src="https://3532245007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRJ3j93eHyen8t2flj5y%2Fuploads%2Fgit-blob-1618eb0549555eb10d5da8a253e5bdef0edcb112%2Fhow-to-use-the-apis-step-2.png?alt=media" alt="Opening Authorization in the APIs menu"><figcaption></figcaption></figure>

### 3. Generate the access key

Click **Generate access key**. Until you do, the card reads *No access key found. Please generate one.*

<figure><img src="https://3532245007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRJ3j93eHyen8t2flj5y%2Fuploads%2Fgit-blob-2623903039cc78bf4fd7a5a97ae75a875ade4335%2Fhow-to-use-the-apis-step-3.png?alt=media" alt="Generating the API access key"><figcaption></figcaption></figure>

The key replaces the button, with a copy icon beside it and a **Re-generate** button below. **Re-generate deletes the current key and issues a new one** — every integration using the old key stops working, so update it in the same breath.

### 4. Send the token with every request

The card lists the three rules that apply to the token:

* the access key travels in the **`LDT-X-Access-Token`** request header;
* the card shows the **live rate limit** for your shop — **2 requests per second by default**; the number on your screen is the one that applies.
* keeping the token safe is your responsibility — anyone who holds it can read and write your shop data through this API.

<figure><img src="https://3532245007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRJ3j93eHyen8t2flj5y%2Fuploads%2Fgit-blob-a0d30ebaacecfaf52fd24e819f23428039e3574b%2Fhow-to-use-the-apis-step-4.png?alt=media" alt="Reading the token rules and the live requests-per-second limit"><figcaption></figcaption></figure>

### 5. Pick the endpoint group you need

Open a group under **Endpoints**. **Course management** covers the whole content tree — categories, courses, modules, lessons and lesson content. The other groups cover files (including upload), students (including enroll/revoke) and community management.

<figure><img src="https://3532245007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRJ3j93eHyen8t2flj5y%2Fuploads%2Fgit-blob-430992b4eeab5149e189125f28c4f91fbdfa1dc1%2Fhow-to-use-the-apis-step-5.png?alt=media" alt="Opening the Course management endpoints group"><figcaption></figcaption></figure>

### 6. Read the endpoint you want to call

Every group starts with the **Base URL** shown at the top (your app's domain) and the header block, then lists one row per endpoint with its method, its URL and a **View** button that opens the full reference — parameters, body and the response shape.

<figure><img src="https://3532245007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRJ3j93eHyen8t2flj5y%2Fuploads%2Fgit-blob-3ffeb5384c53eb7468be6fd40d5eb5286dfb6e5d%2Fhow-to-use-the-apis-step-6.png?alt=media" alt="Reading an endpoint URL and its method in the Course management group"><figcaption></figcaption></figure>

### Result

With the token in place you can create and update categories, courses and their content tree, students, files and communities from your own system — for example to keep a catalogue in step with another platform, or to enrol students from a system that is not Shopify.

### Troubleshooting

* **401 or 403.** The header name and the value have to match exactly: `LDT-X-Access-Token: <your key>`. Copy the key again from **Authorization** — a mistyped or re-generated key is the usual cause.
* **A call works for one shop and fails for another.** A token belongs to one shop; its data is scoped to that shop and no shop parameter is sent.
* **Calls start failing after you pressed Re-generate.** The old key was deleted with it. Put the new key into your integration.
* **Delete calls answer with an error.** Delete endpoints are temporarily unavailable; the app says so on the group page. Update endpoints still work.
* **You need more than the limit on your card.** Batch calls or mirror the data on your side — the limit is per token and is shown live in **Authorization**.
* **APIs is missing from Settings.** API access depends on your plan; generate the key on a plan that includes it, or contact support.

### Related pages

* [How to Duplicate a Course](https://helpdesk.ldtsoft.work/ldt-online-course/build-your-course/how-to-duplicate-a-course.md)
* [Bulk Importing Students to Your Courses with a CSV File](https://helpdesk.ldtsoft.work/ldt-online-course/students-and-reports/how-to-bulk-import-students-from-a-csv.md)
* [How to add custom data to your courses](https://helpdesk.ldtsoft.work/ldt-online-course/build-your-course/how-to-add-custom-data-to-your-courses.md)
