I dont know how to use webhook to get update

i was confused when read webhooks documentation from here Webhooks – ImagineAPI.dev Documentation

In our Quick Start guide, we send a POST request to generate the initial image and then use the id that’s in the response to make GET requests to check the image generation status and get the image data.
Some issues with that are: resources get used since you have to check for the status every X seconds and you don’t get notified right away especially if you check infrequently (especially using make.com or Zapier which don’t allow very frequent checks)

that is the sentences that i didn’t understand. how it works and how to implement it in make.com?

There are two methods if you want to do a polling wait in the same/single scenario.

Method 1 — difficulty level: Easy

The simplest solution would be to use a Sleep module to wait out 5 minutes (or the longest period that the external service takes).

You could even use more than one, if you have a Make subscription (free tier max 5 minutes per scenario run).

Screenshot_2024-01-30_090129

Method 2 — difficulty level: ???

This other method allows you to check multiple times at shorter intervals, because you “throw” an error to break from the repeater and end the scenario when successful/completed.

The secret is in the success check filter, the error handler, and the commit directive.

2 Likes

so we repeatedly call the webhook url using get method in http module right?

No, there are no webhooks involved here.

This is actually the method mentioned in their QuickStart Guide, under Getting the generated image

To re-quote your quote,

In our Quick Start guide, we send a POST request to generate the initial image and then use the id that’s in the response to make GET requests to check the image generation status and get the image data.

Looks like you don’t even need to wait 5 minutes.

In their documentation (same link above), it says:

It will take up to 30 seconds for an image to get generated in the demo server. We’re using a Midjourney account with turbo mode enable so it’s usually quite fast.

30 seconds is in Turbo mode, so perhaps it might take a minute for normal mode?

You just need to add a bit more buffer to the amount to account for the longest operation.

So you might wait 60 seconds for Turbo, and 4 minutes for normal mode.

2 Likes