box-api

Box oauth2: Invalid grant_type parameter or parameter missing

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 05:07:07
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=nnqtYcoik7cjtHQYyn3Af8uk4LG3rYYh&client_id=[myclientId]&client_secret=[mysecret] Result: HTTP/1.1 400 Bad Request Server: nginx

Authentication to Box in a C# desktop application using the Box Windows SDK v2 library

六眼飞鱼酱① 提交于 2019-12-05 02:04:09
问题 Seems like this should be a simple thing to do, but I can't find an example or thorough enough documentation to figure it out. I have a C# desktop application that I'd like to integrate with Box via the Box API. I assume that using the Box Windows SDK v2 for .NET will be the way to go. Can someone point me to a simple, bare-bones example that will work for a desktop application? 回答1: I decided to try and figure this one out myself. Even though OAuth2 supports non-browser based authentication,

Is this a bug of Box API v2 when getting events

倖福魔咒の 提交于 2019-12-04 16:44:22
I have spotted an strange behavior when getting events from Box using the BOX API v2. The scenario I got is like follows: Upload 14 files to the box.net using box API v1. Get events using stream_position=now, this gives a stream position, say 1234 and no entries are returned. Get events using stream_position=1234, this gives a new stream position, say 7890 and no entries are returned. ( Until this point it is all as expected ) Get events using stream_position=7890, now this gives a dummy number of events which have behavior "ITEM_UPLOAD" and some files I uploaded in step one. I expect if no

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

人盡茶涼 提交于 2019-12-04 14:34:45
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 wrong? I think you might try sending the grant_type=... in the request body, not as a query string. Here

Objective-C Box 2.0 File Upload - Problems

筅森魡賤 提交于 2019-12-04 13:06:18
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 request NSString *boundary = [NSString stringWithString:@"--PLEASEHELPMEGETTHISWORKING"]; NSString

Do I need authorization code each time for accessing user box account?

隐身守侯 提交于 2019-12-04 12:50:41
I am developing a desktop app which will interact with box enterprise account. For the first time when my app will try to access Admin enterprise account it will be redirected to box page . Box finally redirects user to my redirected URL after accepting Admin user credentials. This redirected URL will have a authorization code. which is used to get access and refresh token. My question is that can i save this authorization code for future use. ?? Say after one month my app again wants to access Admin enterprise account then Do i again need to go through the above steps of getting the auth code

Upload file using python requests

允我心安 提交于 2019-12-04 12:23:53
问题 I've been trying to upload a file using the box v2 api with requests. So far I had little luck though. Maybe someone here can help me see what I'm actually doing wrong. file_name = "%s%s" % (slugify(sync_file.description), file_suffix) file_handle = open(settings.MEDIA_ROOT + str(sync_file.document), 'rb') folder_id = str(sync_file.patient.box_patient_folder_id) r = requests.post( files_url, headers=headers, files={ file_name: file_handle, "folder_id": folder_id, }, ) My authentication works,

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

独自空忆成欢 提交于 2019-12-04 11:51:10
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 and client secret are set prior to this. In my info.plist file, I have boxsdk

Get file ID of a given path

假装没事ソ 提交于 2019-12-04 02:29:05
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 We currently don't have support for this, but the feedback will definitely be considered as we continue building out the v2 API. 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://api.box.com/2.0/search?query=filename.txt This gives back all the matching entries with their path_collections

Tracking codes data type and manipulation

喜欢而已 提交于 2019-12-02 12:10:51
Tracking codes allow an enterprise (such as us) to store some local ID in the users' data on Box. I realize that the functionality needs to be enabled on the enterprise (which our contacts are working on). First question: The documentation says it's an "array", and other answers indicate that it's an array of "name/value pairs". In datatypes, what exactly does Box API consider to be a "name/value"-pair? Is it a list of dictionaries with string keys and string values (and in that case - what happens if two of the dictionaries share keys), a list of strings with a "/" separator, or can I put any