Links API User administration

Return a list of all users.

Method: GET

URL: https://<domain>/users

Headers: X-Access-Token: <token supplied at login>

Body: Not required.

Expected response: Json string, e.g.

{
  "status": 200,
  "data": [{
    "username": "user",
    "email": "user@example.com",
    "domain": "*",
    "confirm": true,
    "active": true,
    "updated": "2018-08-01T15:00:00.000Z"
  }, {
    "username": "user2",
    "email": "user2@example.com",
    "domain": "*",
    "confirm": false,
    "active": false,
    "updated": "2018-08-01T15:00:00.000Z"
  }],
  "message": "2 users found."
}

 

Return specified user.

Method: GET

URL: https://<domain>/users/<user name>

Headers: X-Access-Token: <token supplied at login>

Body: Not required.

Expected response: Json string, e.g.

{
  "status": 200,
  "data": [{
    "username": "user",
    "email": "user@example.com",
    "domain": "*",
    "confirm": true,
    "active": false,
    "updated": "2018-08-01T15:00:00.000Z"
  }],
  "message": "1 user found."
}

 

Create a new user.

Method: POST

URL: https://<domain>/users

Headers: Content-Type: application/json
X-Access-Token: <token supplied at login>

Body: Json string containing at least username, password and email, e.g.

{
  "username": "user",
  "password": "password",
  "email": "user@example.com",
  "domain": "*"
}

Expected response: Json string, e.g.

{
  "status": 201,
  "data": [{
    "username": "user"
  }],
  "message": "User confirmed."
}

 

Update a user

Method: PUT

URL: https://<domain>/users/<user name>

Headers: Content-Type: application/json
X-Access-Token: <token supplied at login>

Body: Json string containing one or more of the fields shown, e.g.

{
  "password": "password",
  "email": "user@example.com",
  "domain": "*",
  "confirm": true,
  "active": true
}

Expected response: Json string, e.g.

{
  "status": 200,
  "data": [{
    "username": "user"
  }],
  "message": "User updated."
}

 

Delete a user

Method: DELETE

URL: https://<domain>/users/<user name>

Headers: X-Access-Token: <token supplied at login>

Body: Not required.

Expected response: Json string, e.g.

{
  "status": 200,
  "data": [{
    "username": "user"
  }],
  "message": "User deleted."
}