PUT /api/users/{UserID}/settings

Changes a user's account settings such as email notification preferences.

Note: If the platform business security settings are set so that a user cannot modify his/her email address, the authorized user cannot update the email address in the user interface or by running this operation. In that scenario, only the Site Admin can modify the user's email address. Business security settings are controlled using the PUT /api/businesses/{BusinessID}/securitysettings operation.

Authorization Roles/Permissions: Must be logged in. Self (logged in) or Site Admin (for any user).

This topic includes the following sections:

HTTP Method

PUT

URL

https://{hostname}/api/users/{UserID}/settings

Sample Request

The example below sends some changes the user has made to notifications preferences. The user has opted out of one of the notifications groups, so it is omitted from the request object.

Sample Request URL

https://{hostname}/api/users/522320b9-cb6b-495d-ae07-e4b3bfdb3f6a.acmepaymentscorp/settings

Sample request headers

PUT /api/users/522320b9-cb6b-495d-ae07-e4b3bfdb3f6a.acmepaymentscorp/settings HTTP/1.1
Host: {hostname}
Accept: text/plain, */*; q=0.01
Content-Type: application/json; charset=UTF-8

Sample request body

{
  "UserID":"45742f96-aad2-45d8-b507-420cf07c87ff.acmepaymentscorp",
  "Email":"janesaoirse@acmepaymentscorp.com",
  "OptedNotification":[
    "com.soa.notification.type.ticket.change",
    "com.soa.notification.type.app.alert",
    "com.soa.notification.type.post.comment",
    "com.soa.notification.type.contract.state.change",
    "com.soa.notification.type.appteam",
    "com.soa.notification.type.app.lifecycle",
    "com.soa.notification.type.news.update",
    "com.soa.notification.type.app.post"
  ]
}

Request Headers

For general information on request header values, refer to HTTP Request Headers.

Header Description
Accept Any value that matches text/plain is valid; for example, */*.
Content-Type

Any one of the following media types is valid for the request Content-Type:

application/json, application/vnd.soa.v71+json, application/vnd.soa.v72+json, application/vnd.soa.v80+json, application/vnd.soa.v81+json

Cookie AtmoAuthToken_{fedmemberid}={cookie value, which usually starts with TokenID}—The platform cookie. This is the Akana API Platform authorization token, and must be sent with every API request that requires login. For more information and an example, see Session cookies.
X-Csrf-Token_{fedmemberID} The CSRF prevention header; may or may not be required, depending on platform settings. See CSRF Prevention on the Platform. By default, the CSRF header is not required for GET operations and is required for all others, with a few exceptions relating to user login.

Request Parameters

Parameter Parm Type Data Type Required Description
UserID Path string Required The unique ID for a specific user.
AccountSettings Body AccountSettings Required Information about the user's account settings (user preferences). The full list of user preferences is listed in Notification Group Values and shown in the response object for the GET /api/users/{UserID}/settings operation. To opt out of a notifications group, simply omit it from the request object.

Response

If successful, this operation returns HTTP status code 200, with the UserID in the response body.

Sample Response

The sample response below returns the user ID as confirmation that the call was successful.

Sample response headers

Status Code: 200 OK
Content-Type: text/plain
Date: Thu, 16 Oct 2014 17:36:13 GMT

Sample response body

522320b9-cb6b-495d-ae07-e4b3bfdb3f6a.acmepaymentscorp

Response Headers

For general information on response header values, refer to HTTP Response Headers.

Header Description
Content-Type text/plain

Response Body

Name Type Description
UserID string The unique ID for a specific user.

Error Codes/Messages

If the call is unsuccessful an error code/message is returned. One or more examples of possible errors for this operation are shown below.

Item Value
401

Unauthorized. For example, you would get this response if you didn't include the custom X-Csrf-Token_{fedmemberID} header in the request, when it was required by the platform settings; or if you included an invalid or expired value for this header. You would also get this response for any operation that requires login (almost all) if the login cookie was missing.

You would also get this response if you are not the authorized user or a Site Admin.

500 An error occurred processing the call.

More information about Akana API Platform API error messages.