Your First API Call
Let's make your first API call to 0.link! This guide will walk you through testing your connection and understanding the basics of our API.
Prerequisites
Before making your first call, ensure you have:
- ✅ Created your account
- ✅ Generated an API key
- ✅ A way to make HTTP requests (curl, Postman, or code)
Base URL
All API requests are made to:
https://api.0.link/apiAuthentication
Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEYTest Connection
Let's start with a simple ping to test your connection:
Using curl
curl -H "Authorization: Bearer 0link_sk_your_api_key_here" \
https://api.0.link/api/pingUsing JavaScript (fetch)
const response = await fetch('https://api.0.link/api/ping', {
headers: {
'Authorization': 'Bearer 0link_sk_your_api_key_here',
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log(data);Using Python (requests)
import requests
headers = {
'Authorization': 'Bearer 0link_sk_your_api_key_here',
'Content-Type': 'application/json'
}
response = requests.get('https://api.0.link/api/ping', headers=headers)
data = response.json()
print(data)Expected Response
{
"status": "success",
"message": "pong",
"timestamp": "2024-01-15T10:30:00Z",
"version": "2.1.0"
}Get Account Information
Once ping works, let's get your account information:
Request
curl -H "Authorization: Bearer 0link_sk_your_api_key_here" \
https://api.0.link/api/accountResponse
{
"id": "acc_1234567890",
"email": "[email protected]",
"name": "John Developer",
"usage": {
"current_month": 152,
"limit": 10000,
"reset_date": "2024-02-01T00:00:00Z"
},
"created_at": "2024-01-01T00:00:00Z"
}Create Your First Project
Projects help organize your integrations:
Request
curl -X POST \
-H "Authorization: Bearer 0link_sk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"name": "My First Project",
"description": "Getting started with 0.link"
}' \
https://api.0.link/api/projectsResponse
{
"id": "proj_9876543210",
"name": "My First Project",
"description": "Getting started with 0.link",
"status": "active",
"created_at": "2024-01-15T10:30:00Z",
"api_endpoints": {
"integrations": "https://api.0.link/api/projects/proj_9876543210/integrations"
}
}Common Response Patterns
Success Response
All successful responses include:
{
"status": "success",
"data": { /* response data */ },
"timestamp": "2024-01-15T10:30:00Z"
}Error Response
All error responses include:
{
"status": "error",
"error": {
"code": "INVALID_API_KEY",
"message": "The provided API key is invalid",
"details": "Please check your API key and try again"
},
"timestamp": "2024-01-15T10:30:00Z"
}Testing Tools
Postman Collection
Import our Postman collection for easy testing: Download 0.link Postman Collection
API Explorer
Use our interactive API explorer in the dashboard: Dashboard API Explorer
SDK Quickstart
For faster development, use our official SDKs:
JavaScript/Node.js
import { ZeroLink } from '@0link/sdk';
const client = new ZeroLink({
apiKey: 'your_api_key_here'
});
const ping = await client.ping();
console.log(ping);Python
from zerolink import Client
client = Client(api_key='your_api_key_here')
ping = client.ping()
print(ping)Rate Limiting
Be aware of rate limits. The default rate limit is 60 requests per minute for standard endpoints.
Rate limit headers are included in responses:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
X-RateLimit-Reset: 1642248000Next Steps
Great job! You've made your first API calls. Here's what to do next:
- Understand API Access - Learn about permissions and security
- Explore API Reference - Dive deeper into all available endpoints
Troubleshooting
401 Unauthorized
- Verify your API key is correct
- Check that the key hasn't expired
- Ensure the key has the right permissions
403 Forbidden
- Check your account's usage limits
- Verify you have access to the requested resource
429 Rate Limit Exceeded
- Slow down your request rate
- Implement exponential backoff
Connection Issues
- Verify your internet connection
- Try from a different network if possible
Getting Help
Need assistance with your first API call?
- Documentation: Browse our API reference
- Support: Email [email protected]
Successfully made your first call? You're ready to build something amazing! 🚀