OpenBoxClientCallbackUrl

Page history last edited by sam@... 4 mos ago

OpenBox Action: Popup action: Client Callback URL

 

This section refers to popup actions only.

 

When a popup action is executed by the user, Box.net makes a callback request to your initial callback URL with the callback parameters you specify. However, in some cases a additional callback request, known as a client callback, must be made. This happens when the client can't get all the information it needs in a single call.

 

Here are two examples of this. The first doesn't require a client callback URL, while the second does.

 

Examples

 

1. A document editor that does not need the client callback URL

This popup action executes a REST call with a download_file_url callback parameter.

 

  • The user clicks OK on the prompt to launch a popup.
  • The popup is redirected to the following URL (initial callback URL + Callback Parameters):

http://www.doceditor.com/service?apikey=abc&file=&redirect=

  • That URL responds with the document editor interface which is displayed to the user, since the user is the one making the request. The popup now has all the information it needs to function; an additional client callback is not required.

 

2. A document editor that needs the client callback URL

This popup action executes a REST call with a file callback parameter.

 

  • The user clicks OK on the prompt to launch a popup.
  • The popup displays a page where the Box.net server POSTs a file along with callback parameters to the remote server. Because it involves a File post, the client cannot make this request.
  • Box.net receives the response, then has the client (through invisible javascript POST) POST the response to the client callback URL. That URL then inteprets the response (i.e. extracts a session id) and redirects the user to an editor URL with a correct session ID. The redirect works because the request to the client callback URL is actually being made by the client.

 

Client Callback URL Request Format

 

The POST to the client callback URL takes the response of the initial callback URL and sends it to the same URL with the same data as the original callback.

 

If your callback parameters are in the REST format, and you have two GET parameters and a POST parameter, your client callback URL gets a request like this:

 

URL: http://your-client-callback-url.com/?get_param1=value1&get_param2=value2

 

POST data:

post_param1=value1

initial_callback_response=

 

If your callback parameters are in XML or SOAP format, your client callback URL gets a request like this:

 

URL: http://your-client-callback-url.com/

 

POST data:

xml=.....

initial_callback_response=

 

The response is either a 302 redirect to get the user to the correct URL, or the HTML for an interface to show the user. Most often this URL will point to a separate API method or custom script developed especially for OpenBox, which can parse the results of the initial callback URL.

 

 


 

Need additional assistance? Please feel free to Contact us