Integrations
Check here to see how to integrate Fragment in your workflows.
We want to make integration as easy as possible.
The first goal of the integration is to be able to synchronise tasks from your existing case management system with Fragment.
We offer multiple options. If there is an issue, let us know, we want to help our first customers integrate.
API
This method is the most versatile. You can integrate with the API or via “low-code” tools like Zapier.
To integrate via the API, follow the following steps
- Locate the part of your case management system (Backend? Automation platform like Zapier?) that creates the tasks
- Format the data into a JSON that respects the Task Data Model. You usually need to specify the
url
,id
,title
and sometags
to get started. - Make a PATCH request to
/v0/tasks/
endpoint
An example in Python would be
import requests
# 1. Retrieve task information
task = {
"id": "1",
"url": "https://google.com",
"name": "Google",
"category": "test",
"priority": "low"
}
# 2. Format
formatted = {
"id": task["id"],
"url": task["url"]
"title": task["name"]
"tags": {
"name": task["name"]
"category": task["category"]
"priority": task["priority"]
}
}
# 3. Make PATCH request (UPSERT)
resp = requests.patch(
f"https://api.fragment.run/v0/tasks/",
headers={
"x-api-key": "9d0a33f69da2eb548ef5b47640169af1",
},
json=task,
)
if not resp.status_code == 200:
raise Exception("Fragment API issue")
Zapier
There are 2 options to integrate with Zapier.
- The first option is to use the Custom Request Webhook via Zapier.
- The second option is to use the
Code
Action from Zapier (available in Python and JavaScript flavors).
Here is an example using the Code
action (option 2) : from Google sheet → Fragment
Let’s say you have a Google spreadsheet named zapier-demo with one sheet named Sheet 1.
- Create new Zap
- Add a Google Sheet Trigger on New or Updated Row.
- Add a Code Step (see screensho). Configure the input data and make an HTTP API request.
-
See code
task = { "title": input_data["title"], "url": input_data["url"], "id": input_data["id"], "tags": { "category": input_data["category"], "name": input_data["name"], "priority": input_data["priority"], } } resp = requests.put( f"https://api.fragment.run/v0/tasks/", headers={ "x-api-key": "9d0a33f69da2eb548ef5b47640169af1", }, json=task, ) if not resp.status_code == 200: raise Exception(resp) return resp.json()
-
See screenshot
-
- Navigate to the Fragment dashboard, you should now see the tasks !
Make
The best option to integrate with Make is to create an HTTP action.
Let’s see an example : from Google sheet → Fragment
Let’s say you have a Google spreadsheet named make-demo with one sheet named Sheet 1.
-
Create a
Search Rows
Google Sheets trigger -
Add a
JSON
action to format the flat data into a proper JSON. This action enables you to define a schema for your data and is thus robust.In our case, let’s adopt a simple data structure that fits the Task Data Model
-
Add an HTTP action node. Make sure to
-
Select the
PATCH
method -
Enter the header
x-api-key
for authentication -
Fill the request content by selecting the output of the JSON step
-
-
Navigate to the Fragment dashboard, you should now see the tasks
n8n
The best way to integrate with n8n is to use the HTTP request node.
Let’s see an example : from Google sheet → Fragment
Let’s say you have a Google spreadsheet named make-demo with one sheet named Sheet 1.
-
Create a Google Sheet Trigger on
rowAdded
-
Transform the data with a Code block (example below)
-
See Code (Javascript)
// Loop over input items and add a new field called 'myNewField' to the JSON of each one for (const item of $input.all()) { const new_item = { id: item.json.id, title: item.json.title, url: item.json.url, tags: { category: item.json.category, priority: item.json.priority, name: item.json.name, } }; item.json = new_item; } return $input.all();
-
See Screenshot
-
-
Add an HTTP node
Make sure to
- Select method
PATCH
- Include the header
x-api-key
- Retrieve the body from the previous step (already formatted) with
{{ $json }}
- Select method
Pro Tip to debug on n8n : open View > Developer Tools > Console. You should see the requests made by the HTTP node.
-
Navigate to the Fragment dashboard, you should now see the tasks
HubSpot
There are 2 options to integrate with HubSpot
Option 1 (no code) Use Workflows + Zapier
- Connect Zapier to HubSpot
- Create a workflow on HubSpot that sends a trigger on Zapier
- Configure your Zapier to send tasks to Fragment (see above)
Option 2 (native) Use Fragment’s native HubSpot integration
-
Create Private app
-
Go to settings > Integrations > Private Apps
-
Click on “create a private App”, pick the name
Fragment
-
Configure the following scopes
d. Share the access token with us
e. We activate the sync on our side. It will poll your HubSpot to get all recent changes every minute.
-
Comparison between HubSpot integrations
1. No Code (Zapier) | 2. Native | |
---|---|---|
Update frequency | instant | 1 minute |
HubSpot Entities | all | tasks |
Webhooks* | (yes)** | yes |
Watch for deletion | ? | partial |
*Webhooks : task status changes (ex: assigned, done) are pushed to HubSpot
**(yes) : requires to configure the tasks payload with integration info, see with us