What is a callback URL in relation to an API?

ApathyBear picture ApathyBear · Apr 28, 2014 · Viewed 142.6k times · Source

I've been scouring the net, and can't seem to wrap my head around the idea of a callback URL. In my case I have a few callback URLs that I have to define myself. A popular one is a "default callback URL". What is this exactly? Can you give an example in plain english?

Answer

Eric Stein picture Eric Stein · Apr 28, 2014

A callback URL will be invoked by the API method you're calling after it's done. So if you call

POST /api.example.com/foo?callbackURL=http://my.server.com/bar

Then when /foo is finished, it sends a request to http://my.server.com/bar. The contents and method of that request are going to vary - check the documentation for the API you're accessing.