Get up and running with the Field Nation API in 5 minutes.
This guide will take you from Zero to Published Work Order in three steps.
client_id, client_secret, username, and password.https://api.sandbox.fieldnation.com/api/rest/v2) for this guide.First, exchange your credentials for an access token.
curl -X POST "https://api.sandbox.fieldnation.com/authentication/api/oauth/token" \
-H "Content-Type: application/json" \
-d '{
"grant_type": "password",
"client_id": "YOUR_ID",
"client_secret": "YOUR_SECRET",
"username": "YOUR_USER",
"password": "YOUR_PASSWORD"
}'{
"access_token": "eyJ0eXAi...",
"expires_in": 3600
}Create a simple job. We will set it to "Draft" mode so we can review it.
Tip: Use
type_of_work: { id: 62 }(Point of Sale) for this test.
curl -X POST "https://api.sandbox.fieldnation.com/api/rest/v2/workorders" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Quick Start Test Job",
"description": { "html": "<p>This is a test.</p>" },
"type_of_work": { "id": 62 },
"location": {
"mode": "custom",
"address1": "123 Test St",
"city": "Minneapolis",
"state": "MN",
"zip": "55401",
"country": "US"
},
"pay": {
"type": "fixed",
"base": { "amount": 100, "units": 1 }
},
"schedule": {
"service_window": {
"mode": "exact",
"start": { "utc": "2024-12-01 09:00:00" }
}
}
}'{
"id": 998877,
"status": { "id": 1, "name": "Draft" }
}Now that it exists, make it live so providers can see it.
curl -X POST "https://api.sandbox.fieldnation.com/api/rest/v2/workorders/998877/publish" \
-H "Authorization: Bearer YOUR_TOKEN"Success! You have just dispatched your first work order programmatically.
Now that you've made your first call, dive deeper into the core systems:
Last updated on