Retrieve Session
curl --request GET \
--url https://www.ninjachat.ai/api/v1/sessions/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.ninjachat.ai/api/v1/sessions/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://www.ninjachat.ai/api/v1/sessions/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"session_id": "<string>",
"messages": [
{
"content": "<string>"
}
],
"message_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
},
"message": "<string>",
"code": "<string>",
"request_id": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
},
"message": "<string>",
"code": "<string>",
"request_id": "<string>"
}Sessions
Retrieve Session
Get the full message history and metadata for a session.
GET
/
api
/
v1
/
sessions
/
{id}
Retrieve Session
curl --request GET \
--url https://www.ninjachat.ai/api/v1/sessions/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.ninjachat.ai/api/v1/sessions/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://www.ninjachat.ai/api/v1/sessions/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"session_id": "<string>",
"messages": [
{
"content": "<string>"
}
],
"message_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
},
"message": "<string>",
"code": "<string>",
"request_id": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
},
"message": "<string>",
"code": "<string>",
"request_id": "<string>"
}⌘I