PUT /api/users/{UserID}

Modifies information about a platform user.

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: Self (logged in) or Site Admin (for any user).

This topic includes the following sections:

HTTP Method

PUT

Back to top

URL

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

Back to top

Sample Request

The example below shows a request to update the information for the specified user.

Request URL

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

Sample request headers #1

PUT /api/users/6a686072-b9fa-434f-8b22-4b2a47b07d59.acmepaymentscorp HTTP/1.1
Host: {hostname}
Accept: text/plain
Content-Type: application/json
X-Csrf-Token_{tenant}: {TokenID}

Sample request body #1

Security challenges and phone numbers are in place. Request modifies the user's email address and phone number.

{
  "UserID" : "6a686072-b9fa-434f-8b22-4b2a47b07d59.acmepaymentscorp",
  "UserName" : "MargaretMartinson",
  "FirstName" : "Margaret",
  "LastName" : "Martinson",
  "AuthIdentifier" : "",
  "Visibility" : "0",
  "Email" : "margaret.martinson@example.com",
  "Title" : "",
  "Industry" : "",
  "Language" : [ ],
  "Technology" : [ ],
  "Favorites" : "",
  "AvatarProvider" : "com.soa.imageprovider.type.default",
  "HasPicture" : false,
  "State" : "pending_validation",
  "AvatarURL" : "http://acmepaymentscorp.com/api/users/6a686072-b9fa-434f-8b22-4b2a47b07d59.acmepaymentscorp/avatar",
  "Domain" : "Local Domain",
  "Disabled" : true,
  "ProfileName" : "MargaretMartinson",
  "UserIdentificationChallenges" : {
    "UserIdentificationChallenge" : [ {
      "UserID" : "6a686072-b9fa-434f-8b22-4b2a47b07d59.acmepaymentscorp",
      "ChallengeCode" : "com.soa.challenge.question.city.birth",
      "ChallengeQuestion" : "What is the city of your birth?"
    }, {
      "UserID" : "6a686072-b9fa-434f-8b22-4b2a47b07d59.acmepaymentscorp",
      "ChallengeCode" : "com.soa.challenge.question.color",
      "ChallengeQuestion" : "What is your favorite color?"
    }, {
      "UserID" : "6a686072-b9fa-434f-8b22-4b2a47b07d59.acmepaymentscorp",
      "ChallengeCode" : "com.soa.challenge.question.pet",
      "ChallengeQuestion" : "What is the name of your pet?"
    } ]
  },
  "LoginDomainID" : "siteusers.acmepaymentscorp",
  "ForcePasswordChangeOnLogin" : false,
  "Locked" : false,
  "UserPhones" : {
    "UserPhone" : [ {
      "CountryCode" : "+1",
      "PhoneNumber" : "8180000000",
      "Verified" : false,
      "Primary" : false
    } ]
  }
}

Sample request headers #2

PUT /api/users/522320b9-cb6b-495d-ae07-e4b3bfdb3f6a.acmepaymentscorp HTTP/1.1
Host: {hostname}
Accept: text/plain
Content-Type: application/json
X-Csrf-Token_{tenant}: {TokenID}

Sample request body #2: Site Admin modifies firstname and profile name.

{
  "FirstName":"John",
  "LastName":"Swift",
  "ProfileName":"JohnSwift",
  "Email":"jswift@acmepaymentscorp.com"
}

Sample request body #3: : Site Admin extends the expiration date on a new account.

{
  "UserID" : "1025e376-e3dd-442c-9601-7c14e13f9d75.acmepaymentscorp",
  "UserName" : "JaneMead",
  "FirstName" : "Jane",
  "LastName" : "Mead",
  "AuthIdentifier" : "",
  "Visibility" : "0",
  "Email" : "janemead@acmepaymentscorp.com",
  "Title" : "",
  "Industry" : "",
  "Language" : [ ],
  "Technology" : [ ],
  "Favorites" : "",
  "AvatarProvider" : "com.soa.imageprovider.type.default",
  "HasPicture" : false,
  "State" : "registered",
  "AvatarURL" : "http://{hostname}/api/users/1025e376-e3dd-442c-9601-7c14e13f9d75.acmepaymentscorp/avatar",
  "Domain" : "Local Domain",
  "Disabled" : false,
  "ProfileName" : "JaneMead",
  "LoginDomainID" : "siteusers.acmepaymentscorp",
  "ForcePasswordChangeOnLogin" : true,
  "Locked" : false,
  "ExpirationDate" : "2016-05-11T01:39:03Z"
}

Back to top

Request Headers

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

Header Description
Accept text/plain
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

X-Csrf-Token_{fedmemberID} The CSRF prevention header; may or may not be required, depending on platform settings. See CSRF Prevention on the Platform.

Back to top

Request Parameters

Parameter Parm Type Data Type Required Description
UserID Path string Required The unique ID for a specific user.
User Body User Required

Contains information about a platform user.

The sent object includes the information that's being modified.

Back to top

Response

If successful, this operation returns HTTP status code 200, with the user ID in the response.

Back to top

Sample Response

The sample response below shows that the user information was successfully modified.

Sample response headers

HTTP/1.1 200 OK
Content-Type: text/plain
Date: Fri, 25 Sep 2015 15:13:08 GMT

Sample response body

0601df93-aeb6-44be-ab0e-d6ed694a5aa8.acmepaymentscorp

Back to top

Response Headers

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

Header Description
Content-Type text/plain

Back to top

Response Body

Name Type Description
UserID string The UserID of the user whose information has been modified.

Back to top

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
400 Bad request: Returned if the client sends invalid parameters or body content. For example, you might get this response if you did not specify the content-type for the request, specified an incorrect content-type, or did not have the correct information in the request body.
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.
405 Method Not Allowed. For example, you might get this if you specified an invalid Accept header or omitted a required Content-Type header.
500 An error occurred processing the call.

More information about Akana API Platform API error messages.

Back to top

Related Topics