Skip to main content

Add new task

POST{{server}}/api/v1/counter/newTask

This endpoint adds a new service (task) to the ticket. To get a list of available services, use the List for new task endpoint.

Request

  • ticket (string, required): Ticket key

  • service(string, required): New service key

Response

It returns the newly added task to the ticket. You should add it to your memory stored ticket tasks array.

Request​

Authorization​

HeaderValue
AuthorizationBearer {{counterToken}}

Headers​

KeyValue
Acceptapplication/json
X-WSID{{counterWsID}}

Body (json)​

{
"ticket": "{{ticketKey}}",
"service": "00000000-0000-4000-0007-000000000005"
}

Code snippets​

curl -X POST '{{server}}/api/v1/counter/newTask' \
-H 'Accept: application/json' \
-H 'X-WSID: {{counterWsID}}' \
-H 'Authorization: Bearer {{counterToken}}' \
-H 'Content-Type: application/json' \
-d '{
"ticket": "{{ticketKey}}",
"service": "00000000-0000-4000-0007-000000000005"
}'

Example​

Example request
POST{{server}}/api/v1/counter/newTask
Headers (2)
KeyValue
Acceptapplication/json
X-WSID{{counterWsID}}
Body
{
"ticket": "1905ee5f-dbe2-4dfc-dd29-9ad2056f437f",
"service": "00000000-0000-4000-0007-000000000005"
}
Example response 200 Ok
Response headers (9)
KeyValue
Access-Control-Expose-Headers*
Cache-Controlno-store, no-cache, must-revalidate
Access-Control-Allow-Origin*
Access-Control-Allow-MethodsPOST, PUT, GET, OPTIONS, DELETE
Access-Control-Allow-Credentialstrue
Content-Length830
Access-Control-Max-Age86400
Access-Control-Allow-HeadersContent-Type, Authorization, X-Requested-With
Content-Typeapplication/json;charset=utf-8
Body
[
{
"type": 7,
"key": "1905f183-9ef6-46d2-57fd-8a023f46f526",
"subType": 1,
"name": "Service 5",
"statName": null,
"ticketLayout": null,
"numberInterval": "00000000-0000-4000-0019-000000000001",
"priority": 6,
"features": {
"afterwork": false,
"clerkSelection": false,
"customerIdentification": 0
},
"texts": {
"00000000-0000-4000-0004-000000000001": {
"name": "Service 5",
"explanation": null,
"comment": null
}
},
"codes": [
"00000000-0000-4000-0013-000000000006",
"00000000-0000-4000-0013-000000000007",
"00000000-0000-4000-0013-000000000008",
"00000000-0000-4000-0013-000000000009",
"00000000-0000-4000-0013-000000000010"
],
"status": 20,
"aspect": null,
"normalDelay": 120,
"forcedDelay": 300,
"services": [],
"time": 1712737927068,
"": null,
"service": "00000000-0000-4000-0007-000000000005",
"createType": 2,
"createdAt": 1719582341614,
"statusTime": 1719582341614,
"zero": false,
"user": null
}
]