Fetch Thread
curl --request GET \
--url https://sitegpt.ai/api/v0/chatbots/{chatbotId}/threads/{threadId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://sitegpt.ai/api/v0/chatbots/{chatbotId}/threads/{threadId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://sitegpt.ai/api/v0/chatbots/{chatbotId}/threads/{threadId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sitegpt.ai/api/v0/chatbots/{chatbotId}/threads/{threadId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sitegpt.ai/api/v0/chatbots/{chatbotId}/threads/{threadId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sitegpt.ai/api/v0/chatbots/{chatbotId}/threads/{threadId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sitegpt.ai/api/v0/chatbots/{chatbotId}/threads/{threadId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Fetched the thread successfully",
"data": {
"thread": {
"threadId": "06b3b43c-5651-49a2-b618-d7f24667c1b6",
"mode": "AI",
"messages": [
{
"messageId": "365062948587045457",
"question": {
"text": "Hello, what is this?",
"timestamp": "2023-05-18T11:40:07.857030Z"
},
"answer": {
"text": "Hello! I am an AI assistant designed to provide information about the website's content. If you have any specific questions, feel free to ask and I will do my best to provide accurate answers.",
"timestamp": "2023-05-18T11:40:07.857030Z"
},
"reaction": "NEUTRAL",
"sources": [],
"messageType": "NORMAL_MESSAGE",
"systemMessageType": "CONVERSATION_ESCALATED",
"iconUrl": null,
"prompts": [],
"gptModel": "gpt-3.5-turbo"
},
{
"messageId": "365064286366597712",
"question": {
"text": "Hi",
"timestamp": "2023-05-18T12:01:23.667033Z"
},
"answer": null,
"reaction": "NEUTRAL",
"sources": [],
"messageType": "USER_MESSAGE",
"systemMessageType": "CONVERSATION_ESCALATED",
"iconUrl": null,
"prompts": [],
"gptModel": "gpt-3.5-turbo"
},
{
"messageId": "365064310572974672",
"question": null,
"answer": {
"text": "YO",
"timestamp": "2023-05-18T12:01:46.751791Z"
},
"reaction": "NEUTRAL",
"sources": [],
"messageType": "AGENT_MESSAGE",
"systemMessageType": "CONVERSATION_ESCALATED",
"iconUrl": null,
"prompts": [],
"gptModel": "gpt-3.5-turbo"
}
],
"startedAt": "2023-05-18T11:39:57.349750Z",
"updatedAt": "2023-05-18T11:39:57.349750Z",
"webhookUrl": "https://hooks.zapier.com/hooks/catch/15695697/3hqs23e",
"totalMessagesRead": 47,
"chatUserId": null,
"chatbotId": "365062873485935184",
"chatUser": null
}
}
}{
"success": false,
"message": "Failed to fetch the chatbot thread",
"data": null,
"error": {
"code": "THREAD_ID_REQUIRED",
"message": "threadId field is required",
"details": null
}
}{
"success": false,
"message": "Failed to fetch the chatbot thread",
"error": {
"code": "API_KEY_NOT_VALID",
"message": "Authorization header does not contain valid API key",
"details": null
}
}{
"success": false,
"message": "Failed to fetch the chatbot thread",
"data": null,
"error": {
"code": "FETCH_CHATBOT_THREAD_FORBIDDEN",
"message": "You are not authorized to fetch this chatbot thread",
"details": null
}
}{
"success": false,
"message": "Failed to fetch the chatbot thread",
"data": null,
"error": {
"code": "CHATBOT_THREAD_NOT_FOUND",
"message": "Chatbot thread does not exist for threadId=1234567890",
"details": null
}
}{
"success": false,
"message": "Failed to fetch the chatbot thread",
"data": null,
"error": {
"code": "REQUEST_METHOD_NOT_ALLOWED",
"message": "PATCH request method is not allowed",
"details": null
}
}{
"success": false,
"message": "Failed to fetch the chatbot thread",
"data": null,
"error": {
"code": "FETCH_CHATBOT_THREAD_FAILED",
"message": "Some technical error has occurred !!",
"details": null
}
}Threads
Fetch Thread
Fetch a single thread of the chatbot
GET
/
v0
/
chatbots
/
{chatbotId}
/
threads
/
{threadId}
Fetch Thread
curl --request GET \
--url https://sitegpt.ai/api/v0/chatbots/{chatbotId}/threads/{threadId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://sitegpt.ai/api/v0/chatbots/{chatbotId}/threads/{threadId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://sitegpt.ai/api/v0/chatbots/{chatbotId}/threads/{threadId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sitegpt.ai/api/v0/chatbots/{chatbotId}/threads/{threadId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sitegpt.ai/api/v0/chatbots/{chatbotId}/threads/{threadId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sitegpt.ai/api/v0/chatbots/{chatbotId}/threads/{threadId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sitegpt.ai/api/v0/chatbots/{chatbotId}/threads/{threadId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Fetched the thread successfully",
"data": {
"thread": {
"threadId": "06b3b43c-5651-49a2-b618-d7f24667c1b6",
"mode": "AI",
"messages": [
{
"messageId": "365062948587045457",
"question": {
"text": "Hello, what is this?",
"timestamp": "2023-05-18T11:40:07.857030Z"
},
"answer": {
"text": "Hello! I am an AI assistant designed to provide information about the website's content. If you have any specific questions, feel free to ask and I will do my best to provide accurate answers.",
"timestamp": "2023-05-18T11:40:07.857030Z"
},
"reaction": "NEUTRAL",
"sources": [],
"messageType": "NORMAL_MESSAGE",
"systemMessageType": "CONVERSATION_ESCALATED",
"iconUrl": null,
"prompts": [],
"gptModel": "gpt-3.5-turbo"
},
{
"messageId": "365064286366597712",
"question": {
"text": "Hi",
"timestamp": "2023-05-18T12:01:23.667033Z"
},
"answer": null,
"reaction": "NEUTRAL",
"sources": [],
"messageType": "USER_MESSAGE",
"systemMessageType": "CONVERSATION_ESCALATED",
"iconUrl": null,
"prompts": [],
"gptModel": "gpt-3.5-turbo"
},
{
"messageId": "365064310572974672",
"question": null,
"answer": {
"text": "YO",
"timestamp": "2023-05-18T12:01:46.751791Z"
},
"reaction": "NEUTRAL",
"sources": [],
"messageType": "AGENT_MESSAGE",
"systemMessageType": "CONVERSATION_ESCALATED",
"iconUrl": null,
"prompts": [],
"gptModel": "gpt-3.5-turbo"
}
],
"startedAt": "2023-05-18T11:39:57.349750Z",
"updatedAt": "2023-05-18T11:39:57.349750Z",
"webhookUrl": "https://hooks.zapier.com/hooks/catch/15695697/3hqs23e",
"totalMessagesRead": 47,
"chatUserId": null,
"chatbotId": "365062873485935184",
"chatUser": null
}
}
}{
"success": false,
"message": "Failed to fetch the chatbot thread",
"data": null,
"error": {
"code": "THREAD_ID_REQUIRED",
"message": "threadId field is required",
"details": null
}
}{
"success": false,
"message": "Failed to fetch the chatbot thread",
"error": {
"code": "API_KEY_NOT_VALID",
"message": "Authorization header does not contain valid API key",
"details": null
}
}{
"success": false,
"message": "Failed to fetch the chatbot thread",
"data": null,
"error": {
"code": "FETCH_CHATBOT_THREAD_FORBIDDEN",
"message": "You are not authorized to fetch this chatbot thread",
"details": null
}
}{
"success": false,
"message": "Failed to fetch the chatbot thread",
"data": null,
"error": {
"code": "CHATBOT_THREAD_NOT_FOUND",
"message": "Chatbot thread does not exist for threadId=1234567890",
"details": null
}
}{
"success": false,
"message": "Failed to fetch the chatbot thread",
"data": null,
"error": {
"code": "REQUEST_METHOD_NOT_ALLOWED",
"message": "PATCH request method is not allowed",
"details": null
}
}{
"success": false,
"message": "Failed to fetch the chatbot thread",
"data": null,
"error": {
"code": "FETCH_CHATBOT_THREAD_FAILED",
"message": "Some technical error has occurred !!",
"details": null
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Id of the chatbot
Id of the chatbot thread
Query Parameters
Parameter to identify if messages needs to be returned or not
Parameter to identify if chat user details needs to be returned or not
Was this page helpful?
⌘I