Comments
-
Thanks! It looks like the issue here is that when you click "Share File", that causes the page itself to reload (since you're submitting a form), which interrupts the Dropbox API call. You should update or restructure your page to avoid that reload. That's not really related to the Dropbox API itself, but it looks like…
-
@"mrivera" The API v2 Python and JavaScript SDKs are different code bases and may offer different features like this. I can't offer insight on why one may have something like this implemented and the other doesn't, but I've sent this along as a feature request.
-
From your script tag, you're using the latest version, which should work. (Though for reference, in a production app we recommend you import a specific version, since the SDK may occasionally receive major updates with breaking changes.) I can't seem to reproduce the "undefined" issue you're seeing though. Would you be…
-
When you upload data to Dropbox via the API, you should upload the actual file data, without any encoding (such as base64 encoding). Dropbox does not apply any decoding on the uploaded file data; it will just commit what you send. Try uploading the data without the base64 encoding.
-
[Cross-linking for reference: https://stackoverflow.com/questions/66862389/image-upload-to-dropbox-api-from-ios-sends-corrupted-file-to-dropbox ] The /2/files/upload endpoint is a "content-upload" style endpoint, meaning that it requires the file data to be uploaded in the request body. I see you're attempting to set the…
-
Thanks! That's helpful. From this output, I see you are getting an API error (with a 409 status code). You can print out the API error object like to see the endpoint-specific error: .catch(function(error) { console.log(error.error); });
-
@"eweb" I tried this out, and it's working successfully for me. Even after the initial short-lived access token expires, the SDK automatically uses the stored refresh token to get a new short-lived access token and then uses that to successfully make further API calls, without having to report 'expired_access_token' back…
-
Dropbox doesn't currently offer a way to embed a file request like this, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.
-
@"eweb" Thanks! Looking at the comparison, I see the relevant difference is the replacement of authorizeFromController with authorizeFromControllerV2 in linkDropboxButtonPressed. That looks correct, and I don't believe you're missing anything. I'll give that a try myself and look into it.
-
@"JpMaxMan" I don't have any news to share on this request unfortunately.
-
Thanks! It looks like your understanding is correct. I'm bringing this up with the team to see if we can update the SDK to not retry on an auth failure like that.
-
@"eweb" I'll ask the team to update the DBRoulette example. I can't promise exactly when that would be done though, so in the meantime perhaps you can share what you have so far and I can take a look at see what the issue might be.
-
This code looks correct and works for me. I'll be happy to help with this however possible, but I could use some more information: * Is that the full error output you receive? Please share any other output. * What version of the SDK are you using? * How are you importing the SDK? * What environment are you running this in?…
-
@"kevin g.1" Thanks for the note! I'll pass this along as a feature request but I can't promise if or when that might be implemented.
-
To make sure I know exactly what functionality and issue you're referring to, can you share the relevant code you're running, and the unexpected error/output? Thanks in advance!
-
Thanks for following up. No, unfortunately I don't believe there's a way to close that page. I'll send this along to the team to see if we can improve this in the future, but I can't make any promises.
-
The startOAuth2PKCE method will automatically use short-lived access tokens and refresh tokens for you. You can find an example of using that method here. When using that, you should save the "credential" (which contains both the access token and refresh token) instead of just the access token. You can see an example of…
-
@"marcoalt" I see you've also opened a new thread for this, so I'll follow up with you there.
-
We have a new example for using PKCE in the browser with the latest version of the JavaScript SDK, currently v9.4.0, here: https://github.com/dropbox/dropbox-sdk-js/blob/main/examples/javascript/pkce-browser/index.html
-
[Cross-linking for reference: https://stackoverflow.com/questions/66801474/how-to-get-shared-links-for-editing ] I sounds like you're referring to the kind of link with "/scl/fi", which can enable editing access, and you're calling list_shared_links to list the shared links, but aren't seeing the "/scl/fi" links returned.…
-
No, it is not possible to use a short-lived access token to programmatically generate another access token. If you need long-term access without manual user intervention, you should use the OAuth flow to get a refresh token, which can be used to programmatically retrieve new short-lived access tokens on demand. Please…
-
1: Here's an example of how you can drill down into this kind of error: switch callError as CallError {case .authError(let authError, let userMessage, let errorSummary, let requestId): switch authError { case .missingScope(let tokenScopeError): print("Missing scope error: \(tokenScopeError)") print("The required scope is:…
-
The Dropbox API doesn't offer a way to process copy references in batch, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though. That being the case, using shared folders may be a better option. For instance, you can share folders using /2/sharing/share_folder and…
-
I don't have an example for fetch in particular handy, but if you using JavaScript we recommend using the official Dropbox API v2 JavaScript SDK. There's an example of using filesListFolder with that here. Otherwise, feel free to share the code you have so far and the error/output you're getting so we can take a look and…
-
[Cross-linking for reference: https://stackoverflow.com/questions/66787691/create-file-with-text-with-dropbox-api-rest-or-http ] Yes, the /2/files/upload endpoint is a "content-upload" style endpoint, so you can supply the file data to upload in the HTTPS request body. You may need to refer to the documentation for…
-
To upload a small file, you'd use the /2/files/upload endpoint: https://www.dropbox.com/developers/documentation/http/documentation#files-upload That's a link to the documentation for the HTTPS endpoints themselves, but we recommend using one of the official SDKs if possible:…
-
New Dropbox API apps do default to using "short-lived" access tokens now. I recommend reading the OAuth Guide and this blog post for more information on how to use these and the different options available.
-
The Dropbox API uses HTTPS for communication, but it is not a REST API and so does not follow the REST pattern you may be familiar with, for instance. You can find the documentation for the Dropbox API v2 request and response formats here. You may also be interested in these old blog posts about the original design of API…
-
The authorization for any team or user account always requires some sort of manual interaction, but note that the app can store and re-use the access token/refresh token after that.
-
The sharing_list_file_members method is for listing the members of a shared file, and doesn't support listing the members of a shared folder. Accordingly when you call it for a shared folder, it fails with 'access_error/is_folder' like this. To list the members of a shared folder, you should instead…