User Accounts

The Audiogum platform provides various account management APIs:

APIPurpose
POST /v1/tokensAuthenticate a user
HEAD /v1/usersCheck if email address registered
POST /v1/userRegister a new account
GET /v1/userGet user details
PUT /v1/userUpdate user details
GET /v1/user/configGet user settings
PUT /v1/user/configUpdate user settings
PUT /v1/user/imageUpdate user profile picture
DELETE /v1/user/imageDelete user profile picture
POST /v1/user/resetRequest a password reset (triggers an email to the registered email address)
POST /v1/user/verifyRequest email validation (triggers an email to the registered email address)
GET /v1/supportGet support content that has been uploaded through admin APIs

Authenticate a user

POST /v1/tokens

Try this in our API explorer.

The API is secured with HTTP Basic Authentication with the password as base64-encode(client_id:client_secret)

Authorization: Basic bXljbGllbnRpZDpteXNlY3JldA==
Content-Type: application/json
{
 "username":"xxx@yyy.com",
 "password":"xxxxxxx",
 "deviceid":"xxxxxxx",
 "grant_type":"password",
 "scope":"all"
}

The response returns an OAuth2 access_token and refresh_token to access APIs. See authentication for more information.

200 OK
{
  "access_token": "accesstokenhere",
  "refresh_token": "refreshtokenhere",
  "token_type": "bearer",
  "expires_in": 3600,
  "userid": "uniqueuserid"
}


Register a new account

POST /v1/user

Try this in our API explorer.

The API is secured with HTTP Basic Authentication with the password as base64-encode(client_id:client_secret)

Authorization: Basic bXljbGllbnRpZDpteXNlY3JldA==
Content-Type: application/json
{
 "email":"xxx@yyy.com",
 "password":"xxxxxxx",
 "deviceid":"xxxxxxx",
 "scope":"all",
 "firstname":"Something",
 "lastname":"Something",
 "countrycode":"cn"
}

The response returns an OAuth2 access_token and refresh_token as with POST /v1/tokens.

An HTTP Status code of 409 indicates there is already an account with that email address registered


Update user details

PUT /v1/user

Try this in our API explorer. (All fields are optional) Secured with OAuth2 bearer access_token.

Authorization: Bearer xxxxxxxxxxx
Content-Type: application/json
{
 "firstname":"Something",
 "lastname":"Something",
 "countrycode":"cn",
 "password":"new-password",
 "crmemailallowed":true,
 "crmpushallowed":true,
 "locationallowed":false
}

The response merges the updated fields with the existing data and returns non-sensitive updated information.

200 OK
{
  "userid": "uniqueuserid",
  "email": "something@somewhere.com",
  "firstname":"Something",
  "lastname":"Something",
  "countrycode":"cn",
  "crmemailallowed":true,
  "crmpushallowed":true,
  "locationallowed":false
}


Shadow Accounts

If you have an existing authentication and user account system of your own, the Audiogum platform supports "shadow accounts", i.e. we allow you do the user authentication and pass us a consistent, unique ID that represents your user within our platform. We anonymise the identifier passed to us for the user by consistently transforming it into a uuid internally - this allows you to choose from a range of identifiers - e.g. your user account ID, an email address, etc.

In this case, see details of how to authenticate the user.


Support content

GET /v1/support

Try this in our API explorer.

Secured with OAuth2 bearer access_token.

Authorization: Bearer YmVhcmVyIHRva2VuIGdvZXMgaGVyZQ==
GET /v1/support

The response is a json object containing the support content uploaded through the admin APIs.