GetOutgoingStories#
The method returns the incoming story messages of the account. In the default mode the incoming story messages for 24 hours are returned.
Request#
To get incoming story messages, you have to execute a request at:
GET {{apiUrl}}/waInstance{{idInstance}}/getOutgoingStories/{{apiTokenInstance}}
For idInstance
, apiTokenInstance
and apiUrl
request parameters, refer to Before you start section.
URL request parameters#
Parameter | Type | Mandatory | Description |
---|---|---|---|
minutes | integer | No | time in minutes for which the story messages should be displayed (default is 1440 minutes) |
Response#
Response parameters#
Array of objects with parameters:
Parameter | Type | Description |
---|---|---|
idMessage | string | Incoming message Id |
timestamp | integer | Message acceptance time in UNIX format |
statusMessage | string | Outgoing message status, possible variants: |
pending - is sent | ||
sent - sent | ||
delivered - delivered | ||
read - read/seen/heard | ||
typeMessage | string | Message type, possible variants: |
textMessage - text message | ||
imageMessage - image message | ||
videoMessage - video message | ||
audioMessage - audio message | ||
chatId | string | Chat Id, where the message has been received |
senderId | string | Message sender Id |
senderName | string | Message sender name |
textMessage | string | Text message, if typeMessage =textMessage |
downloadUrl | string | Link to download a file, if typeMessage = imageMessage /videoMessage /documentMessage /audioMessage |
caption | string | File caption |
extendedTextMessage | object | Link data structure object |
quotedMessage | object | Quoted message data object. Present only if the message itself is a quote |
Parameters of extendedTextMessage
object:
Parameter | Type | Description |
---|---|---|
text | string | Link text |
description | string | Link description |
title | string | Link title |
previewType | string | Link preview type |
jpegThumbnail | string | base64 -coded image preview |
stanzaId | string | Quoted message ID |
participant | string | Recipient chat ID |
Response body example#
[
{
"idMessage": "DE8CFFA93B95237B077F8FA08331A0B5",
"timestamp": 1587129319,
"statusMessage": "read",
"typeMessage": "textMessage",
"senderId": "11001234567@c.us",
"senderName": "Nikolay",
"textMessage": "Hi"
},
{
"idMessage": "EA0BD1AE042DC4F3609867126309D67C",
"timestamp": 1587147598,
"statusMessage": "read",
"typeMessage": "imageMessage",
"senderId": "11001234567@c.us",
"senderName": "Nikolay",
"downloadUrl": "https://api.GREEN-API.com/waInstance1234/downloadFile/EA1BD1AE042DC4F3609867126309D67C",
"caption": "What do you think?"
},
{
"idMessage": "DE8CFFA93B95237B077F8FA08331A0B5",
"timestamp": 1587129319,
"statusMessage": "read",
"typeMessage": "extendedTextMessage",
"senderId": "71234567891@c.us",
"senderName": "Nikolay",
"extendedTextMessage": {
"text": "https://www.youtube.com/watch?v=9lO06Zxhu8*8*",
"description": "Video clip",
"title": "Cool video clip",
"previewType": "video",
"jpegThumbnail": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wB=="
}
}
]
GetOutgoingStories errors#
For a list of errors common to all methods, refer to Common errors section
Request examples#
import requests
url = "{{apiUrl}}/waInstance{{idInstance}}/getOutgoingStories/{{apiTokenInstance}}"
payload = {}
headers= {}
response = requests.request("GET", url, headers=headers, data = payload)
print(response.text.encode('utf8'))
curl --location '{{apiUrl}}/waInstance{{idInstance}}/getOutgoingStories/{{apiTokenInstance}}?minutes=3240'
var restTemplate = new RestTemplate();
var requestUrl = new StringBuilder();
requestUrl
.append({{apiUrl}})
.append("/waInstance").append({{idInstance}})
.append("/getOutgoingStories/")
.append({{apiTokenInstance}});
var response = restTemplate.exchange(requestUrl.toString(), HttpMethod.GET, null, String.class);
System.out.println(response);
var requestUrl = new StringBuilder();
requestUrl
.append({{apiUrl}})
.append("/waInstance").append({{idInstance}})
.append("/getOutgoingStories/")
.append({{apiTokenInstance}});
var response = Unirest.get(requestUrl.toString())
.header("Content-Type", "application/json")
.asString();
System.out.println(response);