Think of it like a letter. Sometimes you receive a letter, for example, asking you to fill out a form, and then return the form in an envelope with the specified address, which is in the original envelope in which the form was placed.
After you have completed filling out the form, you place it in the provided envelope and send it back.
CallbackUrl is like this return envelope. You basically say that I am sending you this data. As soon as you are done with this, I'm on this callbackUrl waiting for your answer. In this way, the API will process the data you sent, and then the callback will send you a response.
This is useful because sometimes it may take you years to process some data, and it makes no sense to force the subscriber to wait for an answer. For example, let's say your API allows users to send documents to it and scan them for viruses. Then you send the report after. Scanning may take 3 minutes. User cannot wait 3 minutes. In this way, you confirm that you have received the document and allow the caller to do other things while you are scanning, and then use callbackUrl when you are finished to tell them the result of the scan.
Taf Munyurwa Jan 31 '19 at 10:41 2019-01-31 10:41
source share