Responses
Success and error responses typically conform to the following formats.
Error response
Errors returned with 4xx responses. Errors include as much information as possible to help you understand the reason for the failure.
OBJECT PROPERTIES- details object
Provides information relating to the specific
OBJECT PROPERTIESerror_codewhen possible. For400errors, this object may include thepathandlocationof validation failures.- error string
Specific information about the semantic error, helping you better understand why the request failed.
- location object
The specific line and column where the validation error occurred, if known.
OBJECT PROPERTIES- column integer
The column containing the semantic error.
- line integer
The line containing the semantic error.
- path string
The path to the key containing the validation error.
- error stringREQUIRED
A plain-text explanation of the error.
- error_code integer
The Airship error code. This is normally the HTTP error code appended with a 2-digit identifier, helping provide more specific details about the error.
- ok booleanREQUIRED
2xx responses return
true; 4xx responses returnfalse.
Used in:
- Add Custom Events
- App opens report
- Channel listing
- Channel lookup
- Channel tags
- Channel tags
- Create a tag list
- Create and Send a message
- Create Attributes list
- Create bulk send audience
- Create email attachment
- Create experiment (A/B Test)
- Create list
- Create pipeline (automated message)
- Create Segment
- Create template
- Custom Events detail listing
- Custom Events per group summary
- Custom Events per push summary
- Custom unsubscribe email channel
- Delete a list
- Delete experiment
- Delete message from inbox
- Delete multiple messages from inbox
- Delete pipeline
- Delete schedule
- Delete Segment
- Delete tag list
- Delete template
- Devices report
- Download a list of channels
- Download list errors
- Download list errors
- Email tags
- Email tags
- Experiment listing
- Experiment lookup
- Experiment overview report
- Get single list metadata
- Individual pipeline lookup
- Individual push response statistics
- List a specific schedule
- List deleted pipelines
- List existing pipelines
- List filtered pipelines
- List pipelines constraints
- List pipelines limits
- List schedules
- List templates
- Look up a template
- Look up an email address
- Look up Contact ID by Channel ID
- Look up Contact ID by Named User ID
- Manually trigger a keyword interaction
- Named User listing or lookup
- Named User subscription lists listing
- Named User update
- Named Users association
- Named Users disassociation
- Named Users tags
- Named Users tags
- Named Users uninstall
- Named Users uninstall
- Open channel tags
- Open channel tags
- Opt-in report
- Opt-out report
- Pause a schedule
- Push report
- Push to template
- Region listing
- Region lookup
- Register email channel
- Register new / update channel
- Remove suppression from an email channel
- Replace email channel
- Response listing
- Response report
- Resume a schedule
- Retrieve lists
- Retrieve lists
- Retrieve lists
- Schedule a Create and Send message
- Schedule a notification
- Schedule a templated push
- Schedule message with bulk ID
- Scheduled experiment listing
- Scoped Named User batch operations
- Segment listing
- Segment lookup
- Send a push
- Send message with bulk ID
- Set or remove attributes on channels
- Set or remove attributes on Named Users
- SMS tags
- SMS tags
- Subscribe or unsubscribe channels to/from subscription lists
- Subscription lists listing
- Suppress an email channel
- Time in app report
- Uninstall channels
- Uninstall channels
- Uninstall email channel
- Uninstall open channels
- Update an email channel
- Update list contents
- Update list metadata
- Update pipeline
- Update pipelines constraints
- Update schedule
- Update Segment
- Update template
- Upload Attribute list
- Upload tag list
- Validate a push
- Validate a template
- Validate Create and Send payload
- Validate experiment
- Validate message with bulk ID
- Validate pipeline
- Web response report
Examples
400 response
{
"ok" : false,
"error" : "Could not parse request body.",
"error_code" : 40000,
"details" : {
"error" : "The key 'alert1' is not allowed in this context",
"path" : "notification.alert1",
"location" : {
"line" : 5,
"column" : 18
}
}
400 response without location
{
"ok": false,
"error": "Could not parse request body.",
"error_code": 40902,
"details": {
"error": "malformed sender"
}
}
404 response
{
"ok": false,
"error": "Entity not found",
"error_code": 40401
}
OK response
Returned with 2xx Responses. At a minimum, successful calls return true for the ok key. If your call includes a verbose response (as with GET requests, etc.), the ok key will appear in the top-most object, outside the verbose response.
- ok booleanREQUIRED
Success.
- operation_id string
A unique string identifying the operations that modify resources. Use the operation ID to locate and track grouped operations (i.e., a batch push operation may generate multiple
push_idstrings, but a singleoperation_id) or operations that change an existing resource.
Used in:
- Create a tag list
- Create Attributes list
- Create list
- Delete message from inbox
- Delete multiple messages from inbox
- Email tags
- Email tags
- Named Users association
- Named Users disassociation
- Named Users uninstall
- Named Users uninstall
- Open channel tags
- Open channel tags
- Remove suppression from an email channel
- Scoped Named User batch operations
- SMS tags
- SMS tags
- Subscribe or unsubscribe channels to/from subscription lists
- Suppress an email channel
- Uninstall channels
- Uninstall channels
- Uninstall email channel
- Uninstall open channels
- Update list contents
- Update list metadata
- Update pipeline
- Update pipelines constraints
- Update Segment
- Upload Attribute list
- Upload tag list
- Validate a push
- Validate a template
- Validate Create and Send payload
- Validate message with bulk ID
- Validate pipeline
Examples
OK response
HTTP/1.1 202 Accepted
Content-Type: application/vnd.urbanairship+json; version=3
{
"ok": true,
}
OK with identifiers
HTTP/1.1 202 Accepted
Data-Attribute: push_ids
Content-Type: application/vnd.urbanairship+json; version=3
{
"ok": true,
"operation_id": "df6a6b50-9843-0304-d5a5-743f246a4946",
"push_ids": [
"9d78a53b-b16a-c58f-b78d-181d5e242078"
]
}