cURL
# Persist the key first. Reuse it only to inspect an uncertain result.
curl -X POST "https://api.superskope.com/api/v1/work/tickets" \
-H "Authorization: Bearer $SUPERSKOPE_API_KEY" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Refund request","chatId":"120000000000@g.us"}'import { SuperSkope } from '@superskope/sdk';
const client = new SuperSkope({
origin: 'https://api.superskope.com',
apiKey: process.env.SUPERSKOPE_API_KEY,
});
// Persist the key first. Reuse it only to inspect an uncertain result.
const idempotencyKey = process.env.IDEMPOTENCY_KEY;
const result = await client.saveWork('ticket', { name: 'Refund request', chatId: '120000000000@g.us' }, { idempotencyKey });
console.log(result);
import os
import requests
response = requests.post(
"https://api.superskope.com/api/v1/work/tickets",
headers={"Authorization": f"Bearer {os.environ['SUPERSKOPE_API_KEY']}", "Idempotency-Key": os.environ["IDEMPOTENCY_KEY"]},
json={"name": "Refund request", "chatId": "120000000000@g.us"},
timeout=40,
)
print(response.status_code, response.json())
{
"entity": {
"id": "<string>",
"kind": "ticket",
"name": "<string>",
"chatId": "<string>",
"status": "<string>",
"version": 123,
"messageId": "<string>"
},
"state": "completed",
"replayed": true
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Work and reports
Create a ticket
Create a selected ticket. Requires work:write. Exact key-selected conversations and current phone are enforced. Completed identical repeats return the saved result. Unknown effects cannot execute again with that key; inspect /requests/.
cURL
# Persist the key first. Reuse it only to inspect an uncertain result.
curl -X POST "https://api.superskope.com/api/v1/work/tickets" \
-H "Authorization: Bearer $SUPERSKOPE_API_KEY" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Refund request","chatId":"120000000000@g.us"}'import { SuperSkope } from '@superskope/sdk';
const client = new SuperSkope({
origin: 'https://api.superskope.com',
apiKey: process.env.SUPERSKOPE_API_KEY,
});
// Persist the key first. Reuse it only to inspect an uncertain result.
const idempotencyKey = process.env.IDEMPOTENCY_KEY;
const result = await client.saveWork('ticket', { name: 'Refund request', chatId: '120000000000@g.us' }, { idempotencyKey });
console.log(result);
import os
import requests
response = requests.post(
"https://api.superskope.com/api/v1/work/tickets",
headers={"Authorization": f"Bearer {os.environ['SUPERSKOPE_API_KEY']}", "Idempotency-Key": os.environ["IDEMPOTENCY_KEY"]},
json={"name": "Refund request", "chatId": "120000000000@g.us"},
timeout=40,
)
print(response.status_code, response.json())
{
"entity": {
"id": "<string>",
"kind": "ticket",
"name": "<string>",
"chatId": "<string>",
"status": "<string>",
"version": 123,
"messageId": "<string>"
},
"state": "completed",
"replayed": true
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Body
application/json