Button Commands
https://api.thenextleg.io/api
After receiving a response at your webhook URL, if buttons are available, you can subsequently press a button, following Midjourneys practice. This may include buttons such as upscale (U1, U2, U3, U4)
, variations (V1, V2, V3, V4, π)
and others.
Request
Params
The current button commands we support are:button
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.buttonMessageId
The buttonMessageId
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.
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/api',
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);
});
HTTP Response
Your response will return an initial messageId
. The main purpose is to let you know your message has been received.
The response to the actual request (imagine
or other) will be returned in your Webhook URL.
πThis is not an actual response to your original request. Your webhook URL will receive a message with a response to the original prompt.
0
1
2
3
4
{
"success": true,
"messageId": "your-message-id",
"createdAt": "2023-04-04T13:07:01.927Z"
}
Completed Response
Your webhook URL will receive a response with the following:
buttons
- Which can be used in your next request invoke. If your slash command has produced an output that produces buttons/interactions, they will appear herebuttonRequestId
- Which can be used in a Button Command in conjunction with abutton
imageUrl
- The URL for your imageoriginatingMessageId
- The request ID from your original requestcontent
- A string containing a response from the (Redacted Name) bot
π§ Note: You should be aware that content will also return messages from (Redacted Name) including:
ALREADY_REQUESTED_UPSCALE
BOT_TOOK_TOO_LONG_TO_PROCESS_YOUR_COMMAND
APPEAL_ACCEPTED
APPEAL_REJECTED
BANNED_PROMPT
BLOCKED
BUTTON_NOT_FOUND
FAILED_TO_PROCESS_YOUR_COMMAND
FAILED_TO_REQUEST
IMAGE_BLOCKED
INTERNAL_ERROR
INVALID_LINK
INVALID_PARAMETER
JOB_ACTION_RESTRICTED
JOB_QUEUED
MODERATION_OUTAGE
NO_FAST_HOURS
PLEASE_SUBSCRIBE_TO_MJ_IN_YOUR_DASHBOARD
QUEUE_FULL
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
"createdAt": {
"_nanoseconds": 215000000,
"_seconds": 1678840347
},
"buttons": [
"U1",
"U2",
"U3",
"U4",
"π",
"V1",
"V2",
"V3",
"V4"
],
"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)