cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: nil cursor never returned

nil cursor never returned

Mark L.45
Collaborator | Level 8

Using this call 

https://api.dropboxapi.com/2/sharing/list_shared_links

Getting a cursor back cause I had many many links; was working well, until this evening when it stopped working and now just loops, returning the same cursor again and again.

Tried revoking my share?

Tried deleting all the links, have only 15 now?

Tried restarting everything?

Nothing works? project has come to a standstill tonight... it not my code, its the dropbox server? too many links perhaps?

Can someone check your end?

 

 

8 Replies 8

Rich
Super User II

Moved to the API forum.

Greg-DB
Dropbox Staff

Mark, can you share a sample response or two that's giving you trouble? Thanks in advance! 

Mark L.45
Collaborator | Level 8

Sure, this is what I get returned, again and again and again.

 

Body: Optional({"links": [{".tag": "file", "url": "https://www.dropbox.com/s/v2a989i8yfmmmvw/acme2048A.001.png?dl=0", "id": "id:piyP0EHNIGAAAAAAAAAAAQ", "name": "acme2048A.001.png", "path_lower": "/slidestack/acme2048a/acme2048a.001.png", "link_permissions": {"resolved_visibility": {".tag": "public"}, "requested_visibility": {".tag": "public"}, "can_revoke": true}, "client_modified": "2016-05-19T18:39:07Z", "server_modified": "2016-05-19T18:39:08Z", "rev": "1848bb52c3", "size": 62002}], "has_more": true, "cursor": "eyJwcm9nIjogIjE0NjM2ODQ4NzEiLCAic2lnIjogIkFaTTRTLUJ6ajE1Q1U2aUluRVJ6dUdjSXlWTkplVDdjYXd3Ty1BQW55bHdReVEifQ"})

The time shown here 18:39 is roughly the time it broke I suspect. My code resubmits list sharing links with this cursor and gets back the same cursor, we never move ahead?

Just tried it again this morning, now 06:27 so almost 12 hours later and it behaves the same way.

Greg-DB
Dropbox Staff

Thanks, that's helpful! We're looking into it.

I can't offer a timeline for a fix right now, so you may want to detect this scenario (e.g., based on the repeated cursor and has_more=true) to work around it for now.

Mark L.45
Collaborator | Level 8

Maybe a clue, was testing an app I written that uses shares; I had created around 800+ @ that point, changed the code yesterday morning to work around it, going to try it this morning perhaps, maybe put in your fix Gregory, a good suggestion. 

test s.
New member | Level 1

I started seeing this in my application. Can you please provide a timeline/date for this fix. 

Greg-DB
Dropbox Staff

No update or timeline for this right now.

Mark L.45
Collaborator | Level 8

Again seeing this feature. Wrote a PERL script that gets around it, using Greg's suggestion.

#!/usr/bin/perl

use JSON;

use Data::Dumper;

 

$preheat = `curl -X POST https://api.dropboxapi.com/2/sharing/list_shared_links  --header "Authorization: Bearer ab-YourAUTH"  --header "Content-Type: application/json"  --data "{}"`;

$pcursor = $cursor = ";

 

do {

$pcursor = $cursor;

$text = decode_json($preheat);

print  Dumper($text);

$cursor = $text->{'cursor'};

#print "[$pcursor] [$cursor]\n";

if ($cursor ne $pcursor) {

$paras = "\\\"cursor\\\":\\\"$cursor\\\";

$cmd = "curl -X POST https://api.dropboxapi.com/2/sharing/list_shared_links  --header \"Authorization: Bearer ab-YourAUTH\"  --header \"Content-Type: application/json\"  --data \"{$paras}\";

$preheat = `$cmd`;

} else {

$cursor = ";

}

} until ($cursor eq ");

Need more support?