User and Token Management
  • 27 Jun 2024
  • 2 Minutes to read
  • Dark
    Light

User and Token Management

  • Dark
    Light

Article summary

API calls and sample responses pertaining to user management and token management are listed below.

User Signup

Use this call to register a new user account.

Endpoint: POST https://api.volumez.com/signup

Headers: Content-Type: application/json

Request Body:

{

  "email": "string",

  "password": "string",

  "name": "string"

}

Request Parameters:

Parameter

Type

Required

Description

email

string

Yes

User's email address

password

string

Yes

User's chosen password

name

string

Yes

User's full name or display name

Sample Request:

curl -X POST https://api.volumez.com/signup \

  -H 'Content-Type: application/json' \

  -d '{

    "email": "demo@volumez.com",

    "password": "********",

    "name": "Demo User"

  }'

Sample Response:

{

  "message": "Successfully signed up",

  "status": 200

}

Create a Tenant’s Additional User

For example:

curl -X POST https://api.volumez.com/tenant/user -H 'content-type: application/json' -d '{"email":"mary.smith@gmail.com", "password":"*******", "name":"Mary Smith"}' -H 'authorization: <key>'

Access Tokens

Renew or Refresh REST API Token (Identity Token)

Call this API to renew the REST API token when it expires. You will need to pass the Refresh Token as a parameter in the header.

Call this API when your credentials expire or when you sign out.

curl -X GET https://api.volumez.com/tenant/apiaccess/credentials/refresh -H 'refreshtoken: <token>'

Obtaining a Tenant’s Token (Access Token) after sign up

The header authorization parameter passed below is the Identity Token obtained from the Tenant’s UI page after the Tenant has subscribed and signed in.

curl -X GET https://api.volumez.com/tenant/token -H 'authorization: <IdentityToken>' -H 'content-type: application/json'

Response:

{ "AccessToken": "eyJraWQiOiJhMUxrM1R0TFhtZE81YXVhVmFTbDBwdHprTzF2VW1DbjFvZ3liMWNKT0pzPSIsImFsZyI6IlJTMjU2In0.eyJzdWIiOiIydWxjdTkzZW5zZDkwOHEzOWRwZXZ2Y3RvZCIsInRva2VuX3VzZSI6ImFjY2VzcyIsInNjb3BlIjoidGVuYW50LmNvbm5lY3RvclwvcmVhZCIsImF1dGhfdGltZSI6MTYyOTAzMzUwMCwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfeERGRDJRTnYxIiwiZXhwIjoxNjI5MTE5OTAwLCJpYXQiOjE2MjkwMzM1MDAsInZlcnNpb24iOjIsImp0aSI6IjI3YzJkNzgyLTYyOGMtNDRjZS1iZDg5LTI4NTY0ZmMzMzBhZiIsImNsaWVudF9pZCI6IjJ1bGN1OTNlbnNkOTA4cTM5ZHBldnZjdG9kIn0.iwS2ZE5sxBNVyo4cgQ0xxlrmPeJo25Plb1kIukIFVT0NCulnhHkjlrbLBLEDCWfIzp6nW_-9zG36SzMLFWCwab2AVPYDPNi-qqVsMp0qdZ1aNyZmI3WjMrww7wiU1Y4GWcd5NyqtRZri74D7BRnvjnI1KoIGljB_wSPD7soFTtX8SaIiNjPlMAJ5Nj4JTmxIXX26cQ1Ecwbq3-pVld-6S8NuYEUVZds6dUxyw4YfVn5G0VgWTUNN7uJOi2KLv1KDgibTHBHqPpbFfDHUwhj0taJnmVzUBJrDQeNSjR45Q9tN3zJDUXhJeyCvjCkXv3cg1TzK6g2-E-9fSWwv9D8t9g", "ExpiresIn": 86400, "TokenType": "Bearer" }

Obtaining a Tenant’s Host Token (Refresh Token)

The AccessToken (Tenant’s Token) used in this API call can be obtained in the step described above (Obtaining a Tenant’s Token).

curl -X POST https://api.volumez.com/tenant/refreshtoken -H 'content-type: application/json' -d '{"hostname":"MyTenantHostName", "accesstoken":"<accessToken>"}'

 

Given a Tenant’s Host Token, get the Tenant’s Host Name and Tenant ID

Use this call to retrieve the Tenant’s Host Name and Tenant’s ID using the Tenant’s Host Token.

curl -X GET https://api.volumez.com/tenant/tenanthost -H 'tenanthosttoken: Tenant-Host-Token-Here'

For example:

curl -X GET https://api.volumez.com/tenant/tenanthost -H 'tenanthosttoken: <tenantToken>'

 

Response:

{

"Message":"Got Tenant's Host successfully","StatusCode":200,"TenantHost":"MyTenantHostName","TenantID":"94e1b366-2eed-4081-b103-b6c7c0a8c582"

}

Given a Tenant’s Token, get the Tenant’s ID

Use this call to retrieve the Tenant’s ID using the Tenant’s Token.

curl -X GET https://api.volumez.com/tenant/tenantid -H 'tenanttoken: your-tenant-token-here'

For example:

curl -X GET https://api.volumez.com/tenant/tenantid -H 'tenanttoken: <tenantToken>'

 

Response:

{"Message":"Got Tenant's ID successfully","StatusCode":200,"TenantID":"94e1b366-2eed-4081-b103-b6c7c0a8c582"}

Get Tenant’s User given the Tenant’s Identity Token

Use this call to retrieve the Tenant’s user (Email, Name and Tenant’s ID) by providing the Tenant’s Identity Token.

curl -X GET https://api.volumez.com/tenant/user -H 'authorization: Tenant-Identity-Token-Here'

For example:

curl -X GET https://api.volumez.com/tenant/user -H 'authorization: <authToken>'

 

Response:

{"Email":"John.Smith@volumez.com","Message":"Got Tenant's User successfully","Name":"John Smith","StatusCode":200,"TenantID":"94e1b366-2eed-4081-b103-b6c7c0a8c582"}


Was this article helpful?

What's Next