The Patchworks inbound API supports data within strings. This data must be passed within a payload
key.
The required data format is a JSON object with a payload key containing a string of data. For example:
Non-strings and raw payloads are not currently supported.
Here, note that the payload
key is in a JSON object, and is being used to hold different types of data as strings - text, XML and JSON.
If your process flow is sending source data into a target connection, you should map this data using the map shape. This is done in the usual way with two points to note:
In a typical situation, the map shape is used to map data from a source connection to a target connection. However in this scenario, we don't have a source connection - Patchworks doesn't know what data you are sending in or what system it's coming from.
As such, you won't select any source details when configuring the map shape - just leave these field blank:
Because Patchworks has no way of knowing the structure of your incoming data, mapping rules must be added manually.
For further guidance please see our Working with field mappings page.
When you send a Patchworks API request to initialise a process flow, you must provide the internal IDs for the required process flow and version. This guide walks through the steps required to obtain this information.
Step 1 Log in to the Patchworks dashboard.
Step 2 Select process flows from the left-hand navigation menu and select the process flow that you want to update.
Step 3
Check the title bar in the top-left corner and make a note of the number above the title - this is the process flow ID
:
Step 4 Click the settings icon:
...to access process flow settings:
Step 5
Look in the versions panel and find the version of this process flow that you want to initialise, then note the associated ID - this is the process flow version ID
:
For more information about process flow versioning please see our Process flow versioning page.
Step 6 You'll use this information later in any API requests made to initialise this process flow.
Patchworks API requests must be authenticated with a bearer token. To obtain a token, you need to send a login request which includes credentials that you use to access the Patchworks dashboard.
Step 1 Create a POST request for the following endpoint:
This endpoint is for the Patchworks production environment.
Step 2 In the request body, add the email and password that you use to log into the Patchworks dashboard. You should add this as JSON - for example:
Step 3 Send the request - if successful, a token is returned. For example:
Access tokens are valid for 24 hours - for example: Issued: Wednesday 20th July at 10:03:08 GMT Expires: Tuesday 21st July at 10:03:08 GMT
Having obtained a Patchworks token, it can be applied to an API request to initialise a process flow with your data passed in the request body.
Step 1 Create a POST request for the following endpoint:
This endpoint is for the Patchworks production environment.
Step 3
In the request body
, pass in the required payload - for example:
Step 4
Send the request - if successful, a 200 'flow initialised' response is given, together with a flow run id
:
Step 4 Save this token ready for use in your .
You must control when your API requests are sent - the process flow schedule cannot currently be used. With this in mind, please ensure that the default trigger shape in your process flow is not configured with any schedules.
...replacing <flowID>
and <flowVERSION>
with details for your required process flow noted .
Step 2
In the request headers
, pass in the token obtained - this should be prefixed with the word Bearer
- for example:
Remember that the payload must be provided as a JSON object with a payload key containing a string of data. For more information please see .
You can check the status of this flow run via the .