Save customer data
POST
{{server}}/api/v1/counter/customerDataThis endpoint saves customer data for the ticket. The customer data object can contain fields from data1 to data10.
If the ticket has already customer data, the server will merge it with the new customer data values.
Request
-
ticket(string, required): Thekeyof the called ticket -
customerData(object, required): The customer data objectdata1...data10(string|number): Customer data values
This request has no response if it was successful.
Request
Authorization
| Header | Value |
|---|---|
Authorization | Bearer {{counterToken}} |
Headers
| Key | Value |
|---|---|
Accept | application/json |
X-WSID | {{counterWsID}} |
Body (json)
{
"ticket": "{{ticketKey}}",
"customerData": {
"data1": "John Doe",
"data2": "+1-555-1234"
}
}
Code snippets
- cURL
- JavaScript
- Python
curl -X POST '{{server}}/api/v1/counter/customerData' \
-H 'Accept: application/json' \
-H 'X-WSID: {{counterWsID}}' \
-H 'Authorization: Bearer {{counterToken}}' \
-H 'Content-Type: application/json' \
-d '{
"ticket": "{{ticketKey}}",
"customerData": {
"data1": "John Doe",
"data2": "+1-555-1234"
}
}'
const response = await fetch("{{server}}/api/v1/counter/customerData", {
method: "POST",
headers: {
"Accept": "application/json",
"X-WSID": "{{counterWsID}}",
"Authorization": "Bearer {{counterToken}}",
"Content-Type": "application/json"
},
body: JSON.stringify({
"ticket": "{{ticketKey}}",
"customerData": {
"data1": "John Doe",
"data2": "+1-555-1234"
}
}),
});
const data = await response.json();
console.log(data);
import requests
url = "{{server}}/api/v1/counter/customerData"
headers = {
"Accept": "application/json",
"X-WSID": "{{counterWsID}}",
"Authorization": "Bearer {{counterToken}}",
"Content-Type": "application/json"
}
payload = {
"ticket": "{{ticketKey}}",
"customerData": {
"data1": "John Doe",
"data2": "+1-555-1234"
}
}
response = requests.post(url, headers=headers, json=payload)
print(response.status_code)
print(response.json())
Example
Example request
POST
{{server}}/api/v1/counter/customerDataHeaders (2)
| Key | Value |
|---|---|
Accept | application/json |
X-WSID | {{counterWsID}} |
Body
{
"ticket": "1905ee5f-dbc7-4ac8-61a9-c9f961034f1b",
"customerData": {
"data1": "John Doe",
"data2": "+1-555-1234"
}
}
Example response 204 No Content
No response body