Orbitvu Station communicates between the online store and the application based on the specifications described below. Based on this specification, you can implement a similar mechanism for your own shop platform.
In a step 1 we should set any “cookie” on a HTTP Server (Orbitvu Station checks if under specified url “Set-Cookie” header is present, so the name of the cookie is irrelevant). Then we send a response to the Orbitvu Station in xml format:
<ovs_response>
<code>0</code>
<message>Authorization succeeded!</message>
<data>https://your_remote_upload_url?ov_action=upload</data>
</ovs_response>
In a step 2 Orbitvu Station will send a POST Request to the address: https://your_remote_upload_url?ov_action=upload with zipped (“.ovus”) Orbitvu Presentation. Then we send a response to the Orbitvu Station in xml format with status message.
Sample implementation
index.php file:
In the above example the Orbitvu Presentation will be saved in “orbitvu_presentations” folder. After successful uploading you need to unzip the Orbitvu Presentation using PHP class “ZipArchive” - it’s not shown in the example. When you unzip the presentation, its folder will contain content2.xml file where you will have the SKU of the presentation.
Sample implementation with authorization
index.php file:
- Remote upload url is: https://your_remote_upload_url?ov_key=my_secret_key
- On the server side we check if
$_GET[‘ov_key’]
is the same as constant “ov_key” defined on the server. - If so, we generate unique token on a server and save it on a global
$_SESSION[‘ov_token’]
variable. We send a response to the Orbitvu Station with an upload url:
https://your_remote_upload_url?ov_key=my_secret_key&ov_token=generated_token&ov_action=upload - Orbitvu Station send another request to the server:
https://your_remote_upload_url?ov_key=my_secret_key&ov_token=generated_token&ov_action=upload - On the server side we check if
$_GET[‘ov_key’]
is proper and if$_GET[‘ov_token’]
is the same as$_SESSION[‘ov_token’
. - If key and token are valid, we allow to upload presentation and destroy
$_SESSION[‘token’]
. After all we send a response to the Orbitvu Station.