---
title: "Alocări | Documentație | eLearning by R&D Copilot"
description: "Alocă formare unui grup, consultă alocările și trimite reamintiri."
canonical: "https://elearning.rdcopilot.com/ro/docs/api-reference/assignments/"
language: ro
updated: 2026-11-22
---

# Alocări

Alocă formare unui grup, consultă alocările și trimite reamintiri.

## Listează alocările

GET `/elearning/v1/assignments`

### Parametri

| Nume | În | Tip | Obligatoriu | Descriere |
| --- | --- | --- | --- | --- |
| `userId` | query | `string` | Nuopțional |  |
| `courseId` | query | `string` | Nuopțional |  |
| `limit` | query | `integer` | Nuopțional | Implicit `100` Interval `1` – `500` |
| `cursor` | query | `string` | Nuopțional |  |

### Răspunsuri

| Stare | Descriere | Corp |
| --- | --- | --- |
| `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

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

JavaScript

```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

```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
<?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#

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

### Răspuns `200`

JSON

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

## Alocă un curs unui grup

POST `/elearning/v1/assignments`

### Corpul cererii

| Câmp | Tip | Obligatoriu | Descriere |
| --- | --- | --- | --- |
| `operationId` | `string (uuid)` | Daobligatoriu | UUID ales pentru modificare. |
| `expectedRevision` | `integer` | Daobligatoriu | Revizia citită sau zero pentru o înregistrare ori un lot nou. |
| `groupId` | `string` | Daobligatoriu | Identificatorul grupului. |
| `courseId` | `string` | Daobligatoriu | Identificatorul cursului sau al traseului. |
| `dueOn` | `string (date)` | Daobligatoriu | Ultima zi pentru absolvirea la termen. |
| `mandatory` | `boolean` | Daobligatoriu | Arată dacă alocarea este obligatorie. |

### Răspunsuri

| Stare | Descriere | Corp |
| --- | --- | --- |
| `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` |
| `404` | Cerere refuzată. Coduri: group\_not\_found, course\_not\_found. | `Error` |
| `409` | Cerere refuzată. Coduri: operation\_reused, revision\_conflict. | `Error` |
| `422` | Cerere refuzată. Coduri: already\_assigned, assignment\_id\_conflict, invalid\_due\_date. | `Error` |
| `429` | Cerere refuzată. Coduri: rate\_limited. | `Error` |
| `503` | Cerere refuzată. Coduri: unavailable. | `Error` |

### Cerere

curl

```bash
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

```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

```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
<?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#

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

### Răspuns `202`

JSON

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

## Trimite o reamintire

POST `/elearning/v1/assignments/{assignmentId}/reminders`

### Parametri

| Nume | În | Tip | Obligatoriu | Descriere |
| --- | --- | --- | --- | --- |
| `assignmentId` | path | `string` | Daobligatoriu |  |

### Corpul cererii

| Câmp | Tip | Obligatoriu | Descriere |
| --- | --- | --- | --- |
| `operationId` | `string (uuid)` | Daobligatoriu | UUID ales pentru modificare. |
| `expectedRevision` | `integer` | Daobligatoriu | Revizia citită sau zero pentru o înregistrare ori un lot nou. |

### Răspunsuri

| Stare | Descriere | Corp |
| --- | --- | --- |
| `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` |
| `404` | Cerere refuzată. Coduri: assignment\_not\_found. | `Error` |
| `409` | Cerere refuzată. Coduri: operation\_reused, revision\_conflict. | `Error` |
| `422` | Cerere refuzată. Coduri: already\_completed, reminder\_already\_recorded. | `Error` |
| `429` | Cerere refuzată. Coduri: rate\_limited. | `Error` |
| `503` | Cerere refuzată. Coduri: unavailable. | `Error` |

### Cerere

curl

```bash
curl -X POST "$RDC_BASE_URL/elearning/v1/assignments/ASG-2026-0312/reminders" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "4e08713a-ec34-4a5a-92d3-81fd42564007",
  "expectedRevision": 1
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/elearning/v1/assignments/ASG-2026-0312/reminders`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "4e08713a-ec34-4a5a-92d3-81fd42564007",
    "expectedRevision": 1
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/elearning/v1/assignments/ASG-2026-0312/reminders',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': '4e08713a-ec34-4a5a-92d3-81fd42564007',
        'expectedRevision': 1,
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "4e08713a-ec34-4a5a-92d3-81fd42564007",
  "expectedRevision": 1
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/elearning/v1/assignments/ASG-2026-0312/reminders');
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#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/elearning/v1/assignments/ASG-2026-0312/reminders");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "4e08713a-ec34-4a5a-92d3-81fd42564007",
  "expectedRevision": 1
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Răspuns `202`

JSON

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