Issue a Coupon
API Documentation for this endpoint
Endpoint Path
POST <BASE_URL>/smart-engage/post/engage-v3/<session_id>
Request Parameters
Type | Name | Required | Example Value |
---|---|---|---|
URL Path | session_id | Yes | 8960569d-db50-4742-8668-1da5c8ddf652 |
Response Status
Status Code | Meaning |
---|---|
200 | Success |
400 | Bad Request |
401 | Unauthorized |
Response Body
- Success
- Bad Request
- Unauthorized
{
"message": "success"
}
{
"error_msg": "Invalid session_id 8960569d-db50-4742-8668-1da5c8ddf652"
}
{
"error_msg": "API-KEY is invalid"
}
Code Example to Request the Endpoint
- cURL
- Python
- PHP
curl -X POST "<BASE_URL>/smart-engage/post/engage-v3/<session_id>" \
-H "Content-Type: application/json" \
-H "API-KEY: <YOUR_API_KEY>"
import requests
url = "<BASE_URL>/smart-engage/post/engage-v3/<session_id>"
headers = {
"Content-Type": "application/json",
"API-KEY": "<YOUR_API_KEY>"
}
response = requests.post(url, json={}, headers=headers)
print(response.json())
<?php
$baseUrl = "<BASE_URL>";
$sessionId = "<session_id>";
$apiKey = "<YOUR_API_KEY>";
$url = "$baseUrl/smart-engage/post/engage-v3/$sessionId";
$headers = array(
"Content-Type: application/json",
"API-KEY: $apiKey"
);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([])); // sending empty JSON body
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Request Error: ' . curl_error($ch);
} else {
$responseData = json_decode($response, true);
print_r($responseData);
}
curl_close($ch);
?>