This may sound very stupid question , but I can’t find any documentation that gives me this info :
I want to make calls to v2 api from javascript.What are the endpoints for it,I only get the cUrl in docs.I have the auth_token and api_key and want to upload a file to root folder.Post request to following url gives error:
https://www.box.com/api/2.0/files/content/0?api_key=<my_api_key>&auth_token=<my_auth_token>
response :
{
"type": "error",
"status": 401,
"code": "invalid_authorization_header",
"help_url": "http:\/\/developers.box.com\/docs\/#errors",
"message": "\"Authorization\" header either missing or invalid",
"request_id": "1208099125507c7b0670911"
}
also,is the JSONP supported by v2 api.I have to make a cross domain reuest
The api-key and auth-token need to be send in the header. V2 APIs won’t accept them in the GET parameters.
We don’t currently support JSONP, but we are considering it as a post-GA add-on.
Can you please elaborate in how this doesn’t work with javascript? There are some javascript examples on other StackOverflow answers that may also help.