developer.setLimits

This section provides documentation on the v1.0 version of the Mashery API.  We will support previously built applications and integration points, but not granting new access keys.  These pages are for legacy support purposes.  Should you wish to integrate with your Mashery instance, please utilize Mashery API version 2.0.

Description

Sets/updates limitations for the specified developer.

Authentication

This method requires authentication

Parameters Type Description Required
spkey string Service Provider key assigned by Mashery Yes
email string
Select the developer by email address. Either this value or an API key must be defined. Yes
apikey string Select the developer by API key. Either this value or an email address must be defined. Yes
callsPerSecondExempt boolean Whether or not this developer is except from Calls Per Second limitations. Yes
callsPerSecond int Number of calls to the API this developer is allowed to make per second. Yes
callsPerPeriodExempt boolean Whether or not this developer is exempt from Calls Per Period, where Period is a window of time, such as day or hour. The period of time itself is defined by the Service Definition associated with the Service Provider key. Yes
callsPerPeriod int Number of calls the developer is allowed to make Per Period, where Period is a window of time, such as day or hour. The period of time itself is defined by the Service Definition associated with the Service Provider key. Yes
permittedMethods object Methods the developer is allowed to call. Each item in the object should be defined with a methodName key with corresponding value that is an object with limit and period properties defined. Yes
permittedPaths array Paths the developer is allowed to call. Primarily useful for a RESTful or Query-style API. Yes
permittedHttpMethods array HTTP methods the developer is allowed to use when calling the API. Primarily useful for RESTful APIs. Yes
requiredReferers array If an HTTP Referer header is required to access the API, the list of acceptable referers can be controlled with this parameter. Yes

Response

array — Information on limits for this developer, reflecting the updated state.

Examples

A JSON-RPC Request

{
      "method": "developer.setLimits",
      "params": [{
            "spkey": "nzqz4xehpczjrgrjpgbwnskq",
            "where": {
                  "email": "johnqpublic@example.com"
            }
            "limits": {
                  "callsPerPeriod": 10000
      }],
      "id": 11
}

A JSON-RPC Response

{
      "result": {
            "callsPerPeriod": 10000,
            "callsPerPeriodExempt": false,
            "callsPerSecond": 5,
            "callsPerSecondExempt": false,
            "permittedMethods": {
                  "readStuff": {
                        "period": "day"
                         "limit": 5000
                  },
                  "writeStuff": {
                        "period": "day"
                        "limit": 500
                  }
            },
            "permittedPaths": [],
            "permittedHttpMethods": [],
            "requiredReferers": []
            "current": []
      },
      "error": null,
      "id": 11
}

Errors

This method may return one of the following errors:

Error Description
4102: Insufficient Privileges You do not have sufficient privileges to call this method.
400: Bad Request Your request was incomplete or otherwise invalid. Please review the documentation.
450: Spkey Not In Area The service requested does not exist in the area specified.
12: Validation Failed One or more values presented were not acceptable. Please review the documentation.
4006: Developer Invalid Where The 'where' property of your request was incomplete. The properties 'email' and/or 'apikey' must be specified to perform this operation.
4007: Developer Invalid Where Unable to find a developer matching the selection criteria.
4008: Update Developer Failed Could not update developer record.

Docs Navigation