ErrorSets

Resource URI

/services/{serviceId}/errorSets

Items in curly braces represent variables.

Description

Error Sets are a collection, of which there must be at least one, of different Error Messages that are to be used by various Endpoints. Error Sets enable the specification of custom error messages. The Error Sets themselves are applied at the Endpoint level.

Resource Schema

Property Characteristics
name Type string
Sub-type
Create Rule Optional
Update Rule Optional
Fetch Rule Implicit
Description Name of the error set. This name is not displayed to the developer. It is used for administration purposes only.
type Type string
Sub-type
Create Rule Optional
Update Rule Optional
Fetch Rule Implicit
Description Format of the Error Messages that will be returned to the developer. Example formats: text/json, text/xml, application/JavaScript.
jsonp Type boolean
Sub-type
Create Rule Optional
Update Rule Optional
Fetch Rule Implicit
Description Enable the error return format as JSONP. All JSONP HTTP response codes will automatically be 200.
jsonpType Type string
Sub-type
Create Rule Optional
Update Rule Optional
Fetch Rule Implicit
Description The error format to use if the JSONP callback parameter is not available and the jsonp option is enabled.
errorMessages Type array
Sub-type ErrorMessage
Create Rule Optional
Update Rule Optional
Fetch Rule Explicit
Description Array of Error Message objects.

fetch [GET]

Retrieves collection of ErrorSets in the identified Service Definition, returning an Array of ErrorSets

Parameters

Parameter Required Type Description
serviceId true string Service 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 ErrorSets 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' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" 

Response

[
    {
        "jsonp": true,
        "name": "dolor vel est donec",
        "type": "eget congue eget semper",
        "jsonpType": "in magna"
    }
]

Request

curl -k 'https://api.mashery.com/v3/rest/services/0fcc39d1c7ee470780e6cbe6/errorSets' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" 

Response

[
    {
        "jsonp": true,
        "name": "magna",
        "type": "augue luctus",
        "jsonpType": "convallis"
    }
]

fetch all [GET]

Retrieves the identified ErrorSet, returning a Service Definition ErrorSet

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.
indent false boolean When set to true, responses are indented for better readability.

Returns

Success

ErrorSet 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}' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" 

Response

[
    {
        "jsonp": true,
        "name": "primis in faucibus",
        "type": "curabitur at ipsum ac",
        "jsonpType": "et eros vestibulum"
    }
]

Request

curl -k 'https://api.mashery.com/v3/rest/services/0fcc39d1c7ee470780e6cbe6/errorSets/{errorSetId}' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" 

Response

[
    {
        "jsonp": false,
        "name": "quis lectus",
        "type": "non mattis pulvinar nulla",
        "jsonpType": "aliquam sit amet"
    }
]

update [PUT]

Updates the identified ErrorSet.

Parameters

Parameter Required Type Description
serviceId true string Service identifier.
errorSetId true string Error Set identifier.
errorSet true object ErrorSet object

Returns

Success

ErrorSet 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}' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request PUT --data '{"jsonp":false,"name":"neque libero","type":"accumsan tellus nisi","jsonpType":"tortor risus dapibus"}

Response

[
    {
        "jsonp": false,
        "name": "erat tortor sollicitudin",
        "type": "at",
        "jsonpType": "pede posuere nonummy integer"
    }
]

Request

curl -k 'https://api.mashery.com/v3/rest/services/0fcc39d1c7ee470780e6cbe6/errorSets/{errorSetId}' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request PUT --data '{"jsonp":true,"name":"libero ut massa","type":"ultrices posuere cubilia","jsonpType":"eleifend donec ut dolor"}

Response

[
    {
        "jsonp": true,
        "name": "nulla sed",
        "type": "viverra",
        "jsonpType": "cursus vestibulum proin"
    }
]

create [POST]

Creates a new ErrorSet in the given Service Definition.

Parameters

Parameter Required Type Description
serviceId true string Service identifier.
errorSet true object ErrorSet object

Returns

Success

ErrorSet as created 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' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request POST --data '{"jsonp":true,"name":"suspendisse","type":"est","jsonpType":"porttitor lacus"}

Response

[
    {
        "jsonp": false,
        "name": "praesent blandit",
        "type": "pede ac diam cras",
        "jsonpType": "iaculis"
    }
]

Request

curl -k 'https://api.mashery.com/v3/rest/services/0fcc39d1c7ee470780e6cbe6/errorSets' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request POST --data '{"jsonp":true,"name":"proin","type":"ultrices posuere","jsonpType":"quam turpis adipiscing lorem"}

Response

[
    {
        "jsonp": false,
        "name": "quam sollicitudin vitae consectetuer",
        "type": "natoque",
        "jsonpType": "tempus sit"
    }
]

delete [DELETE]

Deletes the identified ErrorSet.

Parameters

Parameter Required Type Description
serviceId true string Service identifier.
errorSetId true string Error Set identifier.

Returns

Success

Empty response

Failure

Array of validation responses

Examples

Request

curl -k 'https://api.mashery.com/v3/rest/services/0fcc39d1c7ee470780e6cbe6/errorSets/{errorSetId}' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request DELETE

Response

[
    ""
]

Request

curl -k 'https://api.mashery.com/v3/rest/services/0fcc39d1c7ee470780e6cbe6/errorSets/{errorSetId}' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request DELETE

Response

[
    ""
]

Docs Navigation