Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add root info #79

Merged
merged 7 commits into from
Sep 18, 2021
Merged

Add root info #79

merged 7 commits into from
Sep 18, 2021

Conversation

Jesus
Copy link
Owner

@Jesus Jesus commented Feb 7, 2021

No description provided.

dwhenry and others added 5 commits February 7, 2021 18:02
This requires access to `RootInfo` object in the `get_current_account` endpoint
with the results being used to set the root namespace on subsequent requests.
@Jesus
Copy link
Owner Author

Jesus commented Feb 7, 2021

@dwhenry I don't have a Dropbox business account, so I could only test to a certain point. It'd be awesome if to gather feedback on this branch from people who actually use a business account.

I'll leave this open for a few days in case anyone has suggestions and eventually I'll merge it.

@kmuto
Copy link

kmuto commented Mar 12, 2021

Hi, I tried this branch with my Dropbox business account.
Sadly it failed.

sample code

#!/usr/bin/ruby
$LOAD_PATH.unshift("./lib") # for use local git version 
require 'dropbox_api'
client = DropboxApi::Client.new("...")
client.namespace_id = client.get_current_account.root_info.root_namespace_id

folder = client.list_folder('')

result (ruby 2.5.5p157)

Traceback (most recent call last):
	4: from dropboxapi.rb:8:in `<main>'
	3: from dropbox_api/lib/dropbox_api/client.rb:23:in `block in add_endpoint'
	2: from dropbox_api/lib/dropbox_api/endpoints/files/list_folder.rb:44:in `block in <class:ListFolder>'
	1: from dropbox_api/lib/dropbox_api/endpoints/base.rb:12:in `perform_request'
dropbox_api/lib/dropbox_api/endpoints/base.rb:37:in `process_response': HTTP 400: Error in call to API function "files/list_folder": Dropbox-API-Path-Root: unknown tag '#<DropboxApi::Metadata::NamespaceId:0x000056279ea03d60>' (DropboxApi::Errors::HttpError)

I'll try to dig more.

JSON.dump(
DropboxApi::Metadata::NamespaceId.new({
'namespace_id' => namespace_id
})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by changing here to }).to_hash, handling team works.

@Nerian
Copy link

Nerian commented May 28, 2021

I tried with kmuto's comment: #79 (comment)

It worked fine like this:

dropbox_client ||= DropboxApi::Client.new
dropbox_client.namespace_id = 57567567
dropbox_client.upload 'somefile/at/here', yolo

@Jesus
Copy link
Owner Author

Jesus commented Sep 18, 2021

Thanks for the feedback @kmuto & @Nerian

@Jesus Jesus merged commit 0c4c48e into master Sep 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants