Getting Started

Making Requests

Published @ 16/11/23 by

author Fatos
Fatos, Founder @ answerly.io

The Answerly API accepts application/json as a body. It does not require any additional headers or configuration.

Here is an example request that initiates a conversation with an agent:

curl --request POST \
  --url https://ai.api.answerly.io/chat/ \
  --header 'Content-Type: application/json' \
  --data '{
  "message": "what is answerly",
  "agentId": "YOUR_AGENT_ID",
  "conversationId":"YOUR_CONVERSATION_ID",
  "channel": "web",
  "responseStyle": "html",
  "actionRequest": {
    "name": "conversational"
  }
}

Here is an example response from the server:

{
    "status": true,
    "data": {
      "conversationId": "???",
      "messages": [
        "Answerly is an AI powered agent platform.",
        "We provide instant customer support 24/7 to businesses."
      ],
      "actionResponse": {
        "name": "conversational"
      },
      "meta": {
        "tokens": {
          "conversational": 556,
          "functional": 143,
          "embeddings": 4
        },
        "source": [
          {
            "dataItemId": "???",
            "cosineDistanceScore": 0.18312443394210398
          }
        ]
      }
    }
  }