• Register

Response Filters

Resource URI

/services/{serviceId}/endpoints/{endpointId}/methods/{methodId}/responseFilters/{responseFilterId}

Items in curly braces represent variables.

Description

Response Filters, when applied to a Plan Method, can remove data elements from the body of an API response, before sending it back to the developer.

Resource Schema

Property Characteristics
id Type string
Sub-type
Create Rule Ignored
Update Rule Required (if not in context)
Fetch Rule Implicit
Description Object identifier.
name Type string
Sub-type
Create Rule Required
Update Rule Optional
Fetch Rule Implicit
Description Method name.
created Type string
Sub-type datetime
Create Rule Ignored
Update Rule Ignored
Fetch Rule Implicit
Description Date/time the object was created.
updated Type string
Sub-type datetime
Create Rule Ignored
Update Rule Ignored
Fetch Rule Implicit
Description Date/time the object was updated.
notes Type string
Sub-type
Create Rule Required
Update Rule Optional
Fetch Rule Implicit
Description Method name.
xmlFilterFields Type string
Sub-type
Create Rule Ignored
Update Rule Ignored
Fetch Rule Explicit
Description Fields to strip from the response body of an XML response.
jsonFilterFields Type string
Sub-type
Create Rule Ignored
Update Rule Ignored
Fetch Rule Explicit
Description Fields to strip from the response body of a JSON response.

fetch all [GET]

Retrieves collection of ResponseFilters for the identified Service Definition Method, returning an Array of Response Filters

Parameters

Parameter Required Type Description
serviceId true string Service identifier.
endpointId true string Endpoint identifier.
methodId true string Method 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

Array of ResponseFilters for the ServiceDefinitionMethod 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/endpoints/0dd96770b82f4f248c4711d9/methods/9f42d173-42f8-4862-b3e8-826e9de55ecd/responseFilters' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" 

Response

[
    {
        "id": "82f729df-758a-4df3-87e7-dca0a996e5f2",
        "created": "2013-11-25T01:13:33.000+0000",
        "updated": "2014-03-02T02:14:58.000+0000",
        "name": "vestibulum",
        "xmlFilterFields": "sed sagittis nam",
        "notes": "tortor sollicitudin mi sit",
        "jsonFilterFields": "nascetur ridiculus"
    }
]

Request

curl -k 'https://api.mashery.com/v3/rest/services/0fcc39d1c7ee470780e6cbe6/endpoints/0dd96770b82f4f248c4711d9/methods/9f42d173-42f8-4862-b3e8-826e9de55ecd/responseFilters' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" 

Response

[
    {
        "id": "afed7163-efe1-46f7-b8ce-7079350206f4",
        "created": "2014-01-07T23:05:33.000+0000",
        "updated": "2014-04-16T20:46:42.000+0000",
        "name": "consequat in",
        "notes": "ultrices posuere cubilia curae"
    }
]

fetch [GET]

Retrieves the identified Response Filter for the specified Service Definition Method

Parameters

Parameter Required Type Description
serviceId true string Service identifier.
endpointId true string Endpoint identifier.
methodId true string Method identifier.
responseFilterId true string Response Filter 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

Response Filter for specified ResponseFilter identifier 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/endpoints/0dd96770b82f4f248c4711d9/methods/9f42d173-42f8-4862-b3e8-826e9de55ecd/responseFilters/a86bcda3-660e-48a1-b148-d6d5ba85fda8' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" 

Response

[
    {
        "id": "876beb8e-6306-4d7a-9452-8282bb5ab9c8",
        "created": "2014-02-15T07:52:22.000+0000",
        "updated": "2013-11-15T23:49:35.000+0000",
        "name": "in hac",
        "xmlFilterFields": "nisl",
        "notes": "risus praesent lectus",
        "jsonFilterFields": "accumsan"
    }
]

Request

curl -k 'https://api.mashery.com/v3/rest/services/0fcc39d1c7ee470780e6cbe6/endpoints/0dd96770b82f4f248c4711d9/methods/9f42d173-42f8-4862-b3e8-826e9de55ecd/responseFilters/a86bcda3-660e-48a1-b148-d6d5ba85fda8' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" 

Response

[
    {
        "id": "b503b4f7-39a5-4da6-bd97-bf404d65716e",
        "created": "2013-11-19T02:11:03.000+0000",
        "updated": "2014-04-15T12:19:29.000+0000",
        "name": "duis",
        "notes": "vel"
    }
]

create [POST]

Creates a new Method Response Filter associated with a Service Definition Method.

Parameters

Parameter Required Type Description
serviceId true string Service identifier.
endpointId true string Endpoint identifier.
methodId true string Method identifier.
responseFilter true object ResponseFilter object

Returns

Success

ResponseFilter 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/endpoints/0dd96770b82f4f248c4711d9/methods/9f42d173-42f8-4862-b3e8-826e9de55ecd/responseFilters' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request POST --data '{"id":"dc1a55d8-8639-4161-a7e9-987d36737385","updated":"2013-11-02T06:18:27.000+0000","created":"2014-03-17T19:54:48.000+0000","name":"in","xmlFilterFields":"cras in purus eu","notes":"dolor sit amet","jsonFilterFields":"dui proin leo odio"}

Response

[
    {
        "id": "1531051a-e8e0-4683-beb4-feb875c5b05c",
        "created": "2013-11-30T07:34:03.000+0000",
        "updated": "2013-09-10T18:15:02.000+0000",
        "name": "justo lacinia eget tincidunt",
        "xmlFilterFields": "in porttitor pede justo",
        "notes": "congue eget semper rutrum",
        "jsonFilterFields": "luctus et"
    }
]

Request

curl -k 'https://api.mashery.com/v3/rest/services/0fcc39d1c7ee470780e6cbe6/endpoints/0dd96770b82f4f248c4711d9/methods/9f42d173-42f8-4862-b3e8-826e9de55ecd/responseFilters' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request POST --data '{"id":"52944d5a-b8b7-41c9-a236-7d8803566b7a","updated":"2014-06-07T00:23:36.000+0000","created":"2014-05-11T07:50:14.000+0000","name":"blandit","notes":"quam suspendisse"}

Response

[
    {
        "id": "de557539-4aaf-421f-b403-cba77d982436",
        "created": "2014-07-14T03:58:36.000+0000",
        "updated": "2013-12-08T21:43:41.000+0000",
        "name": "dui nec nisi volutpat",
        "notes": "lorem quisque"
    }
]

update [PUT]

Updates the identified Service Definition Method.

Parameters

Parameter Required Type Description
serviceId true string Service identifier.
endpointId true string Endpoint identifier.
methodId true string Method identifier.
responseFilterId true string Response Filter identifier.
responseFilter true object ResponseFilter object

Returns

Success

ResponseFilter 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/endpoints/0dd96770b82f4f248c4711d9/methods/9f42d173-42f8-4862-b3e8-826e9de55ecd/responseFilters/a86bcda3-660e-48a1-b148-d6d5ba85fda8' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request PUT --data '{"id":"6b56b932-2f56-472e-bbde-45a18ab9f617","updated":"2013-08-06T21:37:32.000+0000","created":"2014-02-13T23:27:47.000+0000","name":"duis","xmlFilterFields":"mattis odio","notes":"ridiculus mus etiam vel","jsonFilterFields":"gravida sem praesent id"}

Response

[
    {
        "id": "a32b03b2-eace-41ca-9299-afd30490a6b5",
        "created": "2013-09-07T15:32:47.000+0000",
        "updated": "2013-11-18T06:59:05.000+0000",
        "name": "sapien ut nunc",
        "xmlFilterFields": "tempus",
        "notes": "tincidunt",
        "jsonFilterFields": "ridiculus mus"
    }
]

Request

curl -k 'https://api.mashery.com/v3/rest/services/0fcc39d1c7ee470780e6cbe6/endpoints/0dd96770b82f4f248c4711d9/methods/9f42d173-42f8-4862-b3e8-826e9de55ecd/responseFilters/a86bcda3-660e-48a1-b148-d6d5ba85fda8' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request PUT --data '{"id":"e40de9a1-e6be-4eb5-b99e-6173f29e3716","updated":"2014-04-30T11:13:02.000+0000","created":"2014-05-23T02:26:42.000+0000","name":"vulputate luctus","notes":"elementum pellentesque quisque"}

Response

[
    {
        "id": "76fb864f-627d-4b18-95d6-41245744c491",
        "created": "2014-03-07T01:00:42.000+0000",
        "updated": "2014-05-28T20:02:15.000+0000",
        "name": "condimentum id",
        "notes": "in lectus pellentesque at"
    }
]

delete [DELETE]

Deletes the identified Service Definition Method.

Parameters

Parameter Required Type Description
serviceId true string Service identifier.
endpointId true string Endpoint identifier.
methodId true string Method identifier.
responseFilterId true string Response Filter identifier.

Returns

Success

Empty response

Failure

Array of validation responses

Examples

Request

curl -k 'https://api.mashery.com/v3/rest/services/0fcc39d1c7ee470780e6cbe6/endpoints/0dd96770b82f4f248c4711d9/methods/9f42d173-42f8-4862-b3e8-826e9de55ecd/responseFilters/a86bcda3-660e-48a1-b148-d6d5ba85fda8' -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/endpoints/0dd96770b82f4f248c4711d9/methods/9f42d173-42f8-4862-b3e8-826e9de55ecd/responseFilters/a86bcda3-660e-48a1-b148-d6d5ba85fda8' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request DELETE

Response

[
    ""
]

Docs Navigation