Info
API Endpoint:
https://api.thenextleg.io/api
Retrieve the fast hours and other information on your account.
Request
Params
cmd
info
ref (optional)
You can optionally passref
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
var axios = require('axios');
var data = JSON.stringify({
"cmd": "info",
"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.
0
1
2
3
4
{
"success": true,
"messageId": "your-message-id",
"createdAt": "2023-04-04T13:07:01.927Z"
}
Webhook URL Response
Your webhook URL will receive a response with the following:
originatingMessageId
- The request ID from your original requestcontent
The information in JSONtype
info
0
1
2
3
4
5
6
7
8
9
10
11
12
13
{
"createdAt": {
"_nanoseconds": 215000000,
"_seconds": 1678840347
},
"originatingMessageId": "your-message-id",
"content":{
"Fast Time Remaining": "12.06/15.0 hours (80.37%)",
"Job Mode": "Fast",
},
"type": "info"
"ref": "",
"responseAt": "2023-04-04T13:06:01.927Z"
}
