1

Possible Duplicate:
URL Length Limit For For Requests Taking Vectorised Ids (/answers/{id}, /questions/{id}, etc)

update

bp's comment makes it clear that it is a url length issue. And now that I look at it with fresh eyes, I realize that the q linked at the top of the page does give some guidance, as the ids are actually part of the path, not the query string.

Hmmm.. this is rather annoying but is as designed, I suppose.


As per URL Length Limit For For Requests Taking Vectorised Ids (/answers/{id}, /questions/{id}, etc), a request with 100 ids should be accepted.

consider:

100 ids, url < 900 characters http://api.stackoverflow.com/0.8/questions/2925149;2917005;2917506;2893225;2917380;2917239;2917185;2915496;2907535;2912954;2913404;2913459;190976;2907169;2906621;2906521;2906406;2906190;2906116;2906069;2904280;2905562;2905429;2905194;2905185;2905142;2904948;2516575;2897944;2890681;2890028;2889510;2889515;2889374;2887193;2889158;2889265;2848125;2888921;2888345;2888264;2122831;2886867;2879265;2878878;2349378;2870181;2870138;2866372;2866331;2865863;2866158;2864404;2864433;2864582;2864236;2865017;2864549;2864556;2865196;2864883;2865090;2863640;2863456;2863197;2863034;2862991;2842585;2860636;2858519;2852121;2857110;2856856;882998;2856644;2856532;2856585;2855335;2855263;2853415;2830314;2850899;2846690;2847230;2844836;2846764;2846527;2846623;1650861;1849455;1709112;1133615;328566;2846329;2846089;2845969;2826808;2839296;2840899;2839819?page=1&pagesize=100

Returns HTTP Error 400. The request URL is invalid.. In fact, any url with more than 31 ids returns HTTP Error 400. The request URL is invalid.

while an url with exactly 31 ids returns 400 Bad Request

http://api.stackoverflow.com/0.8/questions/2860636;2858519;2852121;2857110;2856856;882998;2856644;2856532;2856585;2855335;2855263;2853415;2830314;2850899;2846690;2847230;2844836;2846764;2846527;2846623;1650861;1849455;1709112;1133615;328566;2846329;2846089;2845969;2826808;2839296;2840899;2839819?page=1&pagesize=100

and a url with 30 ids returns OK http://api.stackoverflow.com/0.8/questions/2858519;2852121;2857110;2856856;882998;2856644;2856532;2856585;2855335;2855263;2853415;2830314;2850899;2846690;2847230;2844836;2846764;2846527;2846623;1650861;1849455;1709112;1133615;328566;2846329;2846089;2845969;2826808;2839296;2840899;2839819?page=1&pagesize=100

Sky Sanders
  • 12,068
  • 3
  • 31
  • 60
  • The 31 ids URL gives me a blank response, not a 400 error. – badp Jun 12 '10 at 22:33
  • http://api.stackoverflow.com/0.8/questions/4;6;8;9;11;13;14;16;17;19;23;24;25;28;34;36;39;42;48;59;61;66;72;79;80;85;88;90;104;108;109;126 is a link with 31 (valid) ids which returns content for me. – badp Jun 12 '10 at 22:47
  • @bp whom cannot be @ed due to the 2 letter name: Trust me. It is a 400. – Sky Sanders Jun 12 '10 at 23:28
  • r.e. http://api.stackoverflow.com/0.8/questions/4;6;8;9;11;13;14;16;17;19;23;24;25;28;34;36;39;42;48;59;61;66;72;79;80;85;88;90;104;108;109;126 is 32 ids, but indeed does return results. Must be a URL length issue. The 31 id example is 308 characters. hmmm... – Sky Sanders Jun 12 '10 at 23:30
  • for those that dredge this up from the deep - here is some more info and a solution http://stackapps.com/questions/889/dev-tip-how-to-batch-up-multiple-id-requests-to-maximize-economy-and-still-avoid – Sky Sanders Jun 29 '10 at 16:48

0 Answers0