Token API
This page provides routes for managing tokens. The following routes are available:
GET/token-nameRetrieve the name of the tokenGET/token-symbolRetrieve the symbol of the tokenGET/total-supplyRetrieve the total supply of the tokenGET/my-token-balanceRetrieve the token balance for the authenticated userGET/balance/organizationRetrieve the token balance for the organizationPOST/transferTransfer the token to a wallet address by email
Retrieve the name of the token
This endpoint retrieves the name of the token.
GET https://api.token.web3sandpit.com/api/v1/tokens/token-name
INFO
Authentication: Requires ApiKey for authentication. Permissions: Requires USER role with read permission.
Parameters
None
Example
{} {
"name": "Example Token"
"status":"success"
}HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With an array of user objects and pagination information. |
| 400 | Bad Request | The request was invalid or cannot be processed. |
| 401 | Unauthorized | Authentication is required or has failed. |
| 403 | Forbidden | The authenticated user is not authorized to perform the requested action. |
| 404 | Not Found | The requested resource could not be found. |
| 500 | Internal Server Error | An unexpected error occurred. |
Retrieve the symbol of the token
This endpoint retrieves the symbol of the token.
GET https://api.token.web3sandpit.com/api/v1/tokens/token-symbol
INFO
Authentication: Requires ApiKey for authentication.
Permissions: Requires USER role with read permission.
Parameters
None
Example
{}{
"symbol": "EXT",
"status": "success"
}HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With an array of user objects and pagination information. |
| 400 | Bad Request | The request was invalid or cannot be processed. |
| 401 | Unauthorized | Authentication is required or has failed. |
| 403 | Forbidden | The authenticated user is not authorized to perform the requested action. |
| 404 | Not Found | The requested resource could not be found. |
| 500 | Internal Server Error | An unexpected error occurred. |
Retrieve the total supply of the token
This endpoint retrieves the total supply of the token.
GET https://api.token.web3sandpit.com/api/v1/tokens/total-supply
INFO
Authentication: Requires ApiKey for authentication.
Permissions: Requires USER role with read permission.
Parameters
None
Example
{}{
"totalSupply": "1000000",
"status": "success"
}HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With an array of user objects and pagination information. |
| 400 | Bad Request | The request was invalid or cannot be processed. |
| 401 | Unauthorized | Authentication is required or has failed. |
| 403 | Forbidden | The authenticated user is not authorized to perform the requested action. |
| 404 | Not Found | The requested resource could not be found. |
| 500 | Internal Server Error | An unexpected error occurred. |
Retrieve the token balance for the authenticated user
This endpoint retrieves the token balance for the authenticated user.
GET https://api.token.web3sandpit.com/api/v1/tokens/my-token-balance
INFO
Authentication: Requires ApiKey for authentication.
Permissions: Requires USER role with read permission.
Parameters
None
Example
{}{
"balance": "1000",
"status": "success"
}HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With an array of user objects and pagination information. |
| 400 | Bad Request | The request was invalid or cannot be processed. |
| 401 | Unauthorized | Authentication is required or has failed. |
| 403 | Forbidden | The authenticated user is not authorized to perform the requested action. |
| 404 | Not Found | The requested resource could not be found. |
| 500 | Internal Server Error | An unexpected error occurred. |
Retrieve the token balance for the organization
This endpoint retrieves the token balance for the organization.
GET https://api.token.web3sandpit.com/api/v1/tokens/balance/organization
INFO
Authentication: Requires ApiKey for authentication.
Permissions: Requires OWNER role with read permission.
Parameters
None
Example
{}{
"balance": "5000",
"status": "success"
}HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With an array of user objects and pagination information. |
| 400 | Bad Request | The request was invalid or cannot be processed. |
| 401 | Unauthorized | Authentication is required or has failed. |
| 403 | Forbidden | The authenticated user is not authorized to perform the requested action. |
| 404 | Not Found | The requested resource could not be found. |
| 500 | Internal Server Error | An unexpected error occurred. |
Transfer the token to a wallet address by email
This endpoint transfers tokens to a specific wallet address.
POST https://api.token.web3sandpit.com/api/v1/tokens/transfer
INFO
Authentication: Requires ApiKey for authentication.
Permissions: Requires USER role with write permission.
Parameters
None
Example
{
"email": "example@example.com",
"amount": "1000"
}{
"blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"blockNumber": 1,
"from": "0x0000000000000000000000000000000000000000",
"gas": 21000,
"gasPrice": 1000000000,
"hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"status": "success",
"to": "0x0000000000000000000000000000000000000000",
"value": 1000
}HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With an array of user objects and pagination information. |
| 400 | Bad Request | The request was invalid or cannot be processed. |
| 401 | Unauthorized | Authentication is required or has failed. |
| 403 | Forbidden | The authenticated user is not authorized to perform the requested action. |
| 404 | Not Found | The requested resource could not be found. |
| 500 | Internal Server Error | An unexpected error occurred. |