Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
All steps required to initialise a process flow via the Patchworks Core API are detailed below. This page provides a quick overview of these steps.
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.
Our full core API and associated documentation is available as a Postman collection - please see our Core API page for details. In this section we spotlight some common API functionality, including step-by-step tutorials.
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.
This section walks through the steps required to pass data from your own system into a Patchworks process flow, via the Patchworks API.
To complete these steps it's assumed that you have:
Registered for a Patchworks account and have a username and password to access your Patchworks dashboard
Built at least one process flow that you want to update via the Patchworks API
The required steps are detailed in the following stages:
Stage # | Action | Tool |
---|---|---|
In this guide we're using Postman for API calls - you can use your preferred tool for these steps.
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.
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.
Step 1 Create a POST request for the following endpoint:
...replacing <flowID>
and <flowVERSION>
with details for your required process flow noted .
This endpoint is for the Patchworks production environment.
Step 2
In the request headers
, pass in the token obtained - this should be prefixed with the word Bearer
- for example:
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 .
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 .
1
Your preferred text editor
2
Patchworks dashboard (process flows)
3
Patchworks dashboard (process flows)
4
Postman
5
Postman
The Patchworks API can be used to add and manage cross-reference lookups. Using the API you can work with:
All API requests must be authenticated with a Patchworks bearer token. To obtain a token, send a POST request to the following endpoint:
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:
A successful response returns a token. Tokens are valid for 24 hours.
For detailed information about obtaining tokens, please see Obtaining a token for Patchworks API authentication.
The Patchworks cross-reference lookup API accepts two identifiers as parameters:
Having selected a cross-reference lookup to view/edit, the unique id can be found at the end of the URL - for example:
Having selected a cross-reference lookup to view/edit, each existing lookup row is displayed with a unique valueId in the id column:
Parameter | Summary |
---|---|
At least one parameter must be passed into the request.
At least one parameter must be passed into the request.
{{id}}
The unique identifier associated with the cross-reference lookup.
{{valueID}}
The unique identifier associated with the cross-reference lookup row (also known as a mapping row).