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

  1. Locate the part of your case management system (Backend? Automation platform like Zapier?) that creates the tasks
  2. Format the data into a JSON that respects the Task Data Model. You usually need to specify the url, id, title and some tags to get started.
  3. 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

https://zapier.com

There are 2 options to integrate with Zapier.

  1. The first option is to use the Custom Request Webhook via Zapier.
  2. The second option is to use the Code Action from Zapier (available in Python and JavaScript flavors).

Screenshot 2023-07-27 at 21.20.01.png

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.

Screenshot 2023-07-27 at 21.22.08.png

  1. Create new Zap
  2. Add a Google Sheet Trigger on New or Updated Row.

Screenshot 2023-07-27 at 21.24.39.png

  1. 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

      Screenshot 2023-07-27 at 21.46.53.png

  2. Navigate to the Fragment dashboard, you should now see the tasks !

Screenshot 2023-07-27 at 21.34.11.png

Make

https://www.make.com

The best option to integrate with Make is to create an HTTP action.

Let’s see an example : from Google sheet → Fragment

Screenshot 2023-07-27 at 21.36.33.png

Let’s say you have a Google spreadsheet named make-demo with one sheet named Sheet 1.

Screenshot 2023-07-27 at 21.22.08.png

  1. Create a Search Rows Google Sheets trigger

  2. 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

Screenshot 2023-07-27 at 21.44.36.png

  1. 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

      Screenshot 2023-07-27 at 21.49.16.png

  2. Navigate to the Fragment dashboard, you should now see the tasks

    Screenshot 2023-07-27 at 21.34.11.png

n8n

https://n8n.io

The best way to integrate with n8n is to use the HTTP request node.

Let’s see an example : from Google sheet → Fragment

Screenshot 2023-07-27 at 21.50.28.png

Let’s say you have a Google spreadsheet named make-demo with one sheet named Sheet 1.

Screenshot 2023-07-27 at 21.22.08.png

  1. Create a Google Sheet Trigger on rowAdded

  2. 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

      Screenshot 2023-07-27 at 21.52.19.png

  3. 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 }}

Screenshot 2023-07-27 at 21.54.30.png

Screenshot 2023-07-27 at 21.55.26.png

Pro Tip to debug on n8n : open View > Developer Tools > Console. You should see the requests made by the HTTP node.

  1. Navigate to the Fragment dashboard, you should now see the tasks

    Screenshot 2023-07-27 at 21.34.11.png

HubSpot

There are 2 options to integrate with HubSpot

Option 1 (no code) Use Workflows + Zapier

  1. Connect Zapier to HubSpot
  2. Create a workflow on HubSpot that sends a trigger on Zapier
  3. Configure your Zapier to send tasks to Fragment (see above)

Option 2 (native) Use Fragment’s native HubSpot integration

  1. Create Private app

    1. Go to settings > Integrations > Private Apps

      Screenshot 2023-07-27 at 22.02.23.png

    2. Click on “create a private App”, pick the name Fragment

    3. Configure the following scopes

      Screenshot 2023-07-27 at 22.04.07.png

    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 frequencyinstant1 minute
HubSpot Entitiesalltasks
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