API
This documentation covers the API endpoints related to API key management in the WhirlPrivacy project.
โ ๏ธ You must be logged in to use these requests.
For these requests, you must firstly sign in frontend (e.g., with Web3.js), then put this signature in your Authorization header.
Common Headers
For all requests that require API key management, you must include the following headers:
Authorization
string
The signature obtained in frontend from your wallet.
GET /user/api
- Retrieve API Key
/user/api
- Retrieve API KeyDescription:
Allows a logged-in user to retrieve their API key.
Parameters:
None.
Response:
Unauthorized
User is not logged in or session has expired.
Example Code:
PUT /user/api/generate
- Generate API Key
/user/api/generate
- Generate API KeyYou can only generate 1 key per hour, to avoid too much load on our servers, but once generated your API key won't expire unless you revoke it or generate a new one.
Description:
Allows a logged-in user to generate a new API key for their account.
Parameters:
None.
Response:
Error Handling:
Unauthorized
User is not logged in or session has expired.
Error generating API key, regenen timeout: 1h
An error occurred during API key generation. Wait for 1 hour before trying again.
Example Code:
PUT /user/api/disable
- Disable API Key
/user/api/disable
- Disable API KeyDescription:
Allows a logged-in user to disable their current API key.
Parameters:
None.
Response:
Error Handling:
Unauthorized
User is not logged in or session has expired.
Example Code:
Last updated