PackageKeys

Resource URI

/packageKeys

Items in curly braces represent variables.

Description

Package Keys control access to API resources. They are owned by developers and can have limits and other entitlement rules set against them.

You cannot move a given package key from one API Package to another API Package.  You can only move the package key from one API Plan to another API Plan within a given API Package.

Helpful Hint: If you need to switch a given Package Key to a different API Package, you will need to delete the original Package Key and re-create that key value as a Package Key in the desired API Package.

 

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 (Key UUID).
apikey Type string
Sub-type
Create Rule Optional
Update Rule Ignored
Fetch Rule Implicit
Description Application name.
secret Type string
Sub-type
Create Rule Required
Update Rule Optional
Fetch Rule Implicit
Description Application 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.
rateLimitCeiling Type integer
Sub-type
Create Rule Optional
Update Rule Optional
Fetch Rule Implicit
Description Maximum number of API calls that can be made against the method for a given developer key in a specified period up to the maximum number set overall for the Plan.
rateLimitExempt Type boolean
Sub-type
Create Rule Optional
Update Rule Optional
Fetch Rule Implicit
Description Set to true results in unlimited number of API calls that can be made against the method for a given developer key in a specified period up to the maximum number set overall for the Plan.
qpsLimitCeiling Type integer
Sub-type
Create Rule Optional
Update Rule Optional
Fetch Rule Implicit
Description Maximum number of calls handled per second (QPS) per developer key for the Method.
qpsLimitExempt Type boolean
Sub-type
Create Rule Optional
Update Rule Optional
Fetch Rule Implicit
Description Set to true results in unlimited number of API calls that can be made against the method for a given developer key in a specified period up to the maximum number set overall for the Plan.
status Type string
Sub-type
Create Rule Optional
Update Rule Optional
Fetch Rule Implicit
Description Application name.
limits Type array
Sub-type Limit
Create Rule Ignore
Update Rule Ignore
Fetch Rule Explicit
Description Limit details associated with key
package Type object
Sub-type Package
Create Rule Required
Update Rule Ignored
Fetch Rule Implicit
Description Contains OAuth 2.0 settings for the API
plan Type object
Sub-type Plan
Create Rule Required
Update Rule Optional
Fetch Rule Implicit
Description Contains OAuth 2.0 settings for the API

fetch all [GET]

Retrieves collection of Package Keys 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 Roles 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/packageKeys' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" 

Response

[
    {
        "apikey": "non",
        "created": "2015-08-18T04:56:44.000+0000",
        "id": "f710db59-b760-45ff-94a8-8bb59f0bbb35",
        "qpsLimitCeiling": 91,
        "qpsLimitExempt": false,
        "rateLimitCeiling": 76,
        "rateLimitExempt": true,
        "secret": "in lectus",
        "status": "posuere cubilia curae",
        "updated": "2015-08-16T23:34:53.000+0000"
    }
]

Request

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

Response

[
    {
        "apikey": "massa volutpat",
        "created": "2015-04-03T21:58:17.000+0000",
        "id": "64f38781-acbd-44e7-9b17-edc5ab92f50e",
        "qpsLimitCeiling": 44,
        "qpsLimitExempt": true,
        "rateLimitCeiling": 47,
        "rateLimitExempt": false,
        "secret": "odio",
        "status": "suscipit nulla elit ac",
        "updated": "2015-11-13T00:42:19.000+0000"
    }
]

fetch [GET]

Retrieves the identified Package Key.

Parameters

Parameter Required Type Description
packageKeyId true string Key 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/packageKeys/{packageKeyId}' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" 

Response

[
    {
        "apikey": "elementum",
        "created": "2015-07-09T15:16:18.000+0000",
        "id": "8882ec03-bb23-4471-8d10-f4eb5a1db3b8",
        "qpsLimitCeiling": 25,
        "qpsLimitExempt": true,
        "rateLimitCeiling": 65,
        "rateLimitExempt": false,
        "secret": "justo",
        "status": "eu interdum eu",
        "updated": "2015-01-10T00:12:38.000+0000"
    }
]

Request

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

Response

[
    {
        "apikey": "praesent blandit lacinia",
        "created": "2015-07-22T19:21:31.000+0000",
        "id": "28ba68fb-157c-4aeb-a8a8-5145f5015dea",
        "qpsLimitCeiling": 89,
        "qpsLimitExempt": false,
        "rateLimitCeiling": 39,
        "rateLimitExempt": false,
        "secret": "integer ac neque",
        "status": "metus arcu",
        "updated": "2015-05-06T10:06:18.000+0000"
    }
]

update [PUT]

Updates the identified Package Key.

Parameters

Parameter Required Type Description
packageKeyId true string Key identifier.
packageKey true object PackageKey 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/packageKeys/{packageKeyId}' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request PUT --data '{"apikey":"ut","created":"2015-07-04T14:03:46.000+0000","id":"1235d7e5-db88-46f6-8239-13fbab7d6b83","qpsLimitCeiling":45,"qpsLimitExempt":false,"rateLimitCeiling":42,"rateLimitExempt":true,"secret":"curae duis faucibus","status":"vulputate elementum nullam varius","updated":"2015-11-22T05:33:25.000+0000"}

Response

[
    {
        "apikey": "in faucibus orci luctus",
        "created": "2015-07-11T23:46:56.000+0000",
        "id": "66055627-093c-4434-9534-f5fc98822be3",
        "qpsLimitCeiling": 91,
        "qpsLimitExempt": true,
        "rateLimitCeiling": 20,
        "rateLimitExempt": true,
        "secret": "at turpis donec",
        "status": "lobortis vel dapibus",
        "updated": "2015-06-14T12:15:31.000+0000"
    }
]

Request

curl -k 'https://api.mashery.com/v3/rest/packageKeys/{packageKeyId}' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request PUT --data '{"apikey":"vestibulum ante ipsum","created":"2015-03-18T11:48:07.000+0000","id":"4104aad0-1737-401c-b223-7540f026a1b3","qpsLimitCeiling":3,"qpsLimitExempt":true,"rateLimitCeiling":37,"rateLimitExempt":true,"secret":"molestie lorem","status":"curae nulla","updated":"2015-10-25T23:42:12.000+0000"}

Response

[
    {
        "apikey": "eget rutrum at",
        "created": "2015-09-01T08:26:32.000+0000",
        "id": "d18d98d7-35d4-41ed-9de1-723e2ca141e9",
        "qpsLimitCeiling": 38,
        "qpsLimitExempt": false,
        "rateLimitCeiling": 15,
        "rateLimitExempt": false,
        "secret": "elit sodales scelerisque mauris",
        "status": "ante",
        "updated": "2015-02-02T20:23:31.000+0000"
    }
]

delete [DELETE]

Deletes the identified Package Key.

Parameters

Parameter Required Type Description
packageKeyId true string Key identifier.

Returns

Success

Empty response

Failure

Array of validation responses

Examples

Request

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

Response

[
    ""
]

Request

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

Response

[
    ""
]

Docs Navigation