# (6) Submit consent

## Submit consent

<mark style="color:green;">`POST`</mark> `https://api.domain.com/api/services/app/ConsentTrans/SubmitConsent`

#### Headers

| Name           | Type   | Description         |
| -------------- | ------ | ------------------- |
| Authentication | string | Bearer Token ของคุณ |

#### Request Body

| Name               | Type   | Description                                                                                                                                                                                                    |
| ------------------ | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| dataSubjectProfile | object | ข้อมูลรายละเอียดของผู้ให้ความยินยอม                                                                                                                                                                            |
| otpType            | string | กรณีที่ consent point require otp และระบุ otpType เป็น Userdefine ใน step (2) ต้องส่ง otpType ที่ผู้ให้ความยินยอมเลือกกลับมาด้วย                                                                               |
| mobileNo           | string | กรณี consent point require otp และต้องการส่ง otp ไปที่ mobile ต้องระบุ mobileNo มาด้วย                                                                                                                         |
| email              | string | กรณี consent point require otp และต้องการส่ง otp ไปที่ email ต้องระบุ email มาด้วย                                                                                                                             |
| identifier         | string | ข้อมูลที่ใช้ระบุตัวบุคคล                                                                                                                                                                                       |
| consentPoint       | string | เลขที่ของ consent point ได้จากเจ้าหน้าที่ที่ส่งให้ตามแต่ละ  application                                                                                                                                        |
| langCode           | string | รหัสภาษา สามารถดู ได้จากใน Link นี้                                                                                                                                                                            |
| purposeConsent     | string | <p>ชุดข้อมูลของการให้ความยินยอม โดย id คือ เลขที่วัตถุประสงค์ ได้จากการดึงวัตถุประสงค์ใน step ที่ (2) <br>consentStatus คือ ค่า true, false โดยหากให้ความยินยอมจะเป็น true และไม่ให้ความยินยอมจะเป็น false</p> |

{% tabs %}
{% tab title="200 successfully retrieved." %}

```
{
  "result": {
    isRequireOtp: boolean
    otpRefCode: string
  },
  "targetUrl": null,
  "success": true,
  "error": null,
  "unAuthorizedRequest": false,
  "__abp": true
}
```

{% endtab %}
{% endtabs %}

**ตัวอย่างข้อมูล**

```
{
  "identifier": "string",
  "email": "string",
  "mobileNo": "string",
  "otpType": 0,
  "consentPoint": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "langCode": "string",
  "purposeConsent": [
    {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "consentStatus": true
    }
  ]
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.reddot.co.th/consent-senario-get-purposes/6-submit-consent.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
