Quick Start Guide
Get started with Looping Binary API in under 5 minutes. This guide will walk you through creating an account, generating API keys, and making your first request.
Prerequisites
- Basic knowledge of REST APIs
- A programming language (JavaScript, Python, etc.)
- 5 minutes of your time
2Generate API Key
After logging in, navigate to the API Keys section in your dashboard and create a new API key.
Steps:
- Go to Dashboard → API Keys
- Click "Generate New Key"
- Give it a name (e.g., "Production Key")
- Select permissions (read, write, admin)
- Copy and save your key securely
3Set Environment Variable
Store your API key securely in an environment variable:
.env
LB_API_KEY=your_api_key_here4Make Your First Request
Let's authenticate a user using the Login endpoint:
JavaScript
const response = await fetch('https://api.loopingbinary.com/api/auth/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': process.env.LB_API_KEY
},
body: JSON.stringify(({
email: 'user@example.com',
password: 'password123'
})
});
const { user, token } = await response.json();
console.log('User:', user);
console.log('Token:', token);Expected Response:
{
"user": {
"id": 1,
"email": "user@example.com",
"fullName": "John Doe",
"role": "USER"
},
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}5Use the Token
Use the JWT token for authenticated requests:
JavaScript
const userResponse = await fetch('https://api.loopingbinary.com/api/auth/me', {
headers: {
'Authorization': `Bearer ${token}`
}
});
const userData = await userResponse.json();
console.log(userData);