Make your first API call
Let's make a simple API call to get user information:
- cURL
- Python
- JavaScript
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \\
https://api.example.com/v1/user
import requests
headers = {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
}
response = requests.get('https://api.example.com/v1/user', headers=headers)
print(response.json())
fetch('https://api.example.com/v1/user', {
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
}
})
.then(response => response.json())
.then(data => console.log(data));