Code Examples
curl, JavaScript and Python snippets
6 min read
Copy-paste examples for the most common API operations. Set FMK to your API key (starts with fmk_).
curl
- Verify key: curl -H "Authorization: Bearer $FMK" https://freemaint.com/api/v1/public-api/whoami
- List WOs: curl -H "Authorization: Bearer $FMK" 'https://freemaint.com/api/v1/work-orders?limit=10'
- GraphQL: curl -X POST -H "Authorization: Bearer $FMK" -H "Content-Type: application/json" -d '{"query":"{ workOrders(limit:5){ id title } }"}' https://freemaint.com/api/v1/graphql
JavaScript (fetch)
const r = await fetch('https://freemaint.com/api/v1/graphql', { method: 'POST', headers: { 'Authorization': `Bearer ${process.env.FMK}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ query: '{ workOrders(limit:5){ id title } }' }) }); const data = await r.json();
Python (requests)
import requests; r = requests.post('https://freemaint.com/api/v1/graphql', headers={'Authorization': f'Bearer {FMK}'}, json={'query': '{ workOrders(limit:5){ id title } }'}); print(r.json())
Tip
Always check X-RateLimit-Remaining in the response โ your integration should warn you before exhausting the daily cap.
Related articles
Was this page helpful?