HTTP Client - Long running API Call
Hey,
I am using the Laravel HTTP Client to call an external API.
This works without any problem. But can someone give me a hint how to get the response for a long running API call?
Here is the API I want to call: See under "Long Running Processes"
https://help.mailstore.com/en/spe/Management_API_-_Using_the_API
Thanks!
- Call
api/invoke/VerifyStore with HTTP Client.
- As stated in the doc, get
keys token, statusCode and statusVersion from response json.
- Dispatch a Queued Job, which calls the
get-status route, and:
- If there is error throw error (send mail, log something etc.)
- If it is still running release the job back to queue (probably with some delay).
- If it is succeeded, perform business logic and end the job.
https://laravel.com/docs/9.x/queues
@niush Thanks for your reply. Releasing the job back to the queue sounds good.
I will try it out and come back here :-)
Please or to participate in this conversation.