sebonlien / bitly-api

Automatically exported from code.google.com/p/bitly-api
0 stars 0 forks source link

misleading error on an invalid api endpoint #23

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem (provide an exact http api call where
appropriate)?
1. Do a HTTP GET request to: 
http://api.bit.ly/v3/prodomain?format=xml&login=bugmenot123&apiKey=R_5a182197450
5ebd314fd18e26eb6c47d&domain=pep.si

Either I expected this to be a valid pro domain (it's mentioned as an example 
at your page) or I expected an ordinary xml result like this:

<?xml version="1.0" encoding="UTF-8"?>
<response>
    <status_code>200</status_code>
    <data>
        <domain>nyti.ms</domain>
        <bitly_pro_domain>1</bitly_pro_domain>
    </data>
    <status_txt>OK</status_txt>
</response>

Instead I get this:

<bitly><errorCode>201</errorCode><errorMessage>Missing parameter 
version</errorMessage><statusCode>ERROR</statusCode></bitly>

Do note that if I call the pro_domain function for nyti.ms I still get the 
"weird" error.

Also note that I get the same "weird" error if I use json format, it's just 
formatted as json in that case.

With regards
Steffen

Original issue reported on code.google.com by ckode...@gmail.com on 18 Aug 2010 at 3:48

GoogleCodeExporter commented 8 years ago
please note the url you are calling '/v3/prodomain' is not the correct 
endpoint. it should be '/v3/bitly_pro_domain'.

(admittedly this error is misleading and we will work to give a 404 response 
for invalid endpoints)

Original comment by jehiah on 20 Oct 2010 at 3:22

GoogleCodeExporter commented 8 years ago
closing as this has been corrected to return a 404 status code for non-existent 
endpoints.

Original comment by jehiah on 5 Apr 2011 at 4:22