> For the complete documentation index, see [llms.txt](https://docs.moocit.fr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.moocit.fr/english/api/completion.md).

# Completion

API endpoints for getting completion data

### Get all completion

## List all completions

<mark style="color:blue;">`GET`</mark> `https://your-platform-url.com/api/so2/v1/completion`

Get all course user completion for your instance

#### Headers

| Name                                                             | Type   | Description           |
| ---------------------------------------------------------------- | ------ | --------------------- |
| Access-Control-Request-Headers<mark style="color:red;">\*</mark> | string | authorization         |
| Authorization<mark style="color:red;">\*</mark>                  | string | Bearer \<auth\_token> |
| Content-Type<mark style="color:red;">\*</mark>                   | string | application/json      |

{% tabs %}
{% tab title="200 " %}
{% code overflow="wrap" %}

```json
{"username":"johndoe",
"email":"john@example.com",
"course_id":"course-v1:MOOCit-demo-1",
"completion":"0.80"
}, 
{"username":"JaneDoe",
"email":"jane@example.com",
"course_id":"course-v1:MOOCit-demo-2",
"completion":"0.5"
}
...
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Get completion by course

## List completion by course

<mark style="color:blue;">`GET`</mark> `https://your-platform-url.com/api/so2/v1/completion?course_id={course_id}`

Get course user completion for a given course

#### Query Parameters

| Name       | Type   | Description                              |
| ---------- | ------ | ---------------------------------------- |
| course\_id | string | the course\_id course-v1:org+num+session |

#### Headers

| Name                                                             | Type   | Description           |
| ---------------------------------------------------------------- | ------ | --------------------- |
| Access-Control-Request-Headers<mark style="color:red;">\*</mark> | string | authorization         |
| Authorization<mark style="color:red;">\*</mark>                  | string | Bearer \<auth\_token> |
| Content-Type<mark style="color:red;">\*</mark>                   | string | application/json      |

{% tabs %}
{% tab title="200 " %}
{% code overflow="wrap" %}

```json
{"username":"johndoe",
"email":"john@example.com",
"course_id":"course-v1:MOOCit-demo-1",
"completion":"0.80"
}, 
{"username":"JaneDoe",
"email":"jane@example.com",
"course_id":"course-v1:MOOCit-demo-1",
"completion":"0.45"
}
...
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Get completion by username

## List completion by username

<mark style="color:blue;">`GET`</mark> `https://your-platform-url.com/api/so2/v1/completion?username={username}`

Get course completion for a given username

#### Query Parameters

| Name     | Type   | Description |
| -------- | ------ | ----------- |
| username | string |             |

#### Headers

| Name                                                             | Type   | Description           |
| ---------------------------------------------------------------- | ------ | --------------------- |
| Access-Control-Request-Headers<mark style="color:red;">\*</mark> | string | authorization         |
| Authorization<mark style="color:red;">\*</mark>                  | string | Bearer \<auth\_token> |
| Content-Type<mark style="color:red;">\*</mark>                   | string | application/json      |

{% tabs %}
{% tab title="200 " %}
{% code overflow="wrap" %}

```json
{"username": "johndoe",
"email":"john@example.com",
"course_id":"course-v1:MOOCit-demo-1",
"completion":"0.80"
}, 
{"username": "johndoe",
"email":"john@example.com",
"course_id":"course-v1:MOOCit-demo-2",
"completion":"0.50"
}
...
```

{% endcode %}
{% endtab %}
{% endtabs %}
