Comments
-
Yes, offset is the total amount of data uploaded so for a single file upload session, not including the data you're about to upload in the current call. You can think of it as the start index of the data you're sending in that call. For the first call, it's 0.
-
Can you share your latest code? That line still looks problematic. The intent of upload sessions is that you would only ever send up a maximum of one chunk size's worth of data in a single call, but you seem to indicate that you're sending up the entire rest of the file. For a 210 MB file, using 5 MB chunks, it should take…
-
You should only upload one chunkLength's worth of data with each call. The following line seems to indicate that you're uploading much more than that for each though: range = NSMakeRange(Int(startPosition), (data.length)-Int(startPosition)) I.e., the end of the range should probably be something like startPosition…
-
Thanks for the code Christian! Two things occur to me: - It looks like you're passing in the entire inputStream object with each call. You should only pass in a chunk of data for each. - You're not checking the response/error on your append calls. Make sure to do so to see if it's failing earlier there.
-
What output do you get? Some errors are themselves unions, so be sure to break those out if you need. For example, here's a sample breaking out every possible error case (with the latest version of SwiftyDropbox, v3.0.0): // we're ready to finish the upload and commit the file client.files.uploadSessionFinish(cursor:…
-
Samantha, your question seems to be about a different endpoint and a different error message, so please open a new thread with the full details (e.g., your code and the full error response body) so we can help you without spamming anyone else on this thread. Thanks!
-
I'm afraid that's outside the scope of API support, so I can't offer much insight there. You should check with Dropbox for Business support ( https://www.dropbox.com/support ) or an account manager or admin for your team.
-
This error occurs if the team you're on is no longer active, so it sounds like your team was deactivated at some point.
-
If your app is registered for the Dropbox API, it can only access the account of the user that authorized the app. If your app is registered for the Dropbox Business API, it can access the account of any member of the team it's linked to. There's more information the documentation here. You can choose the API when first…
-
The Dropbox API doesn't use refresh tokens, so you're probably referring to access tokens. For reference, access tokens for the Dropbox API don't expire by themselves, but they can be revoked manually. Dropbox API access tokens can be used across multiple instances of an app. E.g., an access token obtained on web can be…
-
To follow up here, SwiftyDropbox does now support OS X/macOS.
-
Hi Dennis, it looks like you also started a new thread for this, so I'll follow up there: https://www.dropboxforum.com/hc/en-us/community/posts/206204683-Support-for-OS-X-macOS-in-v2-SDK
-
Thanks for the feedback and information! I'll be sure to pass it along to the team.
-
Unfortunately, SwiftyDropbox doesn't currently support OS X, but we'll consider this a feature request.
-
Quick follow up here, in the latest versions of SwiftyDropbox, upload/download request objects do now offer a `cancel` method you can call to cancel the request.
-
Thanks for the feedback! I don't have a timeline for when this might be implemented, but I'll be sure to add your vote to the feature request. By the way, the SDK is open-source, so you can modify it as desired: https://github.com/dropbox/SwiftyDropbox
-
Oh, apologies, I meant to say downloads. But that's correct, there isn't currently a way to cancel either.
-
Unfortunately the SwiftyDropbox SDK doesn't currently offer a way to cancel uploads, but I'll pass this along as a feature request.
-
I don't believe we have any sample code for this specifically in Objective-C unfortunately. Looking at your code, it seems you are setting all of the OAuth parameters as individual parameters, when they should just be together in the one "Authorization" header, as shown in the blog post I linked to.
-
That's correct, that endpoint requires OAuth 1 signing. This blog post, specifically step 4, may be helpful: https://blogs.dropbox.com/developers/2012/07/using-oauth-1-0-with-the-plaintext-signature-method/
-
That seems to be it then. The API expects a "Content-Type" header of "application/json", but your code apparently sends up "application/x-www-form-urlencoded". Change that to "application/json" and try again.
-
That only seems to be showing the status code and headers. What is the body of the response?
-
What's the body of the error response? It should contain some more useful information.
-
It looks like you're form encoding the parameter(s) that you send in the body, but the API actually just expects JSON: https://www.dropbox.com/developers/documentation/http#documentation-sharing-get_shared_links For example, in this case, the data you send up should just be: "{"path": "}"
-
Yes, you can certainly use that endpoint to get an OAuth 2 access token and then use the HTTP interface for API v2.
-
That error indicates that your request body was empty, instead of containing the parameters. You'll need to debug the code that makes the request to check why your data isn't getting sent up in the body.
-
What's the body of the response? It should contain more useful error information.
-
Thanks for the additional feedback, Gavin! I certainly agree, this would be a good feature to have.
-
The Dropbox API unfortunately doesn't offer an API call for appending data to existing files. We'll consider this a feature request though. That being the case, you'll need to download the file, add your data, and upload the whole new version of the file. If you want to do that, I recommend checking out the tutorial for…
-
API v2 does use a different account ID format, so the v1 format won't work there. For any given access token though, you can call /users/get_current_account to get the v2 account ID.