ErrorMessages
Resource URI
/services/{serviceId}/errorSets/{errorSetId}/errorMessages
Items in curly braces represent variables.
Description
Error Messages represent the collection of possible error messages returned to developers using the APIs. They are included as part of an Error Set.
Resource Schema
Property | Characteristics | |
---|---|---|
id | Type | string |
Sub-type | ||
Create Rule | Required | |
Update Rule | Required | |
Fetch Rule | Implicit | |
Description | Object identifier. | |
code | Type | integer |
Sub-type | ||
Create Rule | Ignored | |
Update Rule | Ignored | |
Fetch Rule | Implicit | |
Description | HTTP Response Code used for the error response. | |
status | Type | string |
Sub-type | ||
Create Rule | Optional | |
Update Rule | Optional | |
Fetch Rule | Implicit | |
Description | Status message for the error. | |
detailHeader | Type | string |
Sub-type | ||
Create Rule | Optional | |
Update Rule | Optional | |
Fetch Rule | Implicit | |
Description | Information to be placed in the response header for an error. Header information is useful for developers to get additional information about the error. | |
responseBody | Type | string |
Sub-type | ||
Create Rule | Optional | |
Update Rule | Optional | |
Fetch Rule | Implicit | |
Description | Information to be placed in the response body for an error. Body information is useful for developers to get additional information about the error. |
fetch [GET]
Retrieves collection of ErrorMessages in the identified ErrorSet, returning an Array of ErrorMessages
Parameters
Parameter | Required | Type | Description |
---|---|---|---|
serviceId | true | string | Service identifier. |
errorSetId | true | string | Error Set identifier. |
fields | false | string | Comma-separated list of property paths to include in response. Each property path is a dot-separated list of object property names. fields=<property\[.property...\]>\[,...\]\[&fields=...\] |
filter | false | string | Colon-separated name/value pair specifying the name of property whose value must contain the given value (as a substring). Results may also be filtered by nested collections' properties by specifying a dot-separated property path. filter=<property\[.property...\]>:<value>\[&filter=...\] |
sort | false | string | Comma-separated list of properties to sort by. Only root-level properties are supported. Each property name may be optionally followed by :asc or :desc to specify sort direction (defaults to asc). sort=<property\[:(asc\|desc)\]>\[,...\]\[&sort=...\] |
limit | false | int | Number of objects to return in the result. Defaults to 100. |
offset | false | int | 0-based index of first object in the list to return. Defaults to 0. |
Returns
Success
Array of ErrorMessages for the Service If fields request parameter is not included, only those fields with "Fetch Rule" equal to "Implicit" will be returned. Otherwise, the fields contained in the URL parameter will be included in the response.
Failure
Array of validation responses
Examples
Request
curl -k 'https://api.mashery.com/v3/rest/services/0fcc39d1c7ee470780e6cbe6/errorSets/{errorSetId}/errorMessages' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json"
Response
[ { "id": "8a35cab5-6ebd-450f-8e88-eb341119a396", "status": "ultrices", "detailHeader": "vivamus tortor duis mattis", "responseBody": "posuere felis", "code": 33 } ]
Request
curl -k 'https://api.mashery.com/v3/rest/services/0fcc39d1c7ee470780e6cbe6/errorSets/{errorSetId}/errorMessages' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json"
Response
[ { "id": "7ab34783-50a3-4177-815c-893f7095f5e7", "status": "tempor convallis", "detailHeader": "ut volutpat sapien arcu", "responseBody": "vulputate ut", "code": 73 } ]
fetch all [GET]
Retrieves the identified ErrorMessage, returning a Service Definition ErrorMessage
Parameters
Parameter | Required | Type | Description |
---|---|---|---|
serviceId | true | string | Service identifier. |
errorSetId | true | string | Error Set identifier. |
messageType | true | string | Error Message identifier. |
fields | false | string | Comma-separated list of property paths to include in response. Each property path is a dot-separated list of object property names. fields=<property\[.property...\]>\[,...\]\[&fields=...\] |
filter | false | string | Colon-separated name/value pair specifying the name of property whose value must contain the given value (as a substring). Results may also be filtered by nested collections' properties by specifying a dot-separated property path. filter=<property\[.property...\]>:<value>\[&filter=...\] |
sort | false | string | Comma-separated list of properties to sort by. Only root-level properties are supported. Each property name may be optionally followed by :asc or :desc to specify sort direction (defaults to asc). sort=<property\[:(asc\|desc)\]>\[,...\]\[&sort=...\] |
limit | false | int | Number of objects to return in the result. Defaults to 100. |
offset | false | int | 0-based index of first object in the list to return. Defaults to 0. |
indent | false | boolean | When set to true, responses are indented for better readability. |
Returns
Success
ErrorMessage for the ErrorSet If fields request parameter is not included, only those fields with "Fetch Rule" equal to "Implicit" will be returned. Otherwise, the fields contained in the URL parameter will be included in the response.
Failure
Array of validation responses
Examples
Request
curl -k 'https://api.mashery.com/v3/rest/services/0fcc39d1c7ee470780e6cbe6/errorSets/{errorSetId}/errorMessages/{messageType}' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json"
Response
[ { "id": "73b0cd91-4e1f-4364-92a0-14685c5acb5d", "status": "iaculis diam erat fermentum", "detailHeader": "massa tempor", "responseBody": "viverra", "code": 88 } ]
Request
curl -k 'https://api.mashery.com/v3/rest/services/0fcc39d1c7ee470780e6cbe6/errorSets/{errorSetId}/errorMessages/{messageType}' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json"
Response
[ { "id": "dd8ab254-cc93-457a-8a06-df72d7084fc3", "status": "sodales sed tincidunt", "detailHeader": "amet", "responseBody": "nulla facilisi cras non", "code": 100 } ]
update [PUT]
Updates the identified ErrorMessage.
Parameters
Parameter | Required | Type | Description |
---|---|---|---|
serviceId | true | string | Service identifier. |
errorSetId | true | string | Error Set identifier. |
messageType | true | string | Error Message identifier. |
errorMessage | true | object | ErrorMessage object |
Returns
Success
ErrorMessage as persisted If fields request parameter is not included, only those fields with "Fetch Rule" equal to "Implicit" will be returned. Otherwise, the fields contained in the URL parameter will be included in the response.
Failure
Array of validation responses
Examples
Request
curl -k 'https://api.mashery.com/v3/rest/services/0fcc39d1c7ee470780e6cbe6/errorSets/{errorSetId}/errorMessages/{messageType}' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request PUT --data '{"id":"8b9a98d9-6875-49d3-88ae-6889770ea8ea","status":"quam fringilla","responseBody":"morbi odio odio","detailHeader":"adipiscing","code":2}
Response
[ { "id": "be602f83-494d-406c-a2af-44915deb2c02", "status": "semper porta volutpat quam", "detailHeader": "fusce", "responseBody": "curabitur in", "code": 11 } ]
Request
curl -k 'https://api.mashery.com/v3/rest/services/0fcc39d1c7ee470780e6cbe6/errorSets/{errorSetId}/errorMessages/{messageType}' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request PUT --data '{"id":"bcdd5678-b28c-4f2d-be90-57e16697e1a4","status":"sed","responseBody":"donec diam neque","detailHeader":"habitasse platea dictumst","code":67}
Response
[ { "id": "cb95d1fc-03bd-4b99-b561-7765e7313800", "status": "natoque penatibus", "detailHeader": "pede lobortis ligula sit", "responseBody": "magnis dis parturient", "code": 67 } ]
Docs Navigation
- API Documentation Portal
- IO Docs Definition
- Mashery API Documentation
- Mashery 3.0 API Guide
- Mashery 2.0 API Guide
- OAuth Supporting Methods
- Examples
- JSON RPC
- Authentication
- API Objects
- Fetching Objects
- Query Language
- Creating Objects
- Updating Objects
- Validating Fields
- Deleting Objects
- Applications
- General Object Methods
- Members
- Packages
- Plans
- Package Keys
- Keys
- Developer Classes
- Services
- Roles
- Mashery 2.0 Reporting API Guide
- Event Trigger API
- Differences between Roles and Portal Access Groups
- Managing a Portal Access Group Using Mashery V2 or V3 API
- Mashery Reporting Event Post API Guide
- Tips and Tricks
- Your Portal
- API Traffic Manager
- I/O Docs WSDL requirements