box-api

Upload a file to Box.com using Powershell

青春壹個敷衍的年華 提交于 2019-12-07 05:33:02
问题 I am working on a series of Powershell scripts for my company to use to transfer data to and from Box.com. The one thing I just can't figure out is uploading files. The Box API requires a multipart POST operation for uploads, and I've seen a few answers here on SO indicating that I should be able to do that in Powershell (such as this one). But I can't seem to get it working. Here's the code I have right now: Function Post-File { Param( [Parameter(Mandatory=$True,Position=1)] [string]

Box oauth2: Invalid grant_type parameter or parameter missing

三世轮回 提交于 2019-12-07 01:33:58
问题 I don't know what I do wrong, but everytime I tried to obtain the token (after user authentication of course), the result is always Invalid grant_type parameter or parameter missing Possibly related to Box API always returns invalid grant_type parameter on obtaining access token Here is my fiddler result: POST https://api.box.com/oauth2/token HTTP/1.1 Host: api.box.com Content-Length: 157 Expect: 100-continue Connection: Keep-Alive grant_type=authorization_code&code

Objective-C Box 2.0 File Upload - Problems

做~自己de王妃 提交于 2019-12-06 08:33:34
问题 I've been trying to get file upload working with Box for the past few days. I know I'm doing something wrong, but just can't see what it is. I've reduced my code down as much as I possibly can, to just this: // Configure the request NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init]; [request setURL:[NSURL URLWithString:@"https://api.box.com/2.0/files/data"]]; [request setHTTPMethod:@"POST"]; [request setValue:boxAuthString forHTTPHeaderField:@"Authorization"]; // Setu up the

box api error getting the access token: Invalid grant_type parameter or parameter missing

好久不见. 提交于 2019-12-06 07:53:39
问题 I am trying to get an access token and using the following url to POST the HTTP request and receiving { "error":"invalid_request", "error_description":"Invalid grant_type parameter or parameter missing" } error message . No matter what I try. I am posting seconds after receiving the code so I dont think the code could be the failure point. post https://api.box.com/oauth2/token?grant_type=authorization_code&code=H23sCQmlzsEJSEyhKXj19yb1LWew9MPk&client_id=xyz&client_secret=123 What am I doing

Multipart Request to Box API via Google HTTP Client

為{幸葍}努か 提交于 2019-12-06 04:28:26
问题 I'm trying to call this specific method http://developers.box.com/docs/#files-upload-a-file in Box API with the help of Google HTTP Client library v1.14.1. Currently I see no way of doing this. If I was using http://hc.apache.org/httpclient-3.x/methods/multipartpost.html, I would add 2 items of StringPart and 1 item of FilePart. In Google HTTP Client library I see only MultipartContent and Part classes that do not seem to be able to handle pure name/value pairs, as StringPart referenced above

Why do I get a redirect URI mismatch when trying to log into Box?

十年热恋 提交于 2019-12-06 04:19:47
问题 When using the Box SDK for iOS to do OAuth, I am shown a webpage with this error: Error: redirect_uri_mismatch response_type=code redirect_uri=boxsdk-our4iypzazstfpx8j70e8tlc3eyn9c4l://boxsdkoauth2redirect state=ok client_id=our4iypzazstfpx8j70e8tlc3eyn9c4l I used the code that they suggested: [self presentViewController:[[BoxAuthorizationViewController alloc] initWithAuthorizationURL:[[BoxSDK sharedSDK].OAuth2Session authorizeURL] redirectURI:nil ] animated:YES completion:nil ]; My client ID

Using As-User in Box Request

六眼飞鱼酱① 提交于 2019-12-05 15:13:48
I was trying to make Box Enterprise API work using As-User. I have a admin account which i used to try to retrieve the Contents in a sub account. I first used the admin account to retrieve the User ID of the sub account. And added the User ID as a field "As-User: ########". However, I was returned with a reply of 403. The error message : "The request requires higher privileges than provided by the access token." I am using the access token i had used to retrieve the user list. Do I have to get a new access token using the as the new user? or is the admin access token fine? GET /2.0/folders/0

Get file ID of a given path

纵然是瞬间 提交于 2019-12-05 14:18:23
问题 is there a direct method to get file ID by giving a path (e.g. /some/folder/deep/inside/file.txt)? I know this can be done by recursively checking folder's contents, but a simple call would be much better. Thanks 回答1: We currently don't have support for this, but the feedback will definitely be considered as we continue building out the v2 API. 回答2: An alternative to this would be to extract the target file/folder name from the path and search for it using the search API like this: https:/

Upload a file to Box.com using Powershell

巧了我就是萌 提交于 2019-12-05 10:57:20
I am working on a series of Powershell scripts for my company to use to transfer data to and from Box.com. The one thing I just can't figure out is uploading files. The Box API requires a multipart POST operation for uploads, and I've seen a few answers here on SO indicating that I should be able to do that in Powershell (such as this one ). But I can't seem to get it working. Here's the code I have right now: Function Post-File { Param( [Parameter(Mandatory=$True,Position=1)] [string]$SourcePath, [Parameter(Mandatory=$False,Position=2)] [string]$FolderId = ############ ) #Variables for

Best way to upload files to Box.com programmatically

☆樱花仙子☆ 提交于 2019-12-05 10:56:36
I've read the whole Box.com developers api guide and spent hours on the web researching this particular question but I can't seem to find a definitive answer and I don't want to start creating a solution if I'm going down the wrong path. We have a production environment where as once we are finished working with files our production software system zips them up and saves them into a local server directory for archival purposes. This local path cannot be changed. My question is how can I programmatically upload these files to our Box.com account so we can archive these on the cloud? Everything