Get Google Sheet Data
The API enables the retrieval of google sheet source data for a specified chatbot by sending a
GET
request to the /chat/Chatbot/GetGoogleGoolgeSheetData
endpoint.
⚠️ Attention: This API is only compatible with regular chatbots and is not yet compatible with template-based chatbots.
Endpoint
Request URL: https://usapi.hottask.com/chat/Chatbot/GetGoogleGoolgeSheetData
Method: GET
Request Headers
The API request must include the following headers:
Authorization: <Your-Secret-Key>
- string, required - The secret key for authenticating the API requestContent-Type: application/json
- string, required - The content type of the request payload (must be application/json)
Request Body
The request body should contain the following parameters:
{
// string, required - The unique identifier (ID) of the chatbot
"serialNumber": "3254a9d0424c4806b9ea3d0763xxxxxx",
// array of integers, optional - List of data IDs to retrieve
"ids": [
1,
2
],
// integer, optional - The maximum number of items to return per page, default is 10
"pageSize": 10,
// integer, optional - The page number to retrieve, default is 1
"pageNumber": 1,
// boolean, optional - Indicates whether the results should be sorted in ascending order, default is true
"isASC": true
}
serialNumber
- string, required - The unique identifier (ID) of the chatbotids
- array of integers, optional - List of data IDs to retrievepageSize
- integer, optional - The maximum number of items to return per page, default is 10pageNumber
- integer, optional - The page number to retrieve, default is 1isASC
- boolean, optional - Indicates whether the results should be sorted in ascending order, default is true
Example Request
JavaScript (Fetch API)
const res = await fetch('https://usapi.hottask.com/chat/Chatbot/GetSource', {
method: 'GET',
headers: {
"Authorization": "<Your-Secret-Key>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"serialNumber": "3254a9d0424c4806b9ea3d0763xxxxxx"
})
});
const data = await res.json();
console.log(data);
Python (Requests Library)
import requests
import json
url = 'https://usapi.hottask.com/chat/Chatbot/GetSource'
headers = {
"Authorization": "<Your-Secret-Key>",
"Content-Type": "application/json"
}
data = {
"serialNumber": "3254a9d0424c4806b9ea3d0763xxxxxx"
}
response = requests.get(url, headers=headers, json=data)
data = response.json()
print(data)
cURL
curl 'https://usapi.hottask.com/chat/Chatbot/GetSource' \
-X GET \
-H 'Authorization: <Your-Secret-Key>' \
-H 'Content-Type: application/json' \
-d '{"serialNumber":"3254a9d0424c4806b9ea3d0763xxxxxx"}'
HTTP Request
GET /chat/Chatbot/GetSource HTTP/1.1
Host: usapi.hottask.com
Authorization: <Your-Secret-Key>
Content-Type: application/json
{
"serialNumber": "3254a9d0424c4806b9ea3d0763xxxxxx"
}
Response
The API response will be a JSON object with the following structure:
{
// object - Represents the paginated query results.
//In each list item, the ID field serves as the unique identifier for every data row.
//It's important to note that fields like url, name, productname, and price are dynamic custom fields.
//Their definitions and values are determined by the user, and can be adjusted according to specific requirements.
"Data": {
"List": [
{
"ID": 1,
"url": "XXXXX",
"name": "xiaomi",
"productname": "xiaomi 16",
"price": 999
},
{
"ID": 2,
"url": "XXXXX",
"name": "apple",
"productname": "iphone 16 pro max",
"price": 999
}
],
"VirtualCount": 2
},
// string - API version
"Version": "1.0.0",
// boolean - Operation success status
"Success": true,
// integer - HTTP status code
"Code": 200,
// string - Error message if any
"Message": ""
}
Error Handling
If the request fails, you should:
1. Check the HTTP status code for network-level errors
2. Examine the `Code` and `Message` fields in the response for business-level errors
3. The `Message` field will contain detailed error information