# Education Platform

## List Courses

<mark style="color:blue;">`GET`</mark> `‎https://<domain>/<api prefix>/<version>/education-platform/available/course/`

This API endpoint will return a list of available and subscribed courses.&#x20;

#### Query Parameters

| Name   | Type   | Description                                                             |
| ------ | ------ | ----------------------------------------------------------------------- |
| page   | string | page number                                                             |
| filter | object | { 'name': \<course title>, 'category': \<category>, 'price': \<price> } |
| limit  | string |                                                                         |
| sort   | string |                                                                         |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| apikey<mark style="color:red;">\*</mark>        | string | Apikey              |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer access token |

{% tabs %}
{% tab title="200 " %}

```markup
HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {
        "courses": [
            {
                "id": <id>,
                "slug": "<slug>",
                "title": "<cource_title>",
                "thumbnail":"<image>",                                                                                     
                "short_description": "<short_description>",
                "long_description": "<long_description>",
                "detail_url": "<detail_url>",
                "authors": [
                    {
                        "name": "<author_name>"
                    }
                ],
                "duration": "<duration>",
                "progress": <progress>,
                "skills": [
                    "<skills>"
                ],
                "price": <price>,
                "course_type": "<course_type>",
                "total_reviews": "<reviews_count>"
            },

        ],
        "filterParams": {
            "category": [
                {
                    "pk": <id>,
                    "name": "<name>",
                    "slug": "<slug>"
                },
           ],
            "price": [
                {
                    "label": <label>,
                    "value": <value>
                },
            ],
            "sortOptions": [
                {
                    "label": "<label>",
                    "value": "<value>"
                },
            ]
        }
    }
}
```

{% endtab %}
{% endtabs %}

#### Sample Code

**Node**

```javascript
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://<domain>/<api prefix>/<version>/education-platform/available/course/',
  'headers': {
    'apikey': '<apikey>',
    'Authorization': 'Bearer <access token>',
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
```

**PHP**

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/education-platform/available/course/',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'apikey: <apikey>',
    'Authorization: Bearer <access token>',
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```

## List Subscribed Courses

<mark style="color:blue;">`GET`</mark> `‎https://<domain>/<api prefix>/<version>/education-platform/dashboard/my-courses/`

This API endpoint will return a list of subscribed courses.

#### Headers

| Name                                            | Type                         | Description |
| ----------------------------------------------- | ---------------------------- | ----------- |
| apikey<mark style="color:red;">\*</mark>        | string - Apikey              |             |
| Authorization<mark style="color:red;">\*</mark> | string - Bearer access-token |             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {
        "courses": [
            {
                "id": <id>,
                "slug": "<slug>",
                "title": "<cource_title>",
                "thumbnail":"<image>",                                                                                     
                "short_description": "<short_description>",
                "long_description": "<long_description>",
                "detail_url": "<detail_url>",
                "authors": [
                    {
                        "name": "<author_name>"
                    }
                ],
                "duration": "<duration>",
                "progress": <progress>,
                "skills": [
                    "<skills>"
                ],
                "price": <price>,
                "course_type": "<course_type>",
                "total_reviews": "<reviews_count>"
            },
        ]
    }
}
```

{% endtab %}
{% endtabs %}

#### Sample Code

**Node**

```javascript
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://<domain>/<api prefix>/<version>/education-platform/dashboard/my-courses/',
  'headers': {
    'apikey': '<apikey>',
    'Authorization': 'Bearer <access token>',
  },
  formData: {

  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
```

**PHP**

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/education-platform/dashboard/my-courses/',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'apikey: <apikey>',
    'Authorization: Bearer <access-token>',
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

## List Internal Courses

<mark style="color:blue;">`GET`</mark> `‎https://<domain>/<api prefix>/<version>/education-platform/dashboard/internal-courses/`

This API endpoint will return a list of internal courses

#### Headers

| Name                                            | Type                         | Description |
| ----------------------------------------------- | ---------------------------- | ----------- |
| apikey<mark style="color:red;">\*</mark>        | string - Apikey              |             |
| Authorization<mark style="color:red;">\*</mark> | string - Bearer access-token |             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {
        "courses": [
            {
                "id": <id>,
                "slug": "<slug>",
                "title": "<cource_title>",
                "thumbnail":"<image>",                                                                                     
                "short_description": "<short_description>",
                "long_description": "<long_description>",
                "detail_url": "<detail_url>",
                "authors": [
                    {
                        "name": "<author_name>"
                    }
                ],
                "duration": "<duration>",
                "progress": <progress>,
                "skills": [
                    "<skills>"
                ],
                "price": <price>,
                "course_type": "<course_type>",
                "total_reviews": "<reviews_count>"
            },
        ]
    }
}
```

{% endtab %}
{% endtabs %}

#### Sample Code

**Node**

```javascript
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://<domain>/<api prefix>/<version>/education-platform/dashboard/internal-courses/',
  'headers': {
    'apikey': '<apikey>',
    'Authorization': 'Bearer <access-token>'
  },
  formData: {}
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
```

**PHP**

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/education-platform/dashboard/internal-courses/',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'apikey: <apikey>',
    'Authorization: Bearer <access token>',
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

## Subscribe Course

<mark style="color:green;">`POST`</mark> `‎https://<domain>/<api prefix>/<version>/education-platform/subscribe/free-course/`

This API endpoint will subscribe to a free course.

#### Headers

| Name                                            | Type   | Description        |
| ----------------------------------------------- | ------ | ------------------ |
| apikey<mark style="color:red;">\*</mark>        | string | Apikey             |
| Authorization<mark style="color:red;">\*</mark> | string | Beare access token |

#### Request Body

| Name                                           | Type   | Description |
| ---------------------------------------------- | ------ | ----------- |
| course\_slug<mark style="color:red;">\*</mark> | string | Course slug |

{% tabs %}
{% tab title="200 " %}

```
HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {}
}
```

{% endtab %}
{% endtabs %}

#### Sample Code

**Node**

```javascript
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://<domain>/<api prefix>/<version>/education-platform/subscribe/free-course/',
  'headers': {
    'apikey': '<apikey>',
    'Authorization': 'Bearer <access token>',
  },
  formData: {
    'course_slug': '<course_slug>'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
```

**PHP**

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/education-platform/subscribe/free-course/',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('course_slug' => '<course_slug>'),
  CURLOPT_HTTPHEADER => array(
    'apikey: <apikey>',
    'Authorization: Bearer <access token>',
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

#### Error Responses

## Unsubscribe Course

<mark style="color:green;">`POST`</mark> `‎https://<domain>/<api prefix>/<version>/education-platform/unsubscribe/course/`

This API endpoint will unsubscribe to a course.

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| apikey<mark style="color:red;">\*</mark>        | string | Apikey              |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer access token |

#### Request Body

| Name                                           | Type   | Description |
| ---------------------------------------------- | ------ | ----------- |
| course\_slug<mark style="color:red;">\*</mark> | string | Course slug |

{% tabs %}
{% tab title="200 " %}

```
HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {}
}
```

{% endtab %}
{% endtabs %}

#### Sample Code

**Node**

```php
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://<domain>/<api prefix>/<version>/education-platform/unsubscribe/course/',
  'headers': {
    'apikey': '<apikey>',
    'Authorization': 'Bearer <access token>',
  },
  formData: {
    'course_slug': '<course_slug>'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);

```

**PHP**

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/education-platform/unsubscribe/course/',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('course_slug' => '<course_slug>'),
  CURLOPT_HTTPHEADER => array(
    'apikey: <apikey>',
    'Authorization: Bearer <access token>',
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

#### Error Responses

| Status Code | Error Type       | FIeld | Description                                                                       |
| ----------- | ---------------- | ----- | --------------------------------------------------------------------------------- |
| 400         | Validation Error | slug  | <p>This field is required and it may not be blank.</p><p>Invalid course slug.</p> |

## Course Detailed View

<mark style="color:blue;">`GET`</mark> `‎https://<domain>/<api prefix>/<version>/education-platform/course/detailed-view/`

This API endpoint will return a detailed view of the course.

#### Path Parameters

| Name                                   | Type                    | Description                                                                         |
| -------------------------------------- | ----------------------- | ----------------------------------------------------------------------------------- |
| slug<mark style="color:red;">\*</mark> | string                  | Course slug                                                                         |
| subscribed                             | boolean - True or False | If requesting for details of subscribed course, Must add subscribed params as True. |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| apikey<mark style="color:red;">\*</mark>        | string | Apikey              |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer access token |

{% tabs %}
{% tab title="200 " %}

```html
HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {
        
        if the course is not subscribed
        
        "course_slug": "<course_slug>",
        "author": "<author>",
        subscriber_count": <subscriber_count>,
        "course_content": {
            "id": <id>,
            "language": "<language>",
            "title": "<title>",
            "short_description": "<short_description>",
            "long_description": "<long_description>",
            "is_set": <is_set>
        },
        "course_type": "<course_type>",
        "prerequisite": [
            "<badg_name>"
        ],
        "total_modules": <total_modules>,
        "modules": [
            {
                "name": "<module_name>",
                "total_chapters": <total_chapters>,
                "chapters": [
                    {
                        "name": "<chapter_name>"
                        "is_preview": <is_preview>,
                        "resource_url": "<resource_url>",
                        "vimeo_id": "<vimeo_id>"
                    },
                    ....
                ]
            },
            ....
        ],
        "duration": "<duration>",
        "subcribed": <subcribed>,
        "eligible": <eligible>,
        "eligibility": {
            "ranks": [<eligible_rank_names>],
            "groups": [<eligible_groups_names>]
        },
        "currency": "<currency>",
        "first_preview": {
            "id": <id>,
            "number": <chapter_number>,
            "resource_url": "<resource_url>",
            "name": "<name>",
            "description": "<description>",
            "long_description": "<long_description>",
            "duration": "<duration>",
            "is_preview": <is_preview>,
            "slug": "<slug>",
            "module": <module_number>
        },
        
        if the course is subscribed
        "course_id": <course_id>,
        "title": "<title>",
        "duration": "<duration>",
        "subscriber_count": <subscriber_count>,
        "badge_list": [
            "<badge_list>"
        ],
        "course_slug": "<course_slug>",
        "author": "<author>",
        "progress": <progress>,
        "last_visited": {
            "id": <id>,
            "number": <chapter_number>,
            "resource_url": "<resource_url>",
            "name": "<name>",
            "description": "<description>",
            "long_description": "<long_description>",
            "duration": "<duration>",
            "is_preview": <is_preview>,
            "slug": "<slug>",
            "module": <module_number>
        },
        "modules": [
            {
                "module": <module_number>,
                "name": "<name>",
                "description": "<description>",
                "total_chapters": <total_chapters>,
                "chapters": [
                    {
                        "number": <chapter_number>,
                        "slug": "<slug>",
                        "name": "<name>",
                        "description": "<description>",
                        "long_description": "<long_description>",
                        "duration": "<duration>",
                        "is_preview": <is_preview>,
                        "resource_url": "<resource_url>",
                        "vimeo_id": "<vimeo_id>",
                        "module_number": <module_number>
                    },
                   
                ]
            },
            ...
        ],
        
        common data
        
        "review_data": [
            {
                "id": <id>,
                "object_pk": "<object_pk>",
                "comment": "<comment>",
                "rating": <rating>,
                "user__first_name": "<user__first_name>",
                "user__last_name": "<user__last_name>"
            }
        ],
        "ratings_data": {
            "rating_average": <ratings_data>,
            "rating_average_num": <rating_average_num>,
            "rating_total": <rating_total>,
            "review_total": <review_total>
        },
        "already_reviewed": <already_reviewed>,
        "already_reviewed_data": {
            "id": <id>,
            "object_pk": "<object_pk>",
            "comment": "<comment>",
            "rating": <rating>,
            "user__first_name": "<user__first_name>",
            "user__last_name": "<user__last_name>"
        }
    }
}
```

{% endtab %}
{% endtabs %}

#### Sample Code

**Node**

```javascript
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://<domain>/<api prefix>/<version>/education-platform/course/detailed-view/',
  'headers': {
    'apikey': '<apikey>',
    'Authorization': 'Bearer <access token>',
  },
  formData: {}
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

```

#### PHP

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/education-platform/course/detailed-view/',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'apikey: <apikey>',
    'Authorization: Bearer <access token>',
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

#### Error Responses

<table data-header-hidden><thead><tr><th>Status Code  </th><th width="200">Error Type</th><th>Field</th><th>Description</th></tr></thead><tbody><tr><td>Status Code  </td><td>Error Type</td><td>FIeld</td><td>Description</td></tr><tr><td>400</td><td>Validation Error</td><td>slug</td><td><p>This course is not pusblished, Permission denied.</p><p>This field is required and it may not be blank.</p><p>Invalid slug.</p></td></tr></tbody></table>

## Previous and Next Chapters

<mark style="color:blue;">`GET`</mark> `‎https://<domain>/<api prefix>/<version>/education-platform/chapter/next-previous/`

This API endpoint will return next and previous chapter details of selected chapter

#### Query Parameters

| Name                                      | Type    | Description    |
| ----------------------------------------- | ------- | -------------- |
| slug<mark style="color:red;">\*</mark>    | string  | Course slug    |
| module<mark style="color:red;">\*</mark>  | integer | Module number  |
| chapter<mark style="color:red;">\*</mark> | integer | Chapter number |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| apikey<mark style="color:red;">\*</mark>        | string | Apikey              |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer access token |

{% tabs %}
{% tab title="200: OK " %}

```html
HTTP/1.1 200 OK
Content-Type: application/json

{
    "status_code": 200,
    "errors": {},
    "data": {
        "next_chapter": {
            "id": <id>,
            "number": <chapter_number>,
            "resource_url": "<resource_url>",
            "name": "<name>",
            "description": "<description>",
            "long_description": "<long_description>",
            "duration": "<duration>",
            "is_preview": <is_preview>,
            "slug": "<slug>",
            "module": <module_number>
        },
        "previous_chapter": {
            "id": <id>,
            "number": <chapter_number>,
            "resource_url": "<resource_url>",
            "name": "<name>",
            "description": "<description>",
            "long_description": "<long_description>",
            "duration": "<duration>",
            "is_preview": <is_preview>,
            "slug": "<slug>",
            "module": <module_number>        
        }
    }
}
```

{% endtab %}
{% endtabs %}

#### Sample Code

**Node**

```javascript
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://<domain>/<api prefix>/<version>/education-platform/chapter/next-previous/',
  'headers': {
    'apikey': '<apikey>',
    'Authorization': 'Bearer <access token>',
  },
  formData: {}
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

```

**PHP**

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/education-platform/chapter/next-previous/',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'apikey: <apikey>',
    'Authorization: Bearer <access token>'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

#### Error Responses

| Status Code | Error Type       | Field | Description                                                                                                          |
| ----------- | ---------------- | ----- | -------------------------------------------------------------------------------------------------------------------- |
| 400         | Validation Error | slug  | <p>This field is required and it may not be blank.</p><p>Invalid slug.</p><p>You are not subscribed this course.</p> |
| 401         | Request Failed   |       | Module and chapter number is required.                                                                               |

## Update Course Progress

<mark style="color:green;">`POST`</mark> `‎https://<domain>/<api prefix>/<version>/education-platform/course/progress/`

This API endpoint will update course progress.

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| apikey<mark style="color:red;">\*</mark>        | string | Apikey              |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer access token |

#### Request Body

| Name                                            | Type   | Description |
| ----------------------------------------------- | ------ | ----------- |
| course\_slug<mark style="color:red;">\*</mark>  | String |             |
| chapter\_slug<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200: OK " %}

```html
HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {}
}
```

{% endtab %}
{% endtabs %}

#### Sample Code

**Node**

```javascript
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://<domain>/<api prefix>/<version>/education-platform/course/progress/',
  'headers': {
    'apikey': '<apikey>',
    'Authorization': 'Bearer <access token>',
  },
  formData: {
    'course_slug': '<course_slug>',
    'chapter_slug': '<chapter_slug>'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
}); 
```

**PHP**

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/education-platform/course/progress/',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('course_slug' => '<course_slug>','chapter_slug' => '<chapter_slug>'),
  CURLOPT_HTTPHEADER => array(
    'apikey: <apikey>',
    'Authorization: Bearer <access token>'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

#### **Error Responses**

| Status Code | Error Type       | Field         | Description                                                                       |
| ----------- | ---------------- | ------------- | --------------------------------------------------------------------------------- |
| 400         | Validation Error | course\_slug  | <p>This field is required and it may not be blank.</p><p>Invalid course slug.</p> |
| 400         | Validation Error | chapter\_slug | Invalid chapter slug.                                                             |
|             |                  |               |                                                                                   |

####

## Course Review

To add a review for subscribed course use the same endpoint for [product review](https://api.epixelsoftware.help/product-review#write-a-review), use course\_id as a bundle in params.

## Get Certificate

<mark style="color:blue;">`GET`</mark> `‎https://<domain>/<api prefix>/<version>/education-platform/get/certificate/`

This API endpoint is used to get a certificate of a completed subscribed course.

#### Query Parameters

| Name                                           | Type   | Description |
| ---------------------------------------------- | ------ | ----------- |
| course\_slug<mark style="color:red;">\*</mark> | string | Course slug |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| apikey<mark style="color:red;">\*</mark>        | string | Apikey              |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer access token |

{% tabs %}
{% tab title="200: OK HttpResponse of certificate" %}

{% endtab %}
{% endtabs %}

#### Sample Code

**Node**

```javascript
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://<domain>/<api prefix>/<version>/education-platform/get/certificate/',
  'headers': {
    'apikey': '<apikey>',
    'Authorization': 'Bearer <access token>'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
```

**PHP**

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/education-platform/get/certificate/',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'apikey: <apikey>',
    'Authorization: Bearer <access token>'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

#### Error Responses

| Status Code | Error Type       | Field        | Description                                                                                                          |
| ----------- | ---------------- | ------------ | -------------------------------------------------------------------------------------------------------------------- |
| 400         | Validation Error | course\_slug | <p>This field is required and it may not be blank.</p><p>Invalid course slug.</p><p>Course is not completed yet.</p> |
