Skip to content

Developers · Notifications and Email

Parsing an API Response

Last updated 2 November 2026

This guide discusses how to parse an API response.

In this example, you will store part of the response in a Database Field for later reference using GraphQL mutations in , since you can access the response body via .

The tutorial assumes the API returns JSON like:

{
  "third_party_api_id": "id-1"
}

It is also assumes that you want to store the value (which is ).

Prerequisites

To follow the steps in this tutorial, you must understand the concept of Users and Database Fields. It is assumed that you have already created the User Profile and API Call Notification in the previous tutorials.

Steps

Parsing an API response is a four-step process:

  • Step 1: Create a Database Field (Property)
  • Step 2: Add a GraphQL mutation
  • Step 3: Create a Form
  • Step 4: Extend the API Call Notification with a callback

Step 1: Create a Database Field (Property)

First, add a property named to the user profile named .

Step 2: Add a GraphQL mutation

Add GraphQL mutation:

app/graphql/store_third_party_api_id.graphql

mutation store_third_party_api_id($user_id: ID!, $third_party_api_id: String!) {
  user_update(
    id: $user_id
    user: {
      profiles: [
        {
          name: "default",
          values: {
            properties: [{ name: "third_party_api_id", value: $third_party_api_id }]
          }
        }
      ]
    }
    form_name: "callback_third_party_api_id"
  ) {
    id
  }
}

Step 3: Create a Form

The mutation you created provides input for the Form called , so create this Form:

app/forms/callback_third_party_api_id.liquid

---
resource: User
fields:
  profiles:
    default:
      properties:
        third_party_api_id:
---

Step 4: Extend the API Call Notification with a callback

Extend the API Call Notification by adding the proper callback, which executes the mutation with the input received from the third-party API:

app/api_calls/ping_example_com_on_user_sign_up.liquid

---
to: "https://example.com/endpoint/{{ form.id }}"
callback: "{%- assign response_json = response.body | parse_json -%}{% graphql res = 'store_third_party_api_id', user_id: form.id, third_party_api_id: response_json.third_party_api_id %}"
---