Fragment works best when it’s connected to the source of truth, your back-office. Fragment only needs to retrieve the backlog of tasks with metadata.
To jump right into the API docs, see the API integration guide.

Overview

We offer multiple options to sync with your data sources:
  1. Native integration: Hubspot, Zendesk, Slack, Intercom, Stripe, ComplyAdvantage…
  2. API integration: we grant you access to Fragment’s API.
  3. Custom integration: in cases where no other options is available, we offer custom integration on top of your internal APIs.
  4. No code integration: use workflow platforms like Zapier, n8n, Make, etc. to push tasks to the Fragment API using a custom HTTP action node.
Let’s dive into each of those possible integration methods.

Option 1: Native Integration

We have existing integrations with a bunch of SaaS products (Zendesk, HubSpot, Intercom, ComplyAdvantage, etc.) and can easily add new ones on demand. Depending on the capabilities of the SaaS API we integrate with, the Fragment integration will be able to ingest the data from there as well as push data to them. For example,
  • if you use HubSpot, completing a task on Fragment can close the HubSpot task
  • if you use Stripe, completing a task on Fragment can approve a Radar review
Please reach out if you want to integrate one of your existing 3rd party tools. We can easily add new ones on demand.

Option 2: API Integration

This method is the most versatile. You’re responsible for pushing data to the Fragment API when tasks are created, updated, or deleted. To integrate via the API, follow these steps
  1. Locate the part of your 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 due date of the task (due_at), and some fields to get started (title, url` + custom fields).
  3. Make a request to the POST /tasks endpoint
  4. Update the task with the PATCH /tasks endpoint.
See the API integration guide for more details.

Option 3: Custom Integration

In the situation where you have a custom tool you want to integrate with, but have no engineering resources and no alternatives, we offer custom integration services that depend on the complexity of the underlying integration. Here is how it typically works:
  1. Create a user for Fragment with the right permissions (read the backlog) and share an access token / API key with us.
  2. Every X minute (configurable, 5min by default), we refresh your backlog to fetch the open tasks.
  3. We close tasks not in the backlog anymore, and create new ones.
  4. (Incremental) We can also poll your system for recent changes to update tasks.
  5. Operators go through Fragment to complete tasks on their custom back-office.
There can be edge cases or custom work here, so please reach out to us if you need a custom integration.

Option 4: No-code integration

If the volume and the complexity of the setup is not too high, no-code tools like Zapier, Make, n8n, etc. can be a good fit. At a high-level, it typically works like this:
  1. Connect the no-code tool to your internal APIs / data
  2. Create a workflow that creates or updates tasks in Fragment when some trigger occurs.
This part of the documentation is not 100% up to date (authentication methods, etc.), but should give you a good starting point.

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. Configure the input data and make an HTTP API request.
    • See code
      task = {
          "fields": {
              "title": input_data["title"],
              "url": input_data["url"],
              "category": input_data["category"],
              "name": input_data["name"],
              "priority": input_data["priority"],
              "external_id": input_data["id"],
          }
      }
      resp = requests.post(
          "https://api.onfragment.com/api/v1/tasks",
          headers={
              "Authorization": f"Bearer {YOUR_API_TOKEN}",
              "Content-Type": "application/json",
              "User-Agent": "zapier/1.0",
          },
          json=task,
      )
      if not resp.status_code == 200:
          raise Exception(resp)
      return resp.json()
      
  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 POST method (or PUT for idempotent upserts)
    • Add an Authorization: Bearer <token> header
    • Add Content-Type: application/json
    • 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 = {
          fields: {
              title: item.json.title,
              url: item.json.url,
              category: item.json.category,
              priority: item.json.priority,
              name: item.json.name,
              external_id: item.json.id,
          }
        };
        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 POST (or PUT for idempotent upserts)
    • Include headers Authorization: Bearer <token> and Content-Type: application/json
    • 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