ClickCease

Button Commands

POST
https://api.thenextleg.io/v2/button

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.

URL Params

buttonMessageId

Use the buttonMessageId returned in your webhook URL

Request Body

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.

ref (optional)

You can optionally pass ref in your command, that will be returned in the webhook response.

webhookOverride (optional)

You can optionally pass webhookOverride that will route your request to a different webhook.

Please note that if this is not configured correctly, you will not receive any response. If an image creation cannot be mapped back to it's original request, the webhook body will be routed to the default webhook.

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-button-request", "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. Store this somewhere so you can match it with what's received in your webhook.

0 1 2 3 4 { "success": true, "messageId": "your-message-id", "createdAt": "2023-04-04T13:07:01.927Z" }

New! 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.

Webhook URL 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 here
  • buttonRequestId - Which can be used in a Button Command in conjunction with a button
  • imageUrl - The URL for your image
  • originatingMessageId - The request ID from your original request
  • content - A string containing a response from the Midjourney bot

🚧 Note: You should be aware that content will also return messages from Midjourney including:

  • Banned Prompt - You can't use this prompt
  • You've run out of fast hours... - Your tier doesn't have any fast GPU time
  • Job queued- You've made too many concurrent requests
  • Internal Server Error- Some Midjourney error
  • Invalid Parameter- An invalid flag command
  • You've ran out of fast hours
  • Your current membership plan doesn't include Private mode!
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" }
Wide view, behind the scenes, Ayutthaya large robot workshop, extra large, Fuji film, hyper-realism from 1970s Thai sci-fi movies, steam-powered aerial robot workshop army, maintenance soldiers.
Wide view, behind the scenes, Ayutthaya large robot workshop, extra large, Fuji film, hyper-realism from 1970s Thai sci-fi movies, steam-powered aerial robot workshop army, maintenance soldiers.