Users

The users API's can be used to manage your users inside the Nudge platform.

List sub-users

This is used for retrieving information about the users attached to your account.

Request

For all users belonging to you:

GET /api/v3/user/

Response

[
  {
    "user_name" : "testing",
    "email" : "[email protected]",
    "unique_id" : "4870894619",
    "api_token" : "xd1b0mujmn9nguy7v6nj"
  },
  ...
]

Create a user

Request

POST /api/v3/user/

Parameters

Parameter Name Description
email This needs to be a valid email.
user_name (optional) if you leave this blank, Nudge will use the email as a username. We recommend leaving this field blank.
password The users' password.
timezone (optional) Timezone string, using standard timezone names. Please check the "tz" column here for a list.
target_geography (optional) The ISO-3166 country name, or an array of ISO-3166 country names.

Response

{
  "user_name" : "testing",
  "email" : "[email protected]",
  "unique_id" : "4870894619",
  "api_token" : "xd1b0mujmn9nguy7v6nj"
}

Nudge will return a HTTP400 if the fields are not set correctly, or are invalid.

Edit a user

Request

POST /api/v3/user/<nudge unique id>/

Parameters

Parameter Name Description
user_name (optional) if you leave this blank, Nudge will use the email as a username. This is recommended.
password The users' password.
timezone (optional) Timezone string, using standard timezone names. Please check the "tz" column here for a list.
target_geography (optional) The ISO-3166 country name, or an array of ISO-3166 country names.

This will return HTTP201 if the edit is applied successfully, or a HTTP400 if the parameters are different to the create user request.

Delete a user

Request

DELETE /api/v3/user/<nudge unique id>/

This will return HTTP204 if the delete was successful.