# Consent API

This endpoint to check that user has taken opt-in or not.&#x20;

**URL:**&#x200B; <https://waapi.pepipost.com/api/v2/consent/>&#x20;

**Method:** POST

### Parameters:

| Parameter     | Description                                                | Data Type | Required |
| ------------- | ---------------------------------------------------------- | --------- | -------- |
| phone\_number | Provide the phone number which you have used while opt-in. | String    | Yes      |

### Request Body

```
{ 
    "phone_number":"919999999999", 
} 
```

### Responses

&#x20;**In case of Success :**

```
{ 
    "status": "success", 
    "data": { 
        "ip": "192.168.7.26", 
        "phone_number": "919999999999", 
        "optin_source": "6465466", 
        "user_agent": "Mozilla", 
        "created_date": "2019-04-22 15:36:01.0" 
    } 
} 
```

Status is success means optin added successfully.

**In case of failure:**

```
{ 
    "status": "failure", 
    "error": { 
        "message": "Optin details not found for 919999999999" 
    } 
} 
```

According to error, code and message will change.
