Limit Sending Messages
The app.neoagent.co API allows you to set the maximum number of messages sent per session by sending a POST request to the /chat/Chatbot/SetSessionMessagesLimit endpoint.
Endpoint
Request URL: https://app.neoagent.co/chat/Chatbot/SetSessionMessagesLimit
Method: POST
Required Headers
The API request must include the following headers:
Authorization: <Your-Secret-Key>- string, required - The secret key for authenticating the API request
Request Examples
- JavaScript (Fetch API)
- Python (Requests)
- cURL
- HTTP Raw
const res = await fetch('https://app.neoagent.co/chat/Chatbot/SetSessionMessagesLimit', {
method: 'POST',
headers: {
"Authorization": "<Your-Session-Key>"
},
body: JSON.stringify({
"MessagesLimit": 100
})
});
const data = await res.json();
console.log(data);
import requests
import json
url = 'https://app.neoagent.co/chat/Chatbot/SetSessionMessagesLimit'
headers = {
"Authorization": "<Your-Session-Key>"
}
data = {
"MessagesLimit": 100
}
response = requests.post(url, headers=headers, json=data)
data = response.json()
print(data)
curl 'https://app.neoagent.co/chat/Chatbot/SetSessionMessagesLimit' \
-X POST \
-H 'Authorization: <Your-Session-Key>' \
-d '{"MessagesLimit":100}'
POST /chat/Chatbot/SetSessionMessagesLimit HTTP/1.1
Host: app.neoagent.co
Authorization: <Your-Session-Key>
{
"MessagesLimit": 100
}
Response
The API response will be a JSON object with the following structure:
{
// boolean - Success status
"Data": true,
// 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:
- Check the HTTP status code for network-level errors
- Examine the
CodeandMessagefields in the response for business-level errors - The
Messagefield will contain detailed information about the error