Authentication
Flash API uses JSON Web Tokens (JWT) for authentication. Most API operations require authentication to identify the user and determine their permissions.
Authentication Process
#
Flash uses a two-step phone verification process for authentication:
Step 1: Initiate phone verification by sending a
userPhoneRegistrationInitiatemutation with the phone number:This will trigger a 6-digit code to be sent via SMS to the specified phone number.
Step 2: Verify the code and obtain auth token by sending a
userLoginmutation with the phone number and verification code:Upon successful verification, an authentication token will be returned.
Store the auth token securely in your application.
The token is valid for 7 days. For security reasons, do not store it in localStorage in browser environments.
Include the token in all subsequent API requests via the Authorization header:
Handle token expiration by implementing appropriate error handling:
Security Best Practices
#
- Never expose your auth token in client-side code or URLs
- Use HTTPS for all API communication
- Implement token refresh logic before expiration
- Validate the token on your server before using it
Getting Started
API Keys
