Retrieve Midjourney configuration for channel
December 2023
Table of contents
https://api.useapi.net/v2/account/midjourney/
channel
The channel
value should correspond to an account configured previously via a POST request.
Request Headers
Authorization: Bearer {API token}
API token
is required, see Setup useapi.net for details.
Responses
-
{ "channel": "Discord channel id", "discord": "Discord token", "server": "Discord server id", "maxJobs": 1-15 }
-
{ "error": "Unauthorized", "code": 401 }
Model
{ // TypeScript, all fields are optional
discord: string,
server: string,
channel: string,
maxJobs: number,
pendingModMessage: string
}
Examples
-
curl https://api.useapi.net/v2/account/midjourney/<channel> \ -H "Accept: application/json" \ -H "Authorization: Bearer …"
-
const token = "API token"; const channel = "Previously configured channel id"; const apiUrl = `https://api.useapi.net/v2/account/midjourney/${channel}`; const response = await fetch(apiUrl, { headers: { "Authorization": `Bearer ${token}`, }, }); const result = await response.json(); console.log("response", {response, result});
-
import requests token = "API token" channel = "Previously configured channel id" apiUrl = f"https://api.useapi.net/v2/account/midjourney/{channel}" headers = { "Content-Type": "application/json", "Authorization" : f"Bearer {token}" } response = requests.get(apiUrl, headers=headers) print(response, response.json())