Button Commands
A completed image will return an array of buttons which you can subsequently invoke on the image. These buttons are dynamic and a list of buttons you can press are included in every image completion. This may include buttons such as upscale (U1, U2, U3, U4), variations (V1, V2, V3, V4, 🔄), zoom, pan and more. .
https://api.thenextleg.io/v2/buttonhttps://api.thenextleg.io/v2/button?authToken=<token>&buttonMessageId=<id>&button=<button>Request Body
buttonMessageId
Use thebuttonMessageId returned in your webhook URLbutton
Send in any button seen in your previous response. You'll need to include the emoji and label exactly as received in your Webhook URL response from a previous request.ref (optional)
You can optionally passref in your command - which can be used useful when using webhookswebhookOverride (optional)
You can optionally pass webhookOverride that will route a response to a webhook of your choosing.
Please note that using a webhook is completely optional. You are welcome to use the GET Message endpoint to retrieve responses.
Custom Zoom Options
prompt (optional)
Include a prompt in your request body to alter the original prompt.
zoom (optional)
When using Custom Zoom as a button, you will need to pass in a value between 1 and 2 for custom zoom
ar (optional)
When using Custom Zoom as a button you can choose to add in an aspect ratio parameter such as 1:1
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
var axios = require('axios');
var data = JSON.stringify({
"button": "🔄",
"buttonMessageId": "your-buttonMessageId",
"ref": "",
"webhookOverride": ""
});
var config = {
method: 'post',
url: 'https://api.thenextleg.io/v2/button',
headers: {
'Authorization': 'Bearer <your-token>',
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
}); 200Success
Your response will return a messageId. Use the messageId at the GET Message endpoint to poll for results, or to you can wait for the result to arrive via webhook.
0
1
2
3
4
{
"success": true,
"messageId": "your-message-id",
"createdAt": "2023-04-04T13:07:01.927Z"
}Get your progress and retrieve a Message using GET
After receiving your messageId you can use the GET /v2/message/<messageId> in order to retrieve your progress and image.
See the GET /v2/message/<messageId> docs for more information.
Completed Response
The message you receive by using the GET Message endpoint or received via your webhook, will have the following:🚧 Note: You should be aware that content will also return messages from (Redacted Name) including:
ALREADY_REQUESTED_UPSCALEBOT_TOOK_TOO_LONG_TO_PROCESS_YOUR_COMMANDAPPEAL_ACCEPTEDAPPEAL_REJECTEDBANNED_PROMPTBLOCKEDBUTTON_NOT_FOUNDFAILED_TO_PROCESS_YOUR_COMMANDFAILED_TO_REQUESTIMAGE_BLOCKEDINTERNAL_ERRORINVALID_LINKINVALID_PARAMETERJOB_ACTION_RESTRICTEDJOB_QUEUEDMODERATION_OUTAGENO_FAST_HOURSPLEASE_SUBSCRIBE_TO_MJ_IN_YOUR_DASHBOARDQUEUE_FULL0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
"createdAt": {
"_nanoseconds": 215000000,
"_seconds": 1678840347
},
"buttons": [
"U1",
"U2",
"U3",
"U4",
"🔄",
"V1",
"V2",
"V3",
"V4"
],
"type": "button",
"imageUrl": "your-image-url",
"buttonMessageId": "OtfxNzfMIKBPVE1aP4u4",
"originatingMessageId": "your-message-id",
"content": "your-original-prompt",
"ref": "",
"responseAt": "2023-04-04T13:06:01.927Z"
}.com/f889911d-77f1-49b5-a299-64715b6d4d60/grid_0.png)