• Register

Plan Services

Resource URI

/packages/{packageId}/plans/{planId}/services/{serviceId}

Items in curly braces represent variables.

Description

A plan service represents the relationship between a plan and a service definition. It is created when a service definition is included in a plan.

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 (Service Definition UUID).
name Type string
Sub-type
Create Rule Required
Update Rule Optional
Fetch Rule Implicit
Description Service Definition 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 last updated.
endpoints Type array
Sub-type Endpoint
Create Rule Optional
Update Rule Optional
Fetch Rule Explicit
Description Endpoints that belong to the Service.
editorHandle Type string
Sub-type
Create Rule Ignored
Update Rule Ignored
Fetch Rule Explicit
Description Identifier (handle) of the user that last modified the Service.
revisionNumber Type integer
Sub-type
Create Rule Ignored
Update Rule Ignored
Fetch Rule Explicit
Description Current Service revision number automatically incremented after every modification.
robotsPolicy Type string
Sub-type
Create Rule Ignored
Update Rule Ignored
Fetch Rule Explicit
Description Robots policy
crossdomainPolicy Type string
Sub-type
Create Rule Ignored
Update Rule Ignored
Fetch Rule Explicit
Description Crossdomain policy
description Type string
Sub-type
Create Rule Optional
Update Rule Optional
Fetch Rule Explicit
Description Description of the API. This is used for administration purposes only and is not displayed in the developer portal.
errorSets Type array
Sub-type ErrorSet
Create Rule Optional
Update Rule Optional
Fetch Rule Explicit
Description Array of Error Set objects.
qpsLimitOverall Type integer
Sub-type
Create Rule Optional
Update Rule Optional
Fetch Rule Explicit
Description Overall queries/calls per second that the API will support, regardless of number of developer keys.
rfc3986Encode Type boolean
Sub-type
Create Rule Optional
Update Rule Optional
Fetch Rule Explicit
Description By default, RFC 1738 specification is used by Mashery. You can enable the RFC 3986 specification for more flexible URLs.
securityProfile Type object
Sub-type SecurityProfile
Create Rule Optional
Update Rule Optional
Fetch Rule Explicit
Description Security Profile object, used to manage OAuth 2.0 properties of the API.
version Type string
Sub-type
Create Rule Optional
Update Rule Optional
Fetch Rule Implicit
Description Simple metadata to assist in the tracking of different versions of the API. This is a customer-managed property in that the version is not modified as property changes are made to the API definition.

fetch all [GET]

Retrieves collection of Plan Services belonging to the given Plan.

Parameters

Parameter Required Type Description
packageId true string Package identifier.
planId true string Plan 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 Services for the Plan 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' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" 

Response

[
    {
        "id": "09f2f3da-7669-4ce0-baf3-6f8454efe8be",
        "revisionNumber": 1,
        "created": "2013-12-29T23:39:23.000+0000",
        "updated": "2014-01-09T09:58:15.000+0000",
        "robotsPolicy": "pede ac diam",
        "description": "duis mattis egestas metus aenean fermentum donec ut mauris eget massa tempor convallis nulla neque libero convallis",
        "name": "platea dictumst",
        "crossdomainPolicy": "libero",
        "qpsLimitOverall": 55,
        "editorHandle": "quis odio consequat",
        "rfc3986Encode": false,
        "version": 49.22
    }
]

Request

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

Response

[
    {
        "id": "28443312-a292-4da7-8ab3-516e2d227e5c",
        "created": "2014-01-04T02:45:02.000+0000",
        "updated": "2014-04-17T23:30:14.000+0000",
        "name": "luctus",
        "version": 12.99
    }
]

fetch [GET]

Retrieves the Plan Service, returning a Plan Service

Parameters

Parameter Required Type Description
packageId true string Package identifier.
planId true string Plan identifier.
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.
indent false boolean When set to true, responses are indented for better readability.

Returns

Success

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

Response

[
    {
        "id": "3f75e870-cdd4-49ab-b100-dc8d7a05ecf0",
        "revisionNumber": 0,
        "created": "2013-08-30T07:21:42.000+0000",
        "updated": "2013-12-13T02:39:27.000+0000",
        "robotsPolicy": "congue",
        "description": "quisque id justo sit amet sapien dignissim vestibulum vestibulum ante ipsum primis in faucibus orci luctus",
        "name": "primis in faucibus orci",
        "crossdomainPolicy": "id",
        "qpsLimitOverall": 27,
        "editorHandle": "metus",
        "rfc3986Encode": false,
        "version": 45.3
    }
]

Request

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

Response

[
    {
        "id": "2f5542ff-3662-4711-9e8a-4237438cd977",
        "created": "2013-08-02T16:26:53.000+0000",
        "updated": "2014-03-12T10:35:27.000+0000",
        "name": "ac leo pellentesque",
        "version": 75.96
    }
]

create [POST]

Creates a new Plan Service in the given Plan.

Parameters

Parameter Required Type Description
packageId true string Package identifier.
planId true string Plan identifier.
service true object ServiceDefinition object

Returns

Success

Plan Service 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' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request POST --data '{"id":"56d9247a-b008-4843-b2fc-1f1ddba0fbd2","revisionNumber":100,"updated":"2014-03-01T09:40:02.000+0000","created":"2013-11-09T21:12:51.000+0000","description":"potenti nullam porttitor lacus at turpis donec posuere metus vitae ipsum aliquam non mauris","robotsPolicy":"nec condimentum","name":"pulvinar sed nisl","qpsLimitOverall":67,"crossdomainPolicy":"lobortis ligula","editorHandle":"vestibulum","rfc3986Encode":false,"version":12.9}

Response

[
    {
        "id": "d3996f48-0b45-49aa-9f3d-ec02aa398a0e",
        "revisionNumber": 12,
        "created": "2013-11-18T16:49:22.000+0000",
        "updated": "2014-07-02T11:21:13.000+0000",
        "robotsPolicy": "integer tincidunt ante vel",
        "description": "erat vestibulum sed magna at nunc commodo placerat praesent blandit nam nulla",
        "name": "vel dapibus at",
        "crossdomainPolicy": "nulla ac",
        "qpsLimitOverall": 67,
        "editorHandle": "nulla sed vel enim",
        "rfc3986Encode": true,
        "version": 85.34
    }
]

Request

curl -k 'https://api.mashery.com/v3/rest/packages/83cca97c-986b-468c-b277-525b633909a9/plans/9c0e6072-b6a8-4085-877b-e3fb1c71bc73/services' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request POST --data '{"id":"bc0581dc-71ac-48a6-829a-874744383e36","updated":"2014-07-06T10:25:13.000+0000","created":"2013-10-19T01:09:31.000+0000","name":"nisi","version":6.47}

Response

[
    {
        "id": "18b7956e-fe79-4235-b109-435be6ba733e",
        "created": "2013-10-17T16:40:59.000+0000",
        "updated": "2013-10-15T14:01:45.000+0000",
        "name": "nonummy maecenas tincidunt lacus",
        "version": 27.21
    }
]

update [PUT]

Updates the identified Plan Service.

Parameters

Parameter Required Type Description
serviceId true string Service identifier.
service true object ServiceDefinition object

Returns

Success

Plan Service 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' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request PUT --data '{"id":"8034d56b-49b4-47c2-91ea-cc11065c02e1","revisionNumber":21,"updated":"2013-10-01T05:58:19.000+0000","created":"2014-06-21T02:10:01.000+0000","description":"felis donec semper sapien a libero nam dui proin leo odio porttitor","robotsPolicy":"nibh in quis justo","name":"est congue elementum","qpsLimitOverall":51,"crossdomainPolicy":"ut","editorHandle":"integer non velit donec","rfc3986Encode":true,"version":72.12}

Response

[
    {
        "id": "531e933d-fb84-411f-80f2-8fa3f8d5a127",
        "revisionNumber": 75,
        "created": "2014-02-27T18:14:37.000+0000",
        "updated": "2013-11-16T18:39:48.000+0000",
        "robotsPolicy": "molestie",
        "description": "feugiat et eros vestibulum ac est lacinia nisi venenatis tristique",
        "name": "mi nulla ac enim",
        "crossdomainPolicy": "nam congue risus",
        "qpsLimitOverall": 74,
        "editorHandle": "aenean",
        "rfc3986Encode": true,
        "version": 19.91
    }
]

Request

curl -k 'https://api.mashery.com/v3/rest/packages/83cca97c-986b-468c-b277-525b633909a9/plans/9c0e6072-b6a8-4085-877b-e3fb1c71bc73/services/0fcc39d1c7ee470780e6cbe6' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request PUT --data '{"id":"ab944e97-5d81-49f1-9da7-0fd00985eea0","updated":"2013-10-29T12:48:39.000+0000","created":"2014-06-12T07:03:12.000+0000","name":"mauris","version":86.49}

Response

[
    {
        "id": "6e129040-797e-4d59-9eb1-28cca7363eea",
        "created": "2014-03-23T11:03:10.000+0000",
        "updated": "2013-12-22T17:40:19.000+0000",
        "name": "pulvinar sed nisl nunc",
        "version": 9.54
    }
]

delete [DELETE]

Deletes the identified Plan Service.

Parameters

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

Response

[
    ""
]

Docs Navigation