Webhooks API

Overview

Certain events, such as receiving work order requests from providers, may have an asynchronous response (since there’s some complex background processing involved). Instead of waiting for a response or making continuous calls to return a list of work orders, you can use the Field Nation Webhooks REST API to receive real-time updates for work order events and status changes. How it Works The Field Nation Webhooks REST API enables you to register your endpoint URL and subscribe to work order Events and Status changes. »

Environments

Field Nation provides a Sandbox and Production environment. Both environments allow you to subscribe to real-time updates and access the Field Nation Platform. Each environment requires separate Authentication credentials. Sandbox The Field Nation Sandbox is a fully-functional development environment that allows you to test your integration before going live to Production (recommended). It offers an isolated space where you can register for work order updates and log in to the Field Nation Platform without changing any live work orders, clients, or projects. »

Request Access

You need to request access before you can start using the Field Nation Webhooks REST API. Submit Case To request access to the Sandbox or Production environment: Navigate to https://support.fieldnation.com/s/submit-case Log into Field Nation (if prompted). Complete a support case. Make sure to include the following information: Support Information Notes Environment URL Sandbox or Production. Company Information Include your company name and id. »

Securing Webhooks

When registering your Webhook, you can provide an optional secret value to ensure that calls to your endpoint originate from Field Nation. Create a Secure Webhook To include a secret value in a Webhook definition: { "url": "https://yourcompany.com/handle_webhook", "secret": "abcde42a8f6c09545b3bedbe2ab45a50" "method": "POST", "active": true, "events": ["workorder.created"] } Verify Requests to Your Endpoint Each call to your endpoint will include a Fn-Hash in the request Header, which is an md5 hash of your secret value and the HTTP request body. »

Testing Webhooks

Before you start building your integration, you can use API monitoring tools like RequestBin to inspect Field Nation HTTP Requests. Inspect Field Nation Requests Services like RequestBin provide a unique URL that you can use in the Webhooks Object to create a new Webhook. If you’re using a secret value, you can also use RequestBin to test your md5 Fn-Hash logic. Refer to Securing Webhooks for more information. To use RequestBin: »

Error Handling

This section describes how Field Nation handles any errors returned from your endpoint URL. It also includes common authentication errors returned from the Webhooks REST API. Push Errors If your Webhook endpoint URL acknowledges with an HTTP status code other than 2xx, the Webhook is qued to be resent (up to a total of three attempts). To disable this feature, include the no_retries parameter and set the value to true. When no_retries is true, Webhooks are not resent unless a 404 status code is received. »

Get Registered Webhooks

Returns a list of registered webhooks. URLs Environment Method URL Sandbox https://micro.fndev.net/v1/webhook-sandbox/webhooks/company/company_id Production https://micro.fieldnation.com/v1/webhook/webhooks/company/company_id Header Parameters Parameter Type Example Notes fn-token string abCDEFGIsInR5cCI6IuXVCJ9.eyJ11wXYZ Secret Token. Required. Path Parameters Parameter Type Example Notes company_id integer 183 Company ID. Refer to Locate Your Company ID for more information. »

Webhook by ID

Gets a Webhook by id. URLs Environment Method URL Sandbox https://micro.fndev.net/v1/webhook-sandbox/webhooks/webhook_id Production https://micro.fieldnation.com/v1/webhook/webhooks/webhook_id Header Parameters Parameter Type Example Notes fn-token string abCDEFGIsInR5cCI6IuXVCJ9.eyJ11wXYZ Secret Token. Required. Path Parameters Parameter Type Example Notes webhook_id string 5a1c3942b6d6e80261167a1c Webhook ID. Required. Query Parameters Not applicable. »

Create Webhook

Creates a Webhook. URLs Environment Method URL Sandbox https://micro.fndev.net/v1/webhook-sandbox/webhooks/ Production https://micro.fieldnation.com/v1/webhook/webhooks/ Header Parameters Parameter Type Example Notes fn-token string abCDEFGIsInR5cCI6IuXVCJ9.eyJ11wXYZ Secret Token. Required. Path Parameters Not applicable. Query Parameters Not applicable. Body Parameters Refer to Webhooks Object for parameter details and examples. { "url": "https://yourcompany.com/handle_webhook", "method": " »

Update Webhook

Updates a Webhook by id. URLs Environment Method URL Sandbox https://micro.fndev.net/v1/webhook-sandbox/webhooks/webhook_id Production https://micro.fieldnation.com/v1/webhook/webhooks/webhook_id Header Parameters Parameter Type Example Notes fn-token string abCDEFGIsInR5cCI6IuXVCJ9.eyJ11wXYZ Secret Token. Required. Path Parameters Parameter Type Example Notes webhook_id string 5a1c3942b6d6e80261167a1c Webhook ID. Required. Query Parameters Not applicable. »