Plan Methods

Resource URI

/packages/{packageId}/plans/{planId}/services/{serviceId}/endpoints/{endpointId}/methods/{methodId}

Items in curly braces represent variables.

Description

A plan method represents the relationship between a plan and a service definition method. It is created when a service definition method is included in a plan, either directly or when its parent service definition endpoint or its ancestor service definition are included.

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.
sampleJsonResponse Type string
Sub-type
Create Rule Optional
Update Rule Optional
Fetch Rule Explicit
Description A valid XML schema can be entered in this field. This definition can help you set response filters.
sampleXmlResponse Type string
Sub-type
Create Rule Optional
Update Rule Optional
Fetch Rule Explicit
Description A valid JSON schema can be entered in this field. This definition can help you set response filters.

fetch all [GET]

Retrieves collection of Plan Methods belonging to the given Plan Endpoint.

Parameters

Parameter Required Type Description
packageId true string Package identifier.
planId true string Plan identifier.
serviceId true string Service identifier.
endpointId true string Endpoint 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 Plan Methods for the Plan Endpoint 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/packages/83cca97c-986b-468c-b277-525b633909a9/plans/9c0e6072-b6a8-4085-877b-e3fb1c71bc73/services/0fcc39d1c7ee470780e6cbe6/endpoints/0dd96770b82f4f248c4711d9/methods' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" 

Response

[
    {
        "id": "0c43def1-4bc8-4ee0-8428-cd1922cc0b78",
        "created": "2014-04-03T14:27:20.000+0000",
        "updated": "2014-01-02T03:00:28.000+0000",
        "sampleJsonResponse": "amet eleifend pede libero",
        "name": "nisl",
        "sampleXmlResponse": "nulla ultrices aliquet maecenas"
    }
]

Request

curl -k 'https://api.mashery.com/v3/rest/packages/83cca97c-986b-468c-b277-525b633909a9/plans/9c0e6072-b6a8-4085-877b-e3fb1c71bc73/services/0fcc39d1c7ee470780e6cbe6/endpoints/0dd96770b82f4f248c4711d9/methods' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" 

Response

[
    {
        "id": "8f1b8025-266d-4e55-b174-caf112456f7c",
        "created": "2014-04-18T11:18:33.000+0000",
        "updated": "2013-10-21T19:51:50.000+0000",
        "name": "id ligula"
    }
]

fetch [GET]

Retrieves the Plan Method, returning a Plan Method

Parameters

Parameter Required Type Description
packageId true string Package identifier.
planId true string Plan identifier.
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

Plan Method as identified 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/packages/83cca97c-986b-468c-b277-525b633909a9/plans/9c0e6072-b6a8-4085-877b-e3fb1c71bc73/services/0fcc39d1c7ee470780e6cbe6/endpoints/0dd96770b82f4f248c4711d9/methods/9f42d173-42f8-4862-b3e8-826e9de55ecd' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" 

Response

[
    {
        "id": "d454b67c-603e-4c7d-9b9c-28061c15957f",
        "created": "2014-02-26T23:13:28.000+0000",
        "updated": "2013-07-25T23:46:32.000+0000",
        "sampleJsonResponse": "phasellus id sapien",
        "name": "iaculis congue vivamus metus",
        "sampleXmlResponse": "et tempus semper est"
    }
]

Request

curl -k 'https://api.mashery.com/v3/rest/packages/83cca97c-986b-468c-b277-525b633909a9/plans/9c0e6072-b6a8-4085-877b-e3fb1c71bc73/services/0fcc39d1c7ee470780e6cbe6/endpoints/0dd96770b82f4f248c4711d9/methods/9f42d173-42f8-4862-b3e8-826e9de55ecd' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" 

Response

[
    {
        "id": "56d793ec-c0b3-4f95-ba0a-6f5a549451b3",
        "created": "2014-07-02T20:50:33.000+0000",
        "updated": "2013-09-18T16:15:35.000+0000",
        "name": "eleifend pede"
    }
]

create [POST]

Creates a new Plan Method in the given Plan Endpoint.

Parameters

Parameter Required Type Description
packageId true string Package identifier.
planId true string Plan identifier.
serviceId true string Service identifier.
endpointId true string Endpoint identifier.
planMethod true object Plan Method object

Returns

Success

Plan Method 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/packages/83cca97c-986b-468c-b277-525b633909a9/plans/9c0e6072-b6a8-4085-877b-e3fb1c71bc73/services/0fcc39d1c7ee470780e6cbe6/endpoints/0dd96770b82f4f248c4711d9/methods' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request POST --data '{"id":"4924dd12-8845-4dca-ac6b-3bffb8d819f6","sampleJsonResponse":"erat","updated":"2013-09-21T06:42:37.000+0000","created":"2014-05-06T20:40:09.000+0000","name":"ut","sampleXmlResponse":"sit amet"}

Response

[
    {
        "id": "f298c45d-65bf-4a66-a148-d904828c01b2",
        "created": "2013-12-17T06:31:44.000+0000",
        "updated": "2014-05-29T18:39:06.000+0000",
        "sampleJsonResponse": "condimentum curabitur",
        "name": "enim",
        "sampleXmlResponse": "sodales sed tincidunt eu"
    }
]

Request

curl -k 'https://api.mashery.com/v3/rest/packages/83cca97c-986b-468c-b277-525b633909a9/plans/9c0e6072-b6a8-4085-877b-e3fb1c71bc73/services/0fcc39d1c7ee470780e6cbe6/endpoints/0dd96770b82f4f248c4711d9/methods' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request POST --data '{"id":"a240d3ab-1967-45c3-966f-f2b779739b33","updated":"2014-03-28T22:56:15.000+0000","created":"2014-02-02T23:31:59.000+0000","name":"quam a"}

Response

[
    {
        "id": "5a93444d-ed2b-495a-a648-cfc0100cfb8a",
        "created": "2013-10-12T14:54:18.000+0000",
        "updated": "2014-06-24T11:20:20.000+0000",
        "name": "lectus suspendisse"
    }
]

update [PUT]

Updates the identified Plan Method.

Parameters

Parameter Required Type Description
methodId true string Method identifier.
planMethod true object Plan Method object

Returns

Success

Plan Method 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/packages/83cca97c-986b-468c-b277-525b633909a9/plans/9c0e6072-b6a8-4085-877b-e3fb1c71bc73/services/0fcc39d1c7ee470780e6cbe6/endpoints/0dd96770b82f4f248c4711d9/methods/9f42d173-42f8-4862-b3e8-826e9de55ecd' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request PUT --data '{"id":"c16710bc-cd32-4798-845e-6dfb99e03188","sampleJsonResponse":"in imperdiet et","updated":"2013-09-17T17:58:35.000+0000","created":"2014-03-09T16:07:20.000+0000","name":"potenti","sampleXmlResponse":"vestibulum eget vulputate"}

Response

[
    {
        "id": "3897ba9d-35c3-40fa-8410-2c1887addd0c",
        "created": "2014-04-22T10:26:07.000+0000",
        "updated": "2013-09-28T19:32:59.000+0000",
        "sampleJsonResponse": "fermentum",
        "name": "eget tempus vel pede",
        "sampleXmlResponse": "mauris"
    }
]

Request

curl -k 'https://api.mashery.com/v3/rest/packages/83cca97c-986b-468c-b277-525b633909a9/plans/9c0e6072-b6a8-4085-877b-e3fb1c71bc73/services/0fcc39d1c7ee470780e6cbe6/endpoints/0dd96770b82f4f248c4711d9/methods/9f42d173-42f8-4862-b3e8-826e9de55ecd' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request PUT --data '{"id":"a1c251be-4249-4f5a-ad79-8b46e47843f0","updated":"2013-08-23T02:58:33.000+0000","created":"2014-04-14T18:23:06.000+0000","name":"molestie hendrerit at"}

Response

[
    {
        "id": "95385ebd-17b2-4b3c-9c31-96cbd4ea2845",
        "created": "2013-09-25T22:01:28.000+0000",
        "updated": "2014-01-29T08:29:36.000+0000",
        "name": "sapien"
    }
]

delete [DELETE]

Deletes the identified Plan Method.

Parameters

Parameter Required Type Description
methodId true string Method identifier.

Returns

Success

Empty response

Failure

Array of validation responses

Examples

Request

curl -k 'https://api.mashery.com/v3/rest/packages/83cca97c-986b-468c-b277-525b633909a9/plans/9c0e6072-b6a8-4085-877b-e3fb1c71bc73/services/0fcc39d1c7ee470780e6cbe6/endpoints/0dd96770b82f4f248c4711d9/methods/9f42d173-42f8-4862-b3e8-826e9de55ecd' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request DELETE

Response

[
    ""
]

Request

curl -k 'https://api.mashery.com/v3/rest/packages/83cca97c-986b-468c-b277-525b633909a9/plans/9c0e6072-b6a8-4085-877b-e3fb1c71bc73/services/0fcc39d1c7ee470780e6cbe6/endpoints/0dd96770b82f4f248c4711d9/methods/9f42d173-42f8-4862-b3e8-826e9de55ecd' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request DELETE

Response

[
    ""
]

Docs Navigation