Links

Management

Upload Data to the Blockchain

Create User

Admins can create various users and determine their roles. Admins itself won't interact with the wallet and API endpoints other than authentication and user management.
  • manager
  • viewer
  • operator
  • admin
curl --location --request POST 'https://us-central1-changedev-3b21a.cloudfunctions.net/api/v1/createUser' \
--header 'Authorization: Bearer authToken' \
--header 'Content-Type: application/json' \
--data-raw '{
"email":"[email protected]",
"password":"password",
"role":"manager"
}'
Upon success response users will receive the following information
  1. 1.
    status
  2. 2.
    uid (userId will be used as a part of authentication)
  3. 3.
    email
  4. 4.
    role
  5. 5.
    apiKey (can be used to access the endpoints)

Update User

An Admin can update the role of an existing user by user email.
curl --location --request PUT 'https://us-central1-changedev-3b21a.cloudfunctions.net/api/v1/updateRole' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer authToken' \
--data-raw '{
"role":"viewer",
}'

Get User

An Admin can get the users details by user email by using this endpoint
curl --location --request GET 'https://us-central1-changedev-3b21a.cloudfunctions.net/api/v1/[email protected]' \
--header 'Authorization: Bearer authToken'

Delete User

An admin can delete a user by user email
curl --location --request DELETE 'https://us-central1-changedev-3b21a.cloudfunctions.net/api/v1/[email protected]' \
--header 'Authorization: Bearer authToken'