Integrating External Services with Patch via HTTP Requests
The HTTP Action Block is a powerful feature within Patch’s Automation canvas that allows you to connect and communicate with external services via API calls. This article will guide you through the process of setting up an HTTP Action Block to enhance your automations.
Creating or Editing an Automation for HTTP Requests
To begin, you can either create a new automation from scratch or edit an existing one to include an HTTP Request block. The type of ‘Trigger’ block you choose will determine the payload information that can be sent through the HTTP Request.
Commonly Used Trigger Blocks
- Contact Created: Triggers when a new contact is added.
- Contact Updated: Triggers when existing contact information is updated.
- Order Finished: Triggers when an order is completed.
- Check-In Finished: Triggers when a check-in is completed.
Tip: It’s recommended to insert a delay block, typically set for a short duration like 5 minutes, before the HTTP Request block. This ensures all data is fully updated before the HTTP Request is executed.
Once you have selected the Trigger block, click and drag the ‘HTTP Request’ block onto the Automation Canvas.
Setting Up the HTTP Request Block
After selecting your Trigger block, drag the ‘HTTP Request’ block onto the Automation Canvas and connect it to the Trigger block.
The HTTP Request block consists of four main sections:
Request Method / Request URL: Choose the appropriate HTTP method (GET, POST, PUT, PATCH, DELETE) based on the action you want to perform with the third-party service. Ensure you include the correct Request URL. These options are available to choose from within Patch, but be sure to check your third-party’s documentation on how each of these specific elements works within their system.
- GET: Allows retrieval of a single contact/properties or even a list of contacts
- POST: Allows new contact creation
- PUT: Used to associate a contact with other CRM records or activity
- PATCH: Used to update a contact
- DELETE: Used to remove an association or delete contact(s)
Request Headers: Define the headers that will be included in every request.
Request Parameters: These are sent as a JSON object in the body of the request. The available payload data will depend on the Trigger block used.
Response Parameters: This section allows you to handle data returned by the request URL, assuming it returns a valid JSON object.
Viewing Payload Data
Payload data can be viewed in three ways:
- Automation Blocks: Edit the automation and view the payload data through the Task Log tab.
- Contact Profile: Access the payload data via the Activity Log within each contact profile.
- Event Log: Search for events in the Event Log to view their payload data.
When setting up response parameters, you can select a contact payload key to write the returned data to. Note that the payload size cannot exceed 1024 bytes, and certain paths may be unsupported (general.xxx, account.xxx paths).
Finalizing Your HTTP Request Automation
Once you’ve configured the HTTP Request block, connect each block and enable the automation. After the automation runs, you can confirm its completion by the updates in the numbers displayed.
Using the HTTP Request block effectively allows you to add an API and exchange information with your third-party software, expanding the capabilities of your Patch automations.
Customer Support
For any assistance or further information on setting up HTTP Action Blocks, please reach out to our Customer Support team by phone 888.605.4429 or email success@patchretention.com.