Get Message and Progress
GET
https://api.thenextleg.io/v2/message/<messageId>?expireMins=2
Retrieve progress and image generation response from a message you've sent in a previous request.
Parameters
messageId
Use themessageId
returned in an imagine commandexpireMins (optional)
You can define how many minutes it should take to mark a message asincomplete
. Default is 12 minutes.0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
var axios = require('axios');
var config = {
method: 'get',
url: 'https://api.thenextleg.io/v2/message/<messageId>?expireMins=2',
headers: {
'Authorization': 'Bearer <your-token>',
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
HTTP Response
200Success
You will receive the message that was originally sent to your webhook.0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"progress": 100,
"createdAt": "2023-04-04T13:07:01.927Z",
"buttons": [
"U1",
"U2",
"U3",
"U4",
"🔄",
"V1",
"V2",
"V3",
"V4"
],
"imageUrl": "your-image-url",
"imageUrls": ["U1-image-url", "U2-image-url", "U3-image-url", "U4-image-url"],
"buttonMessageId": "OtfxNzfMIKBPVE1aP4u4",
"originatingMessageId": "your-message-id",
"content": "your-original-prompt",
"ref": "",
"responseAt": "2023-04-04T13:06:01.927Z"
}
If you receive a 403 error when retrieving an image programmatically, please seeget image safely
200In Progress
0
1
2
3
{
"progressImageUrl": "your-image-url", // Or null
"progress": 37,
}
200Incomplete
0
1
2
{
"progress": "incomplete",
}