Authentication
The ByteConnect API uses JWT (JSON Web Token) authentication. You’ll need to obtain an access token before making API requests.
Base URL
Section titled “Base URL”https://quinix.byteconnect.usGetting Access Tokens
Section titled “Getting Access Tokens”POST /auth
Section titled “POST /auth”Exchange your credentials for access and refresh tokens.
Request:
curl -X POST https://quinix.byteconnect.us/auth \ -H "Content-Type: application/json" \ -d '{ "username": "your_username", "password": "your_password" }'Response:
{ "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...", "token_type": "bearer", "refresh_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..."}Token Lifetimes
Section titled “Token Lifetimes”| Token | Lifetime |
|---|---|
| Access Token | 15 minutes |
| Refresh Token | 15 days |
Refreshing Tokens
Section titled “Refreshing Tokens”POST /auth_refresh
Section titled “POST /auth_refresh”When your access token expires, use the refresh token to get a new one.
Request:
curl -X POST https://quinix.byteconnect.us/auth_refresh \ -H "Content-Type: application/json" \ -d '{ "access_token": "expired_access_token", "refresh_token": "your_refresh_token" }'Response:
{ "access_token": "new_access_token", "token_type": "bearer", "refresh_token": "new_refresh_token"}Using Access Tokens
Section titled “Using Access Tokens”Include the access token in your API requests:
curl -X POST https://quinix.byteconnect.us/create_transaction \ -H "Content-Type: application/json" \ -d '{ "access_token": "your_access_token", "amount": "25.00", "crypto_selected": "BTC" }'Security Best Practices
Section titled “Security Best Practices”- Store credentials in environment variables
- Use
.gitignoreto prevent committing.envfiles - Rotate credentials periodically
- Use HTTPS for all API requests
Environment Variables Example
Section titled “Environment Variables Example”# .env fileBYTECONNECT_USERNAME=your_usernameBYTECONNECT_PASSWORD=your_password# Python exampleimport osimport requests
response = requests.post( "https://quinix.byteconnect.us/auth", json={ "username": os.environ["BYTECONNECT_USERNAME"], "password": os.environ["BYTECONNECT_PASSWORD"] })Error Responses
Section titled “Error Responses”| Status Code | Description |
|---|---|
| 401 | Invalid credentials or expired token |
| 403 | Insufficient permissions |
| 429 | Rate limit exceeded |
Example Error:
{ "error": "invalid_credentials", "message": "The provided username or password is incorrect"}