Addrole

Add a role to an application.

The account and customer for this role will be taken from the current request and an actor can only assign roles for which it has all tokens in that account/customer.

Tokens

This action requires the following tokens:

  • application-write

Arguments

Required arguments are marked in bold, and optional arguments are marked in italics.

Argument Type Default Description
application Hash   The ID of the application to add a role to
role Hash   The role to add
customer Hash   The customer to add the role in. Cannot be given if an account is given. If neither a customer nor an account is given, they will be copied from the request parameters.
account Hash   The account to add the role in. Cannot be given if a customer is given. If neither a customer nor an account is given, they will be copied from the request parameters.

Output

This action produces the following output on success:

An array containing zero or more elements, each one being an object containing the following fields:

Name Type Description
role

Role belonging to this role

The value of this field is an object containing the following fields:

Name Type Description
id Hash Role ID
name String The name of this role
customer

The customer of this role, if any

The value of this field is an object containing the following fields:

Name Type Description
id Hash Customer ID
name String The name of this customer
datecreated DateTime When this customer was created
datemodified DateTime When this customer was last modified
tokens

Tokens for this role

The value of this field is an array containing zero or more elements, each one being one Label

account

Account belonging to this role

The value of this field is an object containing the following fields:

Name Type Description
id Hash Account ID
name String Account name
customer

Customer belonging to this role

The value of this field is an object containing the following fields:

Name Type Description
id Hash Customer ID
name String The name of this customer
datecreated DateTime When this customer was created
datemodified DateTime When this customer was last modified

Errors

This action can return one of the default status codes, or one of the following status codes on error:

STATUS_APPLICATION_NOT_FOUND (260)
If the application specified by “ID” can not be found
STATUS_ROLE_NOT_FOUND (270)
If the role specified by “role” can not be found
STATUS_APPLICATION_NOT_PERMITTED (261)
If the current actor does not have permission to assign this role
STATUS_APPLICATION_ROLE_ALREADY_ASSIGNED (262)
The requested role is already assigned to the application