Status
Status entities are returned when objects are created, updated and deleted. They are also returned in the event of an error. As such, it is critical that all calls are capable of handling a status response.
Fields
Field name | Description | Type/Allowed values |
---|---|---|
status_code |
The HTTP status code of the request. | Numeric HTTP Status codes |
sub_code |
Error code specific to this error type, if any | Numeric |
etag |
The etag of the object created or updated, if any | ETag |
resources_created |
A link to the resource created by this call. |
Link |
resources_updated |
A link to the resource updated by this call. |
Link |
resources_deleted |
A link to the resource deleted by this call. |
Link |
debug |
Some set of tags returned indicating details of this specific error | Unspecified tag set |
warnings |
A list of warning sub-tags |
Warning sub-tags |
warning |
A warning issued when processing this request. | Human readable text |
Examples
Status Entity in response to create call:
<status>
<status_code>201</status_code>
<etag>12345678</etag>
<resources_created>
<link
rel="http://api-info.newsweaver.com/v2/rels/status.created"
href="https://api.newsweaver.com/v2/example-account/subscriber/someone@somewhere.com/tag/Some%20Tag"
title="Subscriber Tag (Some Tag)" />
</resources_created>
<warnings>
<warning>Some Warning Message</warning>
</warnings>
</status>
Status Entity in response to update call:
<status>
<status_code>200</status_code>
<etag>12345678</etag>
<resources_updated>
<link
rel="http://api-info.newsweaver.com/v2/rels/status.updated"
href="https://api.newsweaver.com/v2/example-account/subscriber/someone@somewhere.com/tag/Some%20Tag"
title="Subscriber Tag (Some Tag)" />
</resources_updated>
<warnings>
<warning>Some Warning Message</warning>
</warnings>
</status>
Status Entity in response to delete call:
<status>
<status_code>200</status_code>
<resources_deleted>
<link
rel="http://api-info.newsweaver.com/v2/rels/status.deleted"
href="https://api.newsweaver.com/v2/example-account/subscriber/someone@somewhere.com/tag/Some%20Tag"
title="Subscriber Tag (Some Tag)" />
</resources_deleted>
<warnings>
<warning>Some Warning Message</warning>
</warnings>
</status>
Status Entity in an error situation:
<status>
<status_code>409</status_code>
<message>Human readable message</message>
<sub_code>Some Number</sub_code>
<debug>
<exception_id>12345678</exception_id>
<detail>Some Detail Message</detail>
</debug>
<warnings>
<warning>Some Warning Message</warning>
</warnings>
</status>
See errors for additional information.