Skip to main content

Webhooks

Webhooks notify your system, in real time, when something happens in the operation: an order created, a task completed, a form answered. Instead of querying the API from time to time, you receive a POST request at the URL you register.

Events​

EventWhen it is sent
order-createdWork order created
order-updatedWork order updated
order-form-createdForm created in the order
order-form-updatedOrder form updated
order-attachment-createdAttachment created
order-attachment-updatedAttachment updated
order-attachment-deletedAttachment deleted
task-createdTask created
task-updatedTask updated
task-start-routeEmployee started traveling to the task
task-route-startedTask route started
task-startedTask started by the employee
task-completedTask completed
task-reportedImpediment reported on the task
task-ratedTask rated by the customer
comment-createdComment created
employee-createdEmployee created
ticket-createdService request created
ticket-acceptedService request accepted
ticket-canceledService request canceled
ticket-closedService request closed
ticket-expiredService request expired
ticket-refusedService request refused
quotation-createdQuotation created
quotation-updatedQuotation updated
quotation-approvedQuotation approved
quotation-canceledQuotation canceled
quotation-refusedQuotation declined
vehicle-createdVehicle created
vehicle-updatedVehicle updated

The request body is the event's resource, in the same format as the API: task-created brings a task, comment-created a comment, and so on.

Headers sent​

HeaderContent
X-FieldControl-EventEvent name
X-FieldControl-DeliveryUnique identifier of the delivery
X-FieldControl-AccountAccount identifier
User-AgentFieldControl-Hookshot/<delivery identifier>
Content-TypeAlways application/json

If the URL was registered with authentication, the delivery uses HTTP Basic authentication with the given username and password.

How to handle an event​

  1. Check X-FieldControl-Delivery to see whether the delivery was already processed, so you do not process the same event twice.
  2. Read the event in X-FieldControl-Event.
  3. Update your system with the body received.
  4. Respond quickly: Field Control waits up to 15 seconds for the response. Do the heavy processing after responding.

Register the URL​

  1. In the Manager Panel, open Configurações > API de integração (Settings > Integration API) and, in the Webhooks da integração (integration webhooks) section, click Novo Webhook (New webhook).

    Integration API menu and New webhook button

  2. Enter the URL and the authentication (no authentication or with username and password) and choose whether to receive all events or only some of them.

    URL, authentication and events

  3. If you chose the events, turn on the ones you want to receive. Then click Criar (Create).

    Event selection and Create button

Event history​

The Manager Panel's integration event history lists each delivery made to your URL, with the identifier, the event and the date and time.

Event history

Under Ver detalhes (View details), the Requisição (Request) tab shows the headers and body sent, and the Resposta (Response) tab shows what your application responded.

Request details

Response details