I’m consuming a 3rd party API (REST JSON-based). In it they require a callback url so I can grab a token that’s returned.
So how does this work? If I give them a url, how is it hooking back up to my callback method? How do I specify the method or where it’s at once the response gets back… how do you wire all this?
So in the header of my HttpRequest, I’m adding a custom value of “callbackUrl”, “ourCallbackUrlHere” as required by the API.
I think the term ‘callback’ might be causing some confusion here. They are speaking of a ‘callback URL’ in the sense that they are calling back to a URL on your server. They don’t mean that your server’s initial request code should have any sort of ‘callback’ implemented to handle it, however.
What you will do is implement a handler – perhaps an
ASHXgeneric handler – that pulls theQueryStringvalues their server sends, and verifies it against what you have in your database, taking appropriate action.So, there will be two pages/handlers: the one that sends the initial API request via REST, and the one that receives the ‘callback’ that the third-party issues. But you aren’t implementing a callback (as in, a .NET
delegate) in your first handler.