Field NationDeveloper Platform
Field NationDeveloper Platform
IntroductionQuick StartAPI Playground

Getting Started

AuthenticationAPI BasicsTroubleshooting

API Reference

Getting Started

API Basics

Fundamental concepts, standards, and conventions used across the Field Nation API.


API Basics

Understanding these core concepts will help you integrate more effectively and avoid common pitfalls.

Pagination

Most list endpoints (like GET /workorders) are paginated to improve performance. The API standardizes pagination using page and per_page query parameters.

ParameterTypeDefaultDescription
pageinteger1The page number to retrieve.
per_pageinteger25Number of items per page.

Note: The maximum value for per_page may vary by endpoint, but is typically capped at 100 to ensure system stability.

Response Metadata

Paginated responses typically include a metadata object with total counts:

{
  "metadata": {
    "total": 150,
    "per_page": 25,
    "pages": 6,
    "page": 1
  },
  "results": [ ... ]
}

Filtering & Sorting

The API supports powerful filtering and sorting capabilities to help you find the exact data you need.

Filtering (f_)

Filters are passed as query parameters prefixed with f_.

  • f_status: Filter by status ID (e.g., f_status=10 for "Work Done").
  • f_project: Filter by project ID.
  • f_created: Filter by creation date range (often supports start,end or specific dates).

Example: GET /workorders?f_status=10&f_project=55&page=1

Sorting

Use sort_by and sort_direction to order your results.

  • sort_by: The field to sort on (e.g., created, status).
  • sort_direction: asc or desc.

Example: GET /workorders?sort_by=created&sort_direction=desc

Content Types

  • Requests: Must use Content-Type: application/json (unless uploading files).
  • Responses: All responses are returned as application/json.

Date & Time

Field Nation uses a specific object structure for timestamps to explicitly handle Timezones. You must typically send dates in this format.

"start": {
   "utc": "2023-11-07 13:00:00"
}
  • Format: YYYY-MM-DD HH:mm:ss (24-hour format).
  • Timezone: Always convert to UTC before sending. The API handles the conversion to local time based on the work order's location.

Rate Limiting

To ensure fair usage and stability, the API enforces rate limits. If you exceed the limit, you will receive a 429 Too Many Requests response.

  • Best Practice: Implement exponential backoff when you encounter a 429 or 5xx error.
  • Webhooks: Prefer using Webhooks for real-time updates instead of polling the API, to save your rate limit quota.

Error Handling

Standard HTTP status codes are used to indicate success or failure. For detailed resolution steps, see the Troubleshooting guide.

CodeMeaning
200OK. The request was successful.
201Created. A resource was successfully created.
400Bad Request. Invalid payload.
401Unauthorized. Authentication failed.
403Forbidden. Permission denied.
404Not Found. Resource does not exist.
500Server Error. Internal error.

Troubleshooting

If you encounter issues, check these common pitfalls:

  • Check JSON Syntax: Ensure your payload is valid JSON.
  • Validate IDs: key IDs like type_of_work, project_id, or template_id must valid in the environment you are using (Sandbox IDs != Production IDs).
  • Date Format: Ensure all dates are in the { "utc": "..." } format.

  • Token Expiration: Your token may have expired. Refresh it.
  • Environment Mismatch: Are you using a Sandbox token against Production endpoints?

  • Scope: Your API user may lack the specific permission (e.g., "Financials") to access this resource. Contact your admin.

Last updated on

Authentication

Securely authenticate with the Field Nation API using OAuth 2.0.

Troubleshooting

Common error codes, pitfalls, and how to resolve them.

On this page

API Basics
Pagination
Response Metadata
Filtering & Sorting
Filtering (f_)
Sorting
Content Types
Date & Time
Rate Limiting
Error Handling
Troubleshooting