Skip to content
Docs
API 1.0.0 · 22 Nov 2026

Search the docs

    Română

    Quickstart

    Assign a course in your test company and find the enrolment it creates.

    On this page

    Get access and choose a group

    Use the test-company base address in RDC_BASE_URL and put the access token in RDC_TOKEN. Authentication shows how to obtain it. Choose a group whose members have no current assignment for the course.

    curl

    curl "$RDC_BASE_URL/elearning/v1/groups" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/elearning/v1/groups`, {
      method: 'GET',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
      },
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'GET',
        f'{os.environ["RDC_BASE_URL"]}/elearning/v1/groups',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/elearning/v1/groups');
    curl_setopt_array($curl, [
        CURLOPT_CUSTOMREQUEST => 'GET',
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER => [
            'Authorization: Bearer ' . getenv('RDC_TOKEN'),
        ],
    ]);
    $result = json_decode(curl_exec($curl), true);
    curl_close($curl);

    C#

    using System.Net.Http.Headers;
    
    var client = new HttpClient();
    var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/elearning/v1/groups");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 200

    {
      "items": [
        {
          "id": "logistics",
          "name": "Logistics",
          "userIds": [
            "radu-ionescu"
          ],
          "revision": 1
        }
      ],
      "nextCursor": null
    }

    curl

    curl "$RDC_BASE_URL/elearning/v1/courses" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/elearning/v1/courses`, {
      method: 'GET',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
      },
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'GET',
        f'{os.environ["RDC_BASE_URL"]}/elearning/v1/courses',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/elearning/v1/courses');
    curl_setopt_array($curl, [
        CURLOPT_CUSTOMREQUEST => 'GET',
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER => [
            'Authorization: Bearer ' . getenv('RDC_TOKEN'),
        ],
    ]);
    $result = json_decode(curl_exec($curl), true);
    curl_close($curl);

    C#

    using System.Net.Http.Headers;
    
    var client = new HttpClient();
    var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/elearning/v1/courses");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 200

    {
      "items": [
        {
          "id": "receiving-goods",
          "title": "Receiving goods",
          "kind": "course",
          "lessonIds": [
            "receiving-reading",
            "receiving-checklist",
            "receiving-quiz"
          ],
          "courseIds": [],
          "durationMinutes": 5,
          "validityDays": 365
        },
        {
          "id": "workplace-safety",
          "title": "Workplace safety",
          "kind": "course",
          "lessonIds": [
            "safety-reading",
            "safety-quiz"
          ],
          "courseIds": [],
          "durationMinutes": 4,
          "validityDays": 365
        },
        {
          "id": "new-hire-onboarding",
          "title": "New-hire onboarding",
          "kind": "path",
          "lessonIds": [],
          "courseIds": [
            "workplace-safety",
            "receiving-goods"
          ],
          "durationMinutes": 9
        },
        {
          "id": "receiving-review",
          "title": "Receiving review",
          "kind": "course",
          "lessonIds": [
            "delivery-note",
            "delivery-checklist",
            "delivery-quiz"
          ],
          "courseIds": [],
          "durationMinutes": 5,
          "validityDays": 365
        }
      ],
      "nextCursor": null
    }

    Send the assignment

    Use the group and course IDs you just read. Set a due date today or later, choose a fresh UUID for operationId, and send zero as the revision of the new batch. Keep the request body and UUID together until the outcome is known.

    curl

    curl -X POST "$RDC_BASE_URL/elearning/v1/assignments" \
      -H "Authorization: Bearer $RDC_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
      "operationId": "4e08713a-ec34-4a5a-92d3-81fd425640ad",
      "expectedRevision": 0,
      "groupId": "logistics",
      "courseId": "receiving-goods",
      "dueOn": "2026-12-05",
      "mandatory": true
    }'

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/elearning/v1/assignments`, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "operationId": "4e08713a-ec34-4a5a-92d3-81fd425640ad",
        "expectedRevision": 0,
        "groupId": "logistics",
        "courseId": "receiving-goods",
        "dueOn": "2026-12-05",
        "mandatory": true
      }),
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'POST',
        f'{os.environ["RDC_BASE_URL"]}/elearning/v1/assignments',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
        json={
            'operationId': '4e08713a-ec34-4a5a-92d3-81fd425640ad',
            'expectedRevision': 0,
            'groupId': 'logistics',
            'courseId': 'receiving-goods',
            'dueOn': '2026-12-05',
            'mandatory': True,
        },
    )
    result = response.json()

    PHP

    <?php
    
    $body = <<<'JSON'
    {
      "operationId": "4e08713a-ec34-4a5a-92d3-81fd425640ad",
      "expectedRevision": 0,
      "groupId": "logistics",
      "courseId": "receiving-goods",
      "dueOn": "2026-12-05",
      "mandatory": true
    }
    JSON;
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/elearning/v1/assignments');
    curl_setopt_array($curl, [
        CURLOPT_CUSTOMREQUEST => 'POST',
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER => [
            'Authorization: Bearer ' . getenv('RDC_TOKEN'),
            'Content-Type: application/json',
        ],
        CURLOPT_POSTFIELDS => $body,
    ]);
    $result = json_decode(curl_exec($curl), true);
    curl_close($curl);

    C#

    using System.Net.Http.Headers;
    
    var client = new HttpClient();
    var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/elearning/v1/assignments");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    request.Content = new StringContent("""
    {
      "operationId": "4e08713a-ec34-4a5a-92d3-81fd425640ad",
      "expectedRevision": 0,
      "groupId": "logistics",
      "courseId": "receiving-goods",
      "dueOn": "2026-12-05",
      "mandatory": true
    }
    """, System.Text.Encoding.UTF8, "application/json");
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 202

    {
      "operationId": "4e08713a-ec34-4a5a-92d3-81fd425640ad",
      "status": "accepted",
      "aggregateRevision": null
    }

    Confirm the result

    A 202 records the operation. Poll with the UUID you sent until the status is completed or rejected. After completion, list assignments using the selected course and learner IDs and store the new assignment ID. The response shown for the list is a separate historical record.

    curl

    curl "$RDC_BASE_URL/elearning/v1/operations/4e08713a-ec34-4a5a-92d3-81fd425640ad" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/elearning/v1/operations/4e08713a-ec34-4a5a-92d3-81fd425640ad`, {
      method: 'GET',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
      },
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'GET',
        f'{os.environ["RDC_BASE_URL"]}/elearning/v1/operations/4e08713a-ec34-4a5a-92d3-81fd425640ad',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/elearning/v1/operations/4e08713a-ec34-4a5a-92d3-81fd425640ad');
    curl_setopt_array($curl, [
        CURLOPT_CUSTOMREQUEST => 'GET',
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER => [
            'Authorization: Bearer ' . getenv('RDC_TOKEN'),
        ],
    ]);
    $result = json_decode(curl_exec($curl), true);
    curl_close($curl);

    C#

    using System.Net.Http.Headers;
    
    var client = new HttpClient();
    var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/elearning/v1/operations/4e08713a-ec34-4a5a-92d3-81fd425640ad");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 200

    {
      "operationId": "4e08713a-ec34-4a5a-92d3-81fd425640ad",
      "status": "completed",
      "aggregateRevision": 1
    }

    curl

    curl "$RDC_BASE_URL/elearning/v1/assignments" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/elearning/v1/assignments`, {
      method: 'GET',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
      },
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'GET',
        f'{os.environ["RDC_BASE_URL"]}/elearning/v1/assignments',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/elearning/v1/assignments');
    curl_setopt_array($curl, [
        CURLOPT_CUSTOMREQUEST => 'GET',
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER => [
            'Authorization: Bearer ' . getenv('RDC_TOKEN'),
        ],
    ]);
    $result = json_decode(curl_exec($curl), true);
    curl_close($curl);

    C#

    using System.Net.Http.Headers;
    
    var client = new HttpClient();
    var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/elearning/v1/assignments");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 200

    {
      "items": [
        {
          "id": "ASG-2025-0214",
          "userId": "radu-ionescu",
          "courseId": "receiving-goods",
          "assignedOn": "2025-11-12",
          "dueOn": "2025-11-26",
          "mandatory": true,
          "status": "expired",
          "revision": 5,
          "completedOn": "2025-11-20"
        }
      ],
      "nextCursor": null
    }

    If the write times out, send the same body with the same operation ID. If it is rejected, inspect error.code before starting a new operation.