You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

petepete717's avatar
petepete717
Helpful | Level 6
3 years ago

createSharedLinkWithSettings -> sessionDeinitialized error

I am attempting to obtain the link to share a folder but I always receive a sessionDeinitialized error.

 

Setup:

 

struct DropboxManager {

    var client: DropboxClient {

        let client = DropboxClient(accessToken: "sl.myAccessToken")

        return client

    }

 

    func shareFolder() {

        client.sharing.createSharedLinkWithSettings(path: "/MyTestPath").response { response, error in

            if let link = response {

                print(link.url)

            } else {

                print("Error sharing:", error)

            }

        }

    }

}

 

Seems like I am missing something here? Is it possible I can't test sharing when setting up the client with the access token?

I have tested that the client works - I'm able to up- and download files to Dropbox.

 

Thanks for guiding me in the right direction.

  • I hope this helps others with the same issue -

     

    Logging into Dropbox with the access token does not work. I need to go through the "normal" authorization process, first defining a ScopeRequest, including the scope "sharing.write". Afterwards using 

    DropboxClientsManager.authorizeFromControllerV2(......

     

  • petepete717's avatar
    petepete717
    Helpful | Level 6

    I hope this helps others with the same issue -

     

    Logging into Dropbox with the access token does not work. I need to go through the "normal" authorization process, first defining a ScopeRequest, including the scope "sharing.write". Afterwards using 

    DropboxClientsManager.authorizeFromControllerV2(......

     

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,910 PostsLatest Activity: 4 days ago
333 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!