• Register

Services

Resource URI

/services/{serviceId}

Items in curly braces represent variables.

Description

Services define the technical integration points between the Mashery Traffic Manager and the back-end systems that a customer is hoping to put under API management. Ultimately, Services are groupings of Endpoint objects, which have the detailed specifics of the back-end systems and the technical specifications of how the Mashery Traffic Manager needs to connect and manage associated traffic.

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 Service Definitions belonging to the given Area

Parameters

Parameter Required Type Description
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 for /service and /packages APIs. For /members, /applications, /packageKeys, and /roles APIs, the offset field functions as a page index, where the first page is indexed as 0.

Returns

Success

Array of ServiceDefinitions for the Area 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' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" 

Response

[
    {
        "id": "8f1725af-33d3-42cc-969a-e62b7a743750",
        "revisionNumber": 62,
        "created": "2014-07-15T00:10:45.000+0000",
        "updated": "2014-02-11T03:15:05.000+0000",
        "robotsPolicy": "turpis enim blandit",
        "description": "sed ante vivamus tortor duis mattis egestas metus aenean fermentum",
        "name": "accumsan tellus",
        "crossdomainPolicy": "posuere felis sed",
        "qpsLimitOverall": 60,
        "editorHandle": "tempus",
        "rfc3986Encode": true,
        "version": 59.46
    }
]

Request

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

Response

[
    {
        "id": "9ae54ccd-0044-45b0-96b1-08e72474185a",
        "created": "2013-08-28T20:37:41.000+0000",
        "updated": "2014-07-16T09:51:46.000+0000",
        "name": "ipsum praesent blandit",
        "version": 71.22
    }
]

fetch [GET]

Retrieves the identified Service Definition.

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 for /service and /packages APIs. For /members, /applications, /packageKeys, and /roles APIs, the offset field functions as a page index, where the first page is indexed as 0.

Returns

Success

Array of ServiceDefinitions for the Area 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' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" 

Response

[
    {
        "id": "3c6f237b-9860-408d-8dcb-5409ace44301",
        "revisionNumber": 82,
        "created": "2013-12-26T22:06:26.000+0000",
        "updated": "2013-08-16T21:42:19.000+0000",
        "robotsPolicy": "sit",
        "description": "etiam justo etiam pretium iaculis justo in hac habitasse platea dictumst etiam faucibus cursus urna",
        "name": "in magna bibendum imperdiet",
        "crossdomainPolicy": "dolor",
        "qpsLimitOverall": 93,
        "editorHandle": "augue a",
        "rfc3986Encode": false,
        "version": 8.99
    }
]

Request

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

Response

[
    {
        "id": "35a3158b-72d4-4c03-ab3f-31ac957b1721",
        "created": "2013-11-21T08:29:23.000+0000",
        "updated": "2014-04-29T15:57:46.000+0000",
        "name": "adipiscing lorem vitae mattis",
        "version": 90.61
    }
]

create [POST]

Creates a new Service Definition in the given Area.

Parameters

Parameter Required Type Description
service true object ServiceDefinition object

Returns

Success

ServiceDefinition 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' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request POST --data '{"id":"11345f41-783e-4f64-804e-20730b51db62","revisionNumber":99,"updated":"2014-01-20T05:15:31.000+0000","created":"2013-10-27T05:08:26.000+0000","description":"vel accumsan tellus nisi eu orci mauris lacinia sapien quis libero nullam sit amet turpis elementum ligula vehicula consequat","robotsPolicy":"erat volutpat in","name":"ipsum aliquam non","qpsLimitOverall":39,"crossdomainPolicy":"nisl aenean lectus","editorHandle":"sed","rfc3986Encode":false,"version":0.66}

Response

[
    {
        "id": "a443967b-575b-46cd-b961-190483fe8ebc",
        "revisionNumber": 37,
        "created": "2013-11-06T08:08:35.000+0000",
        "updated": "2013-11-03T12:55:47.000+0000",
        "robotsPolicy": "id turpis",
        "description": "integer ac neque duis bibendum morbi non quam nec dui luctus",
        "name": "platea dictumst",
        "crossdomainPolicy": "lectus pellentesque at nulla",
        "qpsLimitOverall": 78,
        "editorHandle": "a nibh in",
        "rfc3986Encode": false,
        "version": 6.21
    }
]

Request

curl -k 'https://api.mashery.com/v3/rest/services' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request POST --data '{"id":"17c5dde7-98f2-48f3-bf1c-83c44a7140da","updated":"2014-04-14T11:37:07.000+0000","created":"2014-02-12T00:53:49.000+0000","name":"nam tristique","version":75.87}

Response

[
    {
        "id": "f214a0a9-fdc0-4914-9cc7-ee741205ccb5",
        "created": "2013-08-26T15:18:53.000+0000",
        "updated": "2013-08-02T10:59:48.000+0000",
        "name": "eros elementum pellentesque",
        "version": 98.93
    }
]

update [PUT]

Updates the identified Service Definition.

Parameters

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

Returns

Success

ServiceDefinition 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' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request PUT --data '{"id":"ffc60063-c74a-407e-9927-cdd849aa8383","revisionNumber":81,"updated":"2013-10-07T06:04:39.000+0000","created":"2013-11-13T22:34:18.000+0000","description":"vulputate luctus cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus","robotsPolicy":"nulla facilisi","name":"congue","qpsLimitOverall":84,"crossdomainPolicy":"tincidunt eget tempus vel","editorHandle":"ac","rfc3986Encode":false,"version":65.23}

Response

[
    {
        "id": "70b8ba5e-d8b9-416c-adcb-75b1261f3671",
        "revisionNumber": 6,
        "created": "2013-10-17T17:39:00.000+0000",
        "updated": "2014-01-08T18:26:04.000+0000",
        "robotsPolicy": "lacus morbi sem",
        "description": "a suscipit nulla elit ac nulla sed vel enim sit amet",
        "name": "nam ultrices libero non",
        "crossdomainPolicy": "luctus nec molestie sed",
        "qpsLimitOverall": 86,
        "editorHandle": "in faucibus",
        "rfc3986Encode": false,
        "version": 14.66
    }
]

Request

curl -k 'https://api.mashery.com/v3/rest/services/0fcc39d1c7ee470780e6cbe6' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request PUT --data '{"id":"342c144d-8d2e-44dc-8370-3e1248c97b9c","updated":"2014-02-27T00:45:03.000+0000","created":"2014-01-05T13:45:08.000+0000","name":"suspendisse","version":42.61}

Response

[
    {
        "id": "ec1f284d-1d4a-4121-9347-8e2e38c04ee6",
        "created": "2013-09-24T14:54:44.000+0000",
        "updated": "2013-11-09T04:09:08.000+0000",
        "name": "sagittis dui vel nisl",
        "version": 65.15
    }
]

delete [DELETE]

Deletes the identified Service Definition.

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/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/services/0fcc39d1c7ee470780e6cbe6' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request DELETE

Response

[
    ""
]

Docs Navigation