import requests
api_key = “d4b08ebe-14b1-4342-a6b9-f4b8c781e287”
chat_session = requests.post(
‘https://agentivehub.com/api/chat/session’,
json = {
“api_key” : “api_key”,
“assistant_id” : “4a86b342-22a4-4c7f-9dfe-ba3021e0b754”,
}
)
# Get the chat session ID
chat_session_id = chat_session.json()[“session_id”]
# Send a message to the chat session
chat_response = {
“api_key” : api_key,
“session_id” : chat_session_id,
“type” : “custom_code”,
“assistant_id” : “4a86b342-22a4-4c7f-9dfe-ba3021e0b754”,
“messages” : [{“role”: “user”, “content”: “Say Hello!”}]
}
req = requests.post(
‘https://agentivehub.com/api/chat’,
json = chat_response
)
resp = req.json()