Boa tarde,
Estou tentando utilizar a API descrita no link https://docs.blip.ai/#get-last-threads para consultar as threads e mensagens do bot.
A API está retornando as mensagens mas as threads estão sempre vazias, estou fazendo a requisição de threads de forma incorreta?
Requisição de threads
{
"id": "a7a8fd50-a69d-41ca-8120-d04e5e516537",
"method": "get",
"uri": "/threads"
}
Resposta
{
"type": "application/vnd.lime.collection+json",
"resource": {
"itemType": "application/vnd.iris.thread+json",
"items": e]
},
"method": "get",
"status": "success",
"id": "a7a8fd50-a69d-41ca-8120-d04e5e516537",
"from": "[email protected]/#az-iris5",
"to": "[email protected]",
"metadata": {
"#command.uri": "lime://[email protected]/threads"
}
}
Requisição de mensagens
{
"id": "a7a8fd50-a69d-41ca-8120-d04e5e516537",
"method": "get",
"uri": "/threads/[email protected]?$take=1"
}
Resposta
{
"type": "application/vnd.lime.collection+json",
"resource": {
"total": 1,
"itemType": "application/vnd.iris.thread-message+json",
"items": i
{
"id": "aa79fbde-f014-45e8-85f1-283b08fa310b",
"direction": "sent",
"type": "text/plain",
"content": "Desculpe, não consegui entender!",
"date": "2019-08-27T15:40:16.274Z",
"status": "consumed",
"metadata": {
"#stateName": "Erro padrão",
"#stateId": "error",
"#messageId": "62d98ce5-7849-4a88-9971-9b0756ce20be",
"$originator": "[email protected]",
"$claims": "[email protected]/az-lx-hosting1;[email protected];DomainRole=Member;AuthenticationScheme=Transport",
"$internalId": "8f87f0d4-81f0-47c0-bf2a-8dd49486c363",
"$originatorSessionRemoteNode": "[email protected]/#az-lx-hosting1",
"#messageKind": "Response"
}
}
]
},
"method": "get",
"status": "success",
"id": "a7a8fd50-a69d-41ca-8120-d04e5e516537",
"from": "[email protected]/#az-iris4",
"to": "[email protected]",
"metadata": {
"#command.uri": "lime://[email protected]/threads/[email protected]?$take=1"
}
}