Developer Platform
  • Home
  • Getting Started
    • General Information
    • Features Overview
    • Security
  • APPs
    • Public Apps
      • Shopify
      • Salesforce
      • Zendesk
      • Google Analytics
    • Build your App
      • Getting started
      • My Apps
      • App information
      • App Parameters
      • App Plugins
      • Add Webhooks
      • Submit your Apps
      • App security
      • Developer Policy
  • Use Cases
    • Copilots
      • Product Catalog sync through API
      • FAQ sync through API
    • Visitor experience
      • Integrating custom buttons into your site
      • Check availability before escalating to iAdvize
      • Authenticated Messaging
        • Introduction
        • Web client-side implementation
          • Authenticated Messaging overview
          • Brief timeline of the integration process
          • How to enable authenticated mode in the administration portal?
          • How to implement the customer authentication backend (token provider)?
          • How to authenticate with iAdvize in client's website?
          • How to deal with activation success or failure?
          • How to logout?
          • Compatibility with Mobile SDK
          • FAQ
        • Web backend implementation
          • Important information and recommendations
          • Signature and Encryption Detailed Process
          • Technical backend implementation
          • FAQ
      • Cross-domain Conversation Continuity
      • Customize replies with Markdown
    • Agent workspace
      • Custom App example and step-by-step tutorial
        • Get Started
        • Work with the Desk
        • Intent / Trigger
        • JWT
        • References
    • Administration
      • Users
        • SAML SSO Authentication - Implementation Guide
        • Create, update and delete users via API
        • Manage the availability of your users with the iAdvize API
        • Integrate the iAdvize conversation panel into an existing tool
    • Data & Analytics
      • Anonymize a conversation or visitor data
      • Create a custom dashboard
      • Find contact data using GraphQL
      • Retrieve conversations data
      • Retrieve messages exchanged within a conversation
  • Technologies
    • GraphQL API
      • Terminology
      • Reference
      • Authentication
      • Schema lifecycle
      • Error Management
      • Pagination
    • REST API (deprecated)
      • Statistic (deprecated)
      • Group (deprecated)
      • Call meeting (deprecated)
      • Operator (deprecated)
      • Skill (deprecated)
      • Transaction (deprecated)
      • Visitor (deprecated)
    • Webhooks
      • Reference
      • Guides
    • Desk events
      • Reference
    • Web & Mobile SDK
      • Javascript Web SDK
        • Reference
      • Javascript Callbacks
        • Reference
        • Guides
      • Mobile SDK
        • Fourme (latest)
        • Epoisses
        • Dauphin
        • Cantal
        • 🤝Support Policy
        • 🤔Frequently Asked Questions
    • Custom App
    • External Bot
      • Implementation
        • Configuration flow
        • Conversation flow
        • Conversation objects
      • Configuration
      • FAQ
      • Best practices
Powered by GitBook
On this page
  • Introduction
  • Step 1: Recommended: Configure a product id custom data
  • Step 2: Create a new KnowledgeSource
  • Step3: Synchronize your products with us
  • Create or update a product
  • Delete a product

Was this helpful?

  1. Use Cases
  2. Copilots

Product Catalog sync through API

This page will describe how you can use our GraphQL API to synchronize product catalog AI Knowledge with your systems, with the aim to use this knowledge in your generative AI bots.

PreviousCopilotsNextFAQ sync through API

Last updated 9 months ago

Was this helpful?

Introduction

This feature allows to keep knowledge about products up to date, by allowing you to send updates, creations and deletion operations about the product information your system holds. Upon receiving these events, we'll index the new knowledge such that your bot can use the very latest information to answer your visitors' questions.

To do so, we'll look into how you can create a knowledge source (your product catalog), and insert, update and delete knowledge items (your products information).

Step 1: Recommended: Configure a product id custom data

Although this step is optional, we highly recommend you take the time to properly configure the custom data that holds the product id. This will enable the generative AI bots to automatically fetch the relevant product information based on the visitor's current page.

You'll find an article describing Take note of the custom data variable name, it will be useful during step 2.

Step 2: Create a new KnowledgeSource

This operation will only need to be done once, therefore there is no need to write any code for it.

It consists in using GraphQL to create a new KnowledgeSource, and taking note of the identifier that was attributed to it. This identifier will be used during step 3.

You can open the GraphQL mutation . You'll need to:

  • Be logged in as an administrator.

  • Replace the variables in the bottom panel with the identifier of your project, the name of the knowledge you're about to create ("API sync product catalog" for instance), and put the name of the custom data variable.

  • Execute the query by clicking the KnowledgeSourceCreate blue button

  • Write down the identifier of the KnowledgeSource that will appear in the right panel

Graphql Mutation
mutation KnowledgeSourceCreate(
  $knowledgeSourceCreateInput: KnowledgeSourceCreateInput!
) {
  knowledgeSourceCreate(knowledgeSourceCreateInput: $knowledgeSourceCreateInput) {
    knowledgeSource {
      id
      name
    }
  }
}
Variables
{
  "knowledgeSourceCreateInput": {
    "details": {
      "productApiSync": {
        "customDataName": "<custom data name>"
      }
    },
    "name": "<name>",
    "projectId": <project id>
  }
}

Step3: Synchronize your products with us

Now you have a KnowledgeSource, you can add, update or delete items within that source. In order to do this, you'll need to react to events within your system and call our GraphQL API.

Create or update a product

You can use this mutation, bearing in mind you can submit up to 20 products in a single mutation.

If you are upserting a lot of products or a whole catalog, please comply with the 50 request per second rate limit.

Mutation
mutation KnowledgeProductUpsert($input: KnowledgeProductsUpsertInput!) {
  knowledgeProductsUpsert(input: $input) {
    knowledgeSource {
      name
    }
    upsertedProducts {
      productId
      status
    }
  }
}
Variables
{
  "input": {
    "knowledgeSourceId": "<id from step 2>",
    "products": [
      {
        "id": "<product id in your system>",
        "availability": "IN_STOCK",
        "availabilityDate": "2024-01-09",
        "brand": "my brand",
        "color": "blue",
        "condition": "NEW",
        "description": "this is my product description",
        "gender": "UNISEX",
        "imageLink": "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png",
        "additionalImageLink": "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png",
        "itemGroupId": "my group id",
        "link": "https://www.google.com",
        "material": "cotton",
        "price": {
          "currency": "EUR",
          "value": "120.00"
        },
        "productTypes": [
          "t-shirt",
          "polo"
        ],
        "size": "XL",
        "title": "my product title",
        "productDetails": [
          {
            "attributeName": "my detail name",
            "attributeValue": "my detail value"
          }
        ],
        "salePrice": {
          "currency": "EUR",
          "value": "2.0"
        }
      }
    ]
  }
}

Expected values

Some fields require defined values. Here's what's required:

  • availability : IN_STOCK, OUT_OF_STOCK, PREORDER, BACKORDER

  • condition : NEW, REFURBISHED, USED

  • gender : MALE, FEMALE, UNISEX

Delete a product

Mutation
mutation ($input: KnowledgeProductsDeleteInput!) {
  knowledgeProductsDelete(input: $input) {
    knowledgeSource {
      name
    }
    deletedProducts {
      productId
      status
    }
  }
}
Variables
{
  "input": {
    "knowledgeSourceId": "<id from step 2>",
    "productIds": ["<product id in your system>"]
  }
}

If you are requesting our GraphQL API directly, do not forget to first

You'll find more information about the .

how to set up a custom data here.
by clicking on this link
get your GraphQL token
definition of each fields in our static graphql documentation