Acknowledgment Response Body
The acknowledgment response returns the identifier of the created acknowledgment record together with the normalized acknowledgment status and success flag.
Structure
{
"ad_ack_id": "string",
"status": "string",
"success": "boolean"
}
ad_ack_id
- Type:
string - Description: Unique identifier of the acknowledgment record created by Adstract.
status
- Type:
string - Description: Normalized acknowledgment status returned by the backend.
- Allowed values:
okno_ad_usedrecoverable_error
success
- Type:
boolean - Description: Whether the acknowledgment completed successfully.
- Behavior:
truewhenstatusisokorno_ad_usedfalsewhenstatusisrecoverable_error
Response values by HTTP code
| HTTP code | status | success | ad_ack_id |
|---|---|---|---|
200 OK | "ok" or "no_ad_used" | true | populated |
201 Created | "recoverable_error" | false | populated |
See Acknowledgment Status Codes for the full meaning of each response code.
Handling successful responses
- JavaScript
- Python
- cURL
const response = await fetch("https://api.adstract.ai/api/ad-injection/acknowledge/", {
method: "POST",
headers: {
"X-Adstract-API-Key": "your-api-key",
"Content-Type": "application/json",
},
body: JSON.stringify({
ad_response_id: "55c59ce2-a31f-4ce4-95b3-f930fd9cd564",
llm_response: llmResponse,
}),
});
if (response.status === 200 || response.status === 201) {
const data = await response.json();
const ackId = data.ad_ack_id;
const status = data.status;
const success = data.success;
}
import httpx
response = httpx.post(
"https://api.adstract.ai/api/ad-injection/acknowledge/",
headers={
"X-Adstract-API-Key": "your-api-key",
"Content-Type": "application/json",
},
json={
"ad_response_id": "55c59ce2-a31f-4ce4-95b3-f930fd9cd564",
"llm_response": llm_response,
},
)
if response.status_code in {200, 201}:
ack_id = response.json()["ad_ack_id"]
status = response.json()["status"]
success = response.json()["success"]
curl https://api.adstract.ai/api/ad-injection/acknowledge/ \
-H "X-Adstract-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"ad_response_id": "55c59ce2-a31f-4ce4-95b3-f930fd9cd564",
"llm_response": "Here is the full response text your LLM produced..."
}'