Integration Tickets: Async Processing & Polling
Some integration endpoints process requests asynchronously and return a ticketId. This guide explains how ticket-based processing works, how to poll for results, and how to handle success and failure.
How it works
┌──────────┐ ┌──────────────┐ ┌──────────────┐
│ Client │──POST──▶│ smenso API │──202──▶ │ ticketId │
│ │ │ (accepted) │ │ returned │
└──────────┘ └──────────────┘ └──────┬───────┘
│
┌─────────────────────────────────────────────────┘
▼
┌──────────┐ poll ┌──────────────┐
│ Client │──GET───▶ │ Status │──▶ Processing / Completed / Failed
│ │◀─────────│ Endpoint │
└──────────┘ result └──────────────┘
- You send a request (e.g., create tasks in bulk).
- The API accepts the job and returns a
ticketId(HTTP202). - Processing happens in the background.
- You poll the status endpoint with the
ticketIduntil a terminal state is reached.
When do I get a ticketId?
You typically receive a ticketId when:
- The request contains multiple items (batch operations)
- The operation may take longer to process (e.g., creating/updating many records)
- Additional validation or business rules must be applied before completion
Not all endpoints are asynchronous. Synchronous endpoints return the final result immediately without a ticketId. You can check whether an endpoint uses tickets by looking at the Responses section in the API Reference.
Ticket lifecycle
| Phase | Description |
|---|---|
| Created | The ticketId is issued; the job is queued |
| Processing | The system validates data and executes operations |
| Completed ✅ | The job finished successfully (terminal state) |
| Failed ❌ | The job could not be completed (terminal state) |
Status endpoints
Poll the ticket status using the endpoint that matches your API format:
| Format | Endpoint |
|---|---|
| JSON | GET /skyisland/api/integration/status/json/{ticketId} |
| XML | GET /skyisland/api/integration/status/{ticketId} |
Example: Polling in JSON
curl -X GET \
"https://{workspace}.smenso.cloud/skyisland/api/integration/status/json/{ticketId}" \
-H "Authorization: Basic {your-api-token}"Example response (completed)
{
"id": "c3406426-6028-48da-ad4a-76865336ff0f",
"endpoint": "Task",
"status": "Success",
"statusId": 10,
"received": "2024-05-10T09:53:49+00:00",
"started": "2024-05-10T09:53:52+00:00",
"processed": "2024-05-10T09:56:41+00:00",
"projects": {
"created": 0,
"modified": 0
},
"tasks": {
"created": 100,
"modified": 0
}
}Example response (failed)
{
"id": "d4517937-9c6d-49eb-be5b-87976746aa08",
"endpoint": "Task",
"status": "Failed",
"statusId": 20,
"received": "2024-05-10T10:01:00+00:00",
"errors": [
"The Title field is required.",
"Project with ID 'abc-123' not found."
]
}Recommended polling strategy
Use exponential backoff to avoid unnecessary load while keeping response times short:
| Poll attempt | Wait before next poll |
|---|---|
| 1 | 1 second |
| 2 | 2 seconds |
| 3 | 5 seconds |
| 4 | 10 seconds |
| 5 | 20 seconds |
| 6+ | 30 seconds (cap) |
Stop polling when the ticket reaches a terminal state (Completed or Failed).
Timeout recommendations
| Job size | Suggested timeout |
|---|---|
| Single item or small batch (< 10) | 1-3 minutes |
| Medium batch (10-100) | 3-10 minutes |
| Large batch (100+) | 10-15 minutes |
If the ticket does not reach a terminal state within your timeout:
- Log the
ticketIdfor later investigation. - Treat the outcome as "unknown."
- Retry the status check later or alert an operator.
Handling results
On success (Completed)
- Mark the job as successful in your system.
- Store any created/updated entity IDs returned in the response.
- Review warnings - even successful jobs may include informational messages about business rule adjustments.
On failure (Failed)
Inspect the error details and categorize them:
| Error type | Examples | Action |
|---|---|---|
| Retryable (transient) | Network timeout, 500 server error, rate limit hit | Wait and retry with backoff |
| Non-retryable (data) | Missing required field, invalid GUID, business rule violation | Fix the request data, then retry |
For batch operations, check whether the response includes item-level results to identify which specific records succeeded or failed.
TempId mapping (XML API): When submitting batches via XML, you can include a client-sideTempIdfor each item. The ticket response mapsTempIdvalues to created entity IDs, allowing you to correlate results with your source records.
Common pitfalls
| Pitfall | How to avoid it |
|---|---|
| Polling too fast | Use backoff. Don't poll more than once per second, even for small jobs. |
| No timeout | Always define a maximum wait time. Never block indefinitely. |
Not persisting the ticketId | Store it so you can resume status checks after crashes or restarts. |
| Ignoring warnings | Even successful tickets may include warnings about adjusted values or partial behavior. Always log them. |
| Not handling item-level errors in batches | A batch may partially succeed. Check per-item results if available. |
Troubleshooting checklist
If a ticket fails:
- ✅ Verify the API token is valid and has Admin permissions
- ✅ Check that all required fields are present and correctly formatted
- ✅ Confirm that all referenced GUIDs (project, user, type, etc.) exist in your workspace
- ✅ Review business rules that might block the operation (e.g., absence overlap, locked time records)
- ✅ Try resubmitting with a smaller batch to isolate the problematic item(s)
- ✅ Check the API Reference for endpoint-specific validation rules
Updated 15 days ago
