Should I get HTTP status code 422 from API if I don't specify an explicit per_page value when trying to return more records than the default per_page value?

Not sure if this is a bug, but I noticed that, lately, if I try to return an explicit list of >30(?) observations, I get HTTP status code 422.

For example, this request for 30 observations returns just fine:
https://api.inaturalist.org/v1/observations/100910059,19157431,97973595,30281698,24107426,67345496,98158838,81946002,104533280,38844224,104513735,77198875,90935397,104380642,97499001,20713115,33095184,104438648,19196057,19196059,32523867,32536869,32536889,32536897,101273911,18814856,18896919,18953782,90935386,90935391

… but this request for 31 observations returns {"error":"Unprocessable Entity","status":422}:
https://api.inaturalist.org/v1/observations/100910059,19157431,97973595,30281698,24107426,67345496,98158838,81946002,104533280,38844224,104513735,77198875,90935397,104380642,97499001,20713115,33095184,104438648,19196057,19196059,32523867,32536869,32536889,32536897,101273911,18814856,18896919,18953782,90935386,90935391,70525226

… but then if I add an explicit per_page parameter at the end of the request for 31 observations, it returns just fine:
https://api.inaturalist.org/v1/observations/100910059,19157431,97973595,30281698,24107426,67345496,98158838,81946002,104533280,38844224,104513735,77198875,90935397,104380642,97499001,20713115,33095184,104438648,19196057,19196059,32523867,32536869,32536889,32536897,101273911,18814856,18896919,18953782,90935386,90935391,70525226?per_page=31

Was it an intentional change for this new requirement to add an explicit per_page if you go beyond the default per_page limit? (in the past, it seemed to accept a list of ids numbering up to the max per_page limit, without requiring an explicit per_page value.)

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.