Forum Discussion

Ed T.2's avatar
Ed T.2
Explorer | Level 4
9 years ago
Solved

get_shared_links returns empty array

When I call the get_shared_links API with a path, I get back a 200 but an empty links array. So in this scenario I call create_shared_link_with_settings. This API returns a "shared links already exist" error.

I am passing in a path of /Records/paul/Births/Thompson-Hayward-20160403133425.backup and my app is EvidentiaSoftware, so I expect it to be found sinc eit exists at /Apps/EvidentiaSoftware/Records/paul/Births/Thompson-Hayward-20160403133425.backup

What am I doing wrong?

var path = "/Records/paul/Births/Thompson-Hayward-20160403133425.backup"
$http.post("https://api.dropboxapi.com/2/sharing/get_shared_links",
                JSON.stringify({
                    "path": path
                }),
                {
                    headers: {
                        'Content-Type': "application/json",
                        'Authorization': 'Bearer ' + dSvc.GO.onlineStorage.D1.accessResponse.access_token
                    }
                }
            ).then(function (res) {
...

    $http.post("https://api.dropboxapi.com/2/sharing/create_shared_link_with_settings",
            JSON.stringify({
                "path": path,
                "settings": {
                    "requested_visibility": "public"
                }
            }),
            {
                headers: {
                    'Content-Type': "application/json",
                    'Authorization': 'Bearer ' + dSvc.GO.onlineStorage.D1.accessResponse.access_token
                }
            }
        ).then(function (res) {

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,953 PostsLatest Activity: 9 hours ago
353 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!