-
Notifications
You must be signed in to change notification settings - Fork 124
Description
Environment: JS
Preview version: 2.93.0 (latest)
Steps to reproduce the problem:
-
After adding API_HOST in use a reverse proxy and instead of using api.box.com use a custom domain.
Below is example of code.
var oB=document.getElementById('preview');
var addExtraHeaders = (config /* https://github.com/axios/axios#request-config */) => {
config.headers['ApplicationId'] = '12345';
return config;
};
oB.onload=function(){
var accessToken = 'ygasdfygasldlkfnjasdf';
var fileId = 5454151;
var preview = new Box.Preview();
preview.show(
fileId,
accessToken,
{
apiHost: "https://mydocuments.getme.com/",
requestInterceptor: addExtraHeaders,
container: "#my-doc", showDownload:true,
logoUrl:'.\images\myorg.png'
}
); -
Once call made from Preview.js CDN it appends /2.0/ to original API_HOST.
-
Additional 2.0 makes it difficult to customize API call while using Preview.js CDN library.
What is the expected behavior? (Screenshots can be helpful here)
the expected behavior is when we pass Custom API host it should not append any version to request API. This call should be agnostic to BOX API version and should call files [https://api.box.com/2.0/files/12345].
May be version [2.0] should be an options to provide along with API_HOST url.
What went wrong? (Screenshots, console logs, or HAR files can be helpful here)
Customization with API_HOST URL not working due to version got appended to request. This creates dependencies on BOX API version and custom API.
Is it possible that instead of appending 2.0 to API host create options to pass version along with API_HOST or use https://api.box.com/2.0/ as a default BOX_API URL in CDN.