HTTP Verb: PUT

Available statuses: 204 No Content, 404 Not Found, 422 Unprocessable Entity

Object: UserRole

Location: n/a

Formats: XML, JSON

Update a user role by id.

Params

To update a user role, a data body must be provided. Data can be provided in three formats: XML, JSON and query string. To specify data type of XML or JSON add the Content-type: application/(json|xml) header to request headers, if you want to provide query string simply skip the Content-type header.

All params should be sent in the user_role namespace, e.g.:

XML

<user_role>
  <role>owner</role>
  ...
</user_role>

JSON

{"user_role":{"role":"owner"...}}

Query string

user_role[role]=owner&...

Check the full list of available params on user role object fields reference

Examples

Request XML, using cURL utility:

curl -i -H "Authorization: Bearer _token" -X PUT -d "user_role[role]=owner" https://api.assembla.com/v1/spaces/_space_id/user_roles/_id.xml

Response:

HTTP/1.1 204 No Content
Server: nginx/0.8.55
Date: Mon, 10 Sep 2012 12:41:10 GMT
Content-Type: application/xml; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 204

Request JSON, using cURL utility:

curl -i -H "Authorization: Bearer _token" -X PUT -d "user_role[role]=owner" https://api.assembla.com/v1/spaces/_space_id/user_roles/_id.json

Response:

HTTP/1.1 204 No Content
Server: nginx/0.8.55
Date: Mon, 10 Sep 2012 12:41:53 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 204

Description for each field: user role object fields reference