XP-Dev.com Documentation

Users API

This user guide only applies if your account and project is on our new platform, i.e. if your project's URL begins with https://<your-account>.xp-dev.com rather than https://xp-dev.com. If your account is on our old platform, you should be using this user guide instead.

Each User Object has the following attributes:

Attribute Description
id User’s unique ID
Username User’s unique username
email User’s email address
timezone User’s timezone
userRole The role that this user has on the main account - one of User, Administrator or Owner (this is case sensitive)

Get Current User

GET request to https://<your-account>.xp-dev.com/api/v1/user:

curl https://<your-account>.xp-dev.com/api/v1/user

Response will be a single User object:

{
  "id": 1,
  "username": "reader",
  "timezone": "Europe/London",
  "email": "admin@xp-dev.com",
  "userRole": "Owner"
}

Create a new User

POST request to https://<your-account>.xp-dev.com/api/v1/user with the following attributes:

Mandatory:

  • username
  • email
  • password
  • userRole

For example:

curl -X POST -d '{"username":"newchilduser","email":"example@example.com", "password":"FGdfosad", "userRole": "Administrator"}' -H 'Content-Type: application/json' https://<your-account>.xp-dev.com/api/v1/user

If a password is NOT supplied in the request then a random password will be set for the user and emailed to the specified email address.

Response will be a single User Object

Get a single User

GET request to https://<your-account>.xp-dev.com/api/v1/user/<user-id>:

curl https://<your-account>.xp-dev.com/api/v1/user/128

Response will be a single User Object

Get a single User by ID

GET request to https://<your-account>.xp-dev.com/api/v1/user/<id>:

curl https://<your-account>.xp-dev.com/api/v1/user/128

Response will be a single User Object

Get all Users

GET request to https://<your-account>.xp-dev.com/api/v1/user/all:

curl https://<your-account>.xp-dev.com/api/v1/user/all

Response will be a list of User Objects

Delete a User

DELETE request to https://<your-account>.xp-dev.com/api/v1/user/<user-id>:

curl -X DELETE https://<your-account>.xp-dev.com/api/v1/user/128

Feel free to contact us if you need any assistance.