Tokens
To manage user tokens in FileDrop, you can send a POST request to the following API endpoints. This action should be done on your server side, not in the user's browser.
API Endpoints
- Give Tokens to User:
POST
http://{fileflows-url}/api/file-drop/user/{uuid}/give-tokens/{tokens}
This endpoint allows you to add tokens to a specific user identified by their uuid
.
- Set Tokens for User:
POST
http://{Fileflows-url}/api/file-drop/user/{uuid}/set-tokens/{tokens}
This endpoint allows you to set the number of tokens for a specific user, overriding the current amount with the value provided.
Authentication
Both of the above requests must include an Access Token in the header. You can find this token in Settings > Security.
Header Format:
Authorization: {AccessToken}
Token Purchase URL
You can provide users with a URL where they can purchase additional tokens. The URL can be configured to automatically include the uuid
query parameter, ensuring that the purchase is linked to the correct user.
Opening the Purchase URL
When users are directed to the token purchase page, it should be opened in a popup dialog to ensure a seamless experience.
Make sure to implement these actions on your server side to securely manage user tokens and facilitate token purchases.