Create a User

You can use this API request to create a new user as if they had explicitly registered into the system through the GUI.

/services/v2/user

You can use the following parameters in your create a user request:

Body: you can use any field of the body parameter.
Other options: wrap

🚧

Permissions & Notes:

  • You must have the Create users permission under Site Administration Roles in the Advanced Editor.

  • You can specify the data describing the user you are posting, both in the body of the request, or as a request parameter, with the same names as the fields in the body.

    • When you send data in the body of the request, the format should match the URL extension, or the value of the site's HTTP request header content-type.
    • If you specify data values for the same field, both on the request body and as request or query parameters, the value of the parameters takes precedence over the value in the body.
  • Notice: The UserRequest data model includes a field for the user password; we consider using a secure connection to post this request to be a best practice. In this case, the request URL uses protocol prefix https, which indicates that a secured connection using a protocol such as SSL/TLS (based on an asymmetric-key cryptography) gets used to make the request.

  • We added this request in version 1.6.3.

Sample Request

A POST create a user request sent to https://apidocs.cloud.answerhub.com using a human-readable Username/Password (answerhub:test123) for a user named ("JonS") with a real name of ("Jon Smith"), a password (123454321), and an email ([email protected]) would look like this:

curl 
-u answerhub:test123 
-H "Accept: application/json" 
-H "Content-type: application/json" 
-X POST 
-d '{ "username":"JonS","realName":"Jon Smith","password":"123454321","email":"[email protected]"}' "https://apidocs.cloud.answerhub.com/services/v2/user" -v

Expected Response

Successful Response:

  • HTTP Status 201 - Created

Community User Interface Result

Jon S Profile Created
Note: Some information was added to the profile from the PUT "Update a User" request.

Language
Authentication
Basic
base64
:
Click Try It! to start a request and see the response here!