• Register

role.update

Description

update a single role object.  Please see Updating Objects for an overview of how the update method works.

Parameters

role

An role object, as described by the object.describe call.  If a field in the role object is ommitted, no change will be made to that field.  If extra fields are passed, they will be ignored.  The primary identifier must be specified.

Response

An role object, as described by the object.describe call.  This is actual role that was updated.

Examples

This example updates the status of the role created in the role.create example to be active without requiring confirmation.

A Sample JSON-RPC Role Update Request

{
    "method": "role.update",
    "params": [
        {
            "id": 378,
            "description": "This is an example role"
        }
    ],
    "id": 1
}

The JSON-RPC Response

{
    "result": {
        "id": 378,
        "created": "2009-12-02T23:46:49Z",
        "updated": "2009-12-02T23:50:14Z",
        "name": "example_role_name",
        "description": "This is an example role",
        "is_assignable": true,
        "is_predefined": false,
        "object_type": "role"
    },
    "error": null,
    "id": 1
}

Permissions Required

The user who owns the key used to authenticate the role.update call must be a member of one of the following roles

  • Administrator
  • Program Manager
  • Community Manager

See authentication.

Errors

In addition to the standard json-rpc errors and authentication errors, role.update may also return these errors:

HTTP Status Code JSON-RPC Code Error Message Description
400 1000 Invalid Object The object could not be updated because the object would be invalid.  See Validating Objects for details on the format of this error.
??? 1001 Duplicate Object The object could not be updated because a change would cause it to conflict with a different object that already exists.
400 1002 Field "x" is required. The object could not be updated because a primary identifier was not passed to enable finding the object to update.
??? 2002 Update Failed The object could not be updated.  This is the error message of last resort for object updates and usually indicates a systems integration failure, invalid internal data, or a transient issue.  These errors are logged by Mashery.
400 4100 Cannot modify predefined roles Mashery defined roles cannot be changed.
400 5000 Object "type" with "key" of "value" could not be found The object could not be updated because it could not be found.

Docs Navigation