# Generate Token Generates a JWT access token based on provided client credentials. Use this POST endpoint to authenticate using your clientId and clientSecret and receive a JWT token. Token Validity: 40 minutes from the time of issuance. Endpoint: https://api.bcb.bm/auth/token Required Headers: - Content-Type: application/json - Accept: application/json ### Sample Request in JavaScript: javascript async function getToken() { try { const response = await fetch('https://api.bcb.bm/auth/token', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Accept': 'application/json' }, body: JSON.stringify({ clientId: 'your-client-id', clientSecret: 'your-client-secret' }) }); if (!response.ok) { const errorData = await response.json(); throw new Error(Error: ${errorData.message || response.statusText}); } const data = await response.json(); console.log('JWT Token:', data.token); // Store token securely localStorage.setItem('jwt', data.token); } catch (error) { console.error('Fetch error:', error); } } getToken(); Endpoint: POST /auth/token Version: v1 ## Request fields (application/json): - `clientId` (string, required) The client ID assigned by the authorization server. - `clientSecret` (string, required) The client secret assigned by the authorization server. ## Response 200 fields (application/json): - `token` (string, required) Gets or sets the JWT token. - `expiration` (string, required) Gets or sets the expiration date and time of the token. ## Response 400 fields (application/json): - `error` (string, required) - `message` (string, required) ## Response 401 fields (application/json): - `error` (string, required) - `message` (string, required) ## Response 429 fields (application/json): - `error` (string, required) - `message` (string, required) ## Response 500 fields (application/json): - `error` (string, required) - `message` (string, required)