API Reference

The FIY API uses REST. Our API has predictable resource-oriented URLs, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

The FIY API can change over time as we release updates to our services.

There are two key components to the API, Authentication and Querying. Every customer message that requires a response should be posted to the API as a Query.

POST
/v1/query
curl --location 'https://api.fiy.com/query' \
--header 'Content-Type: application/json' \
--header 'key: fiy_key_4eC39HqLyjWDarjtT1zdp7dc' \
--data '{
    "brand": "samsung",
    "product_number": "DW80B6060US",
    "conversation_id": "9ae5da0b-98cd-484c-96f2-ba2aefc12d43",
    "query": "Hi I need help troubleshooting my dishwasher. It'\''s making a loud rumbling noise when it runs"
}'
POST
/v1/ava/endpoint/ids
const axios = require('axios');
let data = JSON.stringify({
  "brand": "samsung",
  "product_number": "DW80B6060US",
  "conversation_id": "9ae5da0b-98cd-484c-96f2-ba2aefc12d43",
  "query": "Hi I need help troubleshooting my dishwasher. It's making a loud rumbling noise when it runs"
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.fiy.com/query',
  headers: { 
    'Content-Type': 'application/json', 
    'key': 'fiy_key_4eC39HqLyjWDarjtT1zdp7dc'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
POST
/v1/ava/endpoint/ids

package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.fiy.com/query"
  method := "POST"

  payload := strings.NewReader(`{
    "brand": "samsung",
    "product_number": "DW80B6060US",
    "conversation_id": "9ae5da0b-98cd-484c-96f2-ba2aefc12d43",
    "query": "Hi I need help troubleshooting my dishwasher. It's making a loud rumbling noise when it runs"
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("key", "fiy_key_4eC39HqLyjWDarjtT1zdp7dc")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
POST
/v1/ava/endpoint/ids

import requests
import json

url = "https://api.fiy.com/query"

payload = json.dumps({
  "brand": "samsung",
  "product_number": "DW80B6060US",
  "conversation_id": "9ae5da0b-98cd-484c-96f2-ba2aefc12d43",
  "query": "Hi I need help troubleshooting my dishwasher. It's making a loud rumbling noise when it runs"
})
headers = {
  'Content-Type': 'application/json',
  'key': 'fiy_key_4eC39HqLyjWDarjtT1zdp7dc'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
RESPONSE
{
  "conversation_id": "9ae5da0b-98cd-484c-96f2-ba2aefc12d43",
  "bot_response": "Hi there! Can you provide me with some more information? How long has your dishwasher been making that noise?"
}

Authentication

FIY uses API keys to authenticate your requests. You can obtain an API key when you complete onboarding onto the platform.

Your key will look like fiy_key_4eC39HqLyjWDarjtT1zdp7dc

Query Model

Your customer's messages can be passed to the FIY API as queries. Every conversation should include a uniquely generated conversation_id. We recommend using uuid v4 to generate this value.

Include the brand and product number if you have that information. It will improve the quality of the generated response.

Attributes
  • brand string

    The product manufacturer. This should represent that value you define as brand in your index.

  • conversation_id required

    A unique alphanumeric value to distinctly classify the conversations that are tied to a single conversation thread.

  • product_number string

    This takes an alphanumeric string, corresponds to whatever you define as product number in your index.

  • query string

    The customer's message or question.

POST
/v1/query
curl --location 'https://api.fiy.com/query' \
--header 'Content-Type: application/json' \
--header 'key: fiy_key_4eC39HqLyjWDarjtT1zdp7dc' \
--data '{
    "brand": "samsung",
    "product_number": "DW80B6060US",
    "conversation_id": "9ae5da0b-98cd-484c-96f2-ba2aefc12d43",
    "query": "Hi I need help troubleshooting my dishwasher. It'\''s making a loud rumbling noise when it runs"
}'
POST
/v1/query
const axios = require('axios');
let data = JSON.stringify({
  "brand": "samsung",
  "product_number": "DW80B6060US",
  "conversation_id": "9ae5da0b-98cd-484c-96f2-ba2aefc12d43",
  "customer query": "Hi I need help troubleshooting my dishwasher. It's making a loud rumbling noise when it runs"
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.fiy.com/v1/query',
  headers: { 
    'Content-Type': 'application/json', 
    'key': 'fiy_key_4eC39HqLyjWDarjtT1zdp7dc'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});