Salt la conținut
Documentație

Caută în documentație

    English

    Cursuri

    Caută cursuri și trasee de învățare sau importă un pachet de lecturi, liste de verificare și teste.

    Pe această pagină

    Listează cursurile și traseele

    GET /elearning/v1/courses

    Parametri

    NumeÎnTipObligatoriuDescriere
    limit query integer Nuopțional Implicit 100 Interval 1 – 500
    cursor query string Nuopțional

    Răspunsuri

    StareDescriereCorp
    200 Înregistrările curente. object
    400 Cerere refuzată. Coduri: invalid_request. Error
    401 Cerere refuzată. Coduri: unauthorized. Error
    403 Cerere refuzată. Coduri: forbidden. Error
    429 Cerere refuzată. Coduri: rate_limited. Error
    503 Cerere refuzată. Coduri: unavailable. Error

    Cerere

    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();

    Răspuns 200

    JSON

    {
      "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
    }

    Importă un pachet de curs

    POST /elearning/v1/course-packages

    Corpul cererii

    CâmpTipObligatoriuDescriere
    operationId string (uuid) Daobligatoriu UUID ales pentru modificare.
    expectedRevision integer Daobligatoriu Revizia citită sau zero pentru o înregistrare ori un lot nou.
    id string Daobligatoriu Identificatorul cursului sau al traseului.
    title string Daobligatoriu Titlul cursului.
    validityDays integer Nuopțional Valabilitatea certificatului, în zile calendaristice. Omite câmpul pentru un curs fără certificat.
    lessons PackageLesson[] Daobligatoriu Lecțiile în ordinea parcurgerii: lecturi, liste de verificare și cel mult un test, care vine ultimul.
    lessons[].id string Daobligatoriu Cheia unică a lecției în curs.
    lessons[].kind string Daobligatoriu Lectură, listă de verificare sau test. Una dintre reading, checklist, quiz
    lessons[].title string Daobligatoriu Titlul lecției.
    lessons[].minutes integer Daobligatoriu Minutele necesare lecției. Durata cursului este suma lor.
    lessons[].body string Nuopțional Textul simplu al unei lecturi; un rând liber începe un paragraf nou.
    lessons[].items string[] Nuopțional Punctele listei de verificare, în ordine.
    lessons[].maxAttempts integer Nuopțional Câte încercări are cursantul la un test.
    lessons[].passingAnswers integer Nuopțional Numărul de răspunsuri corecte necesare pentru a promova.
    lessons[].questions PackageQuestion[] Nuopțional Întrebările unui test, în ordine.
    lessons[].questions[].prompt string Daobligatoriu Întrebarea.
    lessons[].questions[].choices string[] Daobligatoriu Variantele de răspuns.
    lessons[].questions[].correct integer Daobligatoriu Indicele răspunsului corect, de la zero.

    Răspunsuri

    StareDescriereCorp
    202 Operația a fost înregistrată. OperationResult
    400 Cerere refuzată. Coduri: invalid_request. Error
    401 Cerere refuzată. Coduri: unauthorized. Error
    403 Cerere refuzată. Coduri: forbidden. Error
    409 Cerere refuzată. Coduri: operation_reused, revision_conflict. Error
    429 Cerere refuzată. Coduri: rate_limited. Error
    503 Cerere refuzată. Coduri: unavailable. Error

    Cerere

    curl

    curl -X POST "$RDC_BASE_URL/elearning/v1/course-packages" \
      -H "Authorization: Bearer $RDC_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
      "operationId": "4e08713a-ec34-4a5a-92d3-81fd42564001",
      "expectedRevision": 0,
      "id": "receiving-review",
      "title": "Receiving review",
      "validityDays": 365,
      "lessons": [
        {
          "id": "delivery-note",
          "kind": "reading",
          "minutes": 2,
          "title": "Check the note",
          "body": "Match the delivery note against the purchase order before accepting the delivery.\n\nKeep damaged goods in the receiving area and tell purchasing the same day."
        },
        {
          "id": "delivery-checklist",
          "kind": "checklist",
          "minutes": 1,
          "title": "Before you accept",
          "items": [
            "Match the note and the order.",
            "Count and inspect the cases.",
            "Record the discrepancy before put-away."
          ]
        },
        {
          "id": "delivery-quiz",
          "kind": "quiz",
          "minutes": 2,
          "title": "Delivery quiz",
          "maxAttempts": 3,
          "passingAnswers": 2,
          "questions": [
            {
              "prompt": "What do you match against the purchase order?",
              "choices": [
                "Delivery note",
                "Shelf label"
              ],
              "correct": 0
            },
            {
              "prompt": "Where do damaged cases stay?",
              "choices": [
                "On the picking shelf",
                "In the receiving area"
              ],
              "correct": 1
            },
            {
              "prompt": "When do you put away the accepted quantity?",
              "choices": [
                "After recording it",
                "Before counting it"
              ],
              "correct": 0
            }
          ]
        }
      ]
    }'

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/elearning/v1/course-packages`, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "operationId": "4e08713a-ec34-4a5a-92d3-81fd42564001",
        "expectedRevision": 0,
        "id": "receiving-review",
        "title": "Receiving review",
        "validityDays": 365,
        "lessons": [
          {
            "id": "delivery-note",
            "kind": "reading",
            "minutes": 2,
            "title": "Check the note",
            "body": "Match the delivery note against the purchase order before accepting the delivery.\n\nKeep damaged goods in the receiving area and tell purchasing the same day."
          },
          {
            "id": "delivery-checklist",
            "kind": "checklist",
            "minutes": 1,
            "title": "Before you accept",
            "items": [
              "Match the note and the order.",
              "Count and inspect the cases.",
              "Record the discrepancy before put-away."
            ]
          },
          {
            "id": "delivery-quiz",
            "kind": "quiz",
            "minutes": 2,
            "title": "Delivery quiz",
            "maxAttempts": 3,
            "passingAnswers": 2,
            "questions": [
              {
                "prompt": "What do you match against the purchase order?",
                "choices": [
                  "Delivery note",
                  "Shelf label"
                ],
                "correct": 0
              },
              {
                "prompt": "Where do damaged cases stay?",
                "choices": [
                  "On the picking shelf",
                  "In the receiving area"
                ],
                "correct": 1
              },
              {
                "prompt": "When do you put away the accepted quantity?",
                "choices": [
                  "After recording it",
                  "Before counting it"
                ],
                "correct": 0
              }
            ]
          }
        ]
      }),
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'POST',
        f'{os.environ["RDC_BASE_URL"]}/elearning/v1/course-packages',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
        json={
            'operationId': '4e08713a-ec34-4a5a-92d3-81fd42564001',
            'expectedRevision': 0,
            'id': 'receiving-review',
            'title': 'Receiving review',
            'validityDays': 365,
            'lessons': [
                {
                    'id': 'delivery-note',
                    'kind': 'reading',
                    'minutes': 2,
                    'title': 'Check the note',
                    'body': 'Match the delivery note against the purchase order before accepting the delivery.
    
    Keep damaged goods in the receiving area and tell purchasing the same day.',
                },
                {
                    'id': 'delivery-checklist',
                    'kind': 'checklist',
                    'minutes': 1,
                    'title': 'Before you accept',
                    'items': [
                        'Match the note and the order.',
                        'Count and inspect the cases.',
                        'Record the discrepancy before put-away.',
                    ],
                },
                {
                    'id': 'delivery-quiz',
                    'kind': 'quiz',
                    'minutes': 2,
                    'title': 'Delivery quiz',
                    'maxAttempts': 3,
                    'passingAnswers': 2,
                    'questions': [
                        {
                            'prompt': 'What do you match against the purchase order?',
                            'choices': [
                                'Delivery note',
                                'Shelf label',
                            ],
                            'correct': 0,
                        },
                        {
                            'prompt': 'Where do damaged cases stay?',
                            'choices': [
                                'On the picking shelf',
                                'In the receiving area',
                            ],
                            'correct': 1,
                        },
                        {
                            'prompt': 'When do you put away the accepted quantity?',
                            'choices': [
                                'After recording it',
                                'Before counting it',
                            ],
                            'correct': 0,
                        },
                    ],
                },
            ],
        },
    )
    result = response.json()

    PHP

    <?php
    
    $body = <<<'JSON'
    {
      "operationId": "4e08713a-ec34-4a5a-92d3-81fd42564001",
      "expectedRevision": 0,
      "id": "receiving-review",
      "title": "Receiving review",
      "validityDays": 365,
      "lessons": [
        {
          "id": "delivery-note",
          "kind": "reading",
          "minutes": 2,
          "title": "Check the note",
          "body": "Match the delivery note against the purchase order before accepting the delivery.\n\nKeep damaged goods in the receiving area and tell purchasing the same day."
        },
        {
          "id": "delivery-checklist",
          "kind": "checklist",
          "minutes": 1,
          "title": "Before you accept",
          "items": [
            "Match the note and the order.",
            "Count and inspect the cases.",
            "Record the discrepancy before put-away."
          ]
        },
        {
          "id": "delivery-quiz",
          "kind": "quiz",
          "minutes": 2,
          "title": "Delivery quiz",
          "maxAttempts": 3,
          "passingAnswers": 2,
          "questions": [
            {
              "prompt": "What do you match against the purchase order?",
              "choices": [
                "Delivery note",
                "Shelf label"
              ],
              "correct": 0
            },
            {
              "prompt": "Where do damaged cases stay?",
              "choices": [
                "On the picking shelf",
                "In the receiving area"
              ],
              "correct": 1
            },
            {
              "prompt": "When do you put away the accepted quantity?",
              "choices": [
                "After recording it",
                "Before counting it"
              ],
              "correct": 0
            }
          ]
        }
      ]
    }
    JSON;
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/elearning/v1/course-packages');
    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/course-packages");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    request.Content = new StringContent("""
    {
      "operationId": "4e08713a-ec34-4a5a-92d3-81fd42564001",
      "expectedRevision": 0,
      "id": "receiving-review",
      "title": "Receiving review",
      "validityDays": 365,
      "lessons": [
        {
          "id": "delivery-note",
          "kind": "reading",
          "minutes": 2,
          "title": "Check the note",
          "body": "Match the delivery note against the purchase order before accepting the delivery.\n\nKeep damaged goods in the receiving area and tell purchasing the same day."
        },
        {
          "id": "delivery-checklist",
          "kind": "checklist",
          "minutes": 1,
          "title": "Before you accept",
          "items": [
            "Match the note and the order.",
            "Count and inspect the cases.",
            "Record the discrepancy before put-away."
          ]
        },
        {
          "id": "delivery-quiz",
          "kind": "quiz",
          "minutes": 2,
          "title": "Delivery quiz",
          "maxAttempts": 3,
          "passingAnswers": 2,
          "questions": [
            {
              "prompt": "What do you match against the purchase order?",
              "choices": [
                "Delivery note",
                "Shelf label"
              ],
              "correct": 0
            },
            {
              "prompt": "Where do damaged cases stay?",
              "choices": [
                "On the picking shelf",
                "In the receiving area"
              ],
              "correct": 1
            },
            {
              "prompt": "When do you put away the accepted quantity?",
              "choices": [
                "After recording it",
                "Before counting it"
              ],
              "correct": 0
            }
          ]
        }
      ]
    }
    """, System.Text.Encoding.UTF8, "application/json");
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Răspuns 202

    JSON

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