Avnish1985 / bitly-api

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

404 error on /shorten with no format specified #34

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. 
http://api.bit.ly/shorten?version=2.0.1&longUrl=http://www.validurl.com/blabla.h
tmll&login=USERNAME&apiKey=APIKEY&history=1 
2.(I replaced the url, API key and USERNAME for privacy concerns.)
3.

What is the expected output? What do you see instead?
I am expecting the return of a shortened url. What I get back is a 404 not 
found error.

What version of the product are you using? On what operating system?
2.0.1

Please provide any additional information below.
This is part of an automated script that sends the request to bit.ly to 
generate a link and then tweet it.

Original issue reported on code.google.com by kalema...@gmail.com on 24 Feb 2011 at 8:35

GoogleCodeExporter commented 8 years ago
When I look on my bit.ly aacount, the URLS are created, but it is not returned. 
This is the full php error I am getting: 
Warning: 
file_get_contents(http://api.bit.ly/shorten?version=2.0.1&longUrl=http://www.val
idurl.com&login=kalemanzi&apiKey=R_bd0373notrealkey9995bf7d1553e32d&history=1) 
[function.file-get-contents]: failed to open stream: HTTP request failed! 
HTTP/1.1 404 Not Found in /home/wavescap/public_html/tweet/index.php on line 25
Cape St Francis: A meeting between a parliamentary delegation and about 200 
members of the public about the proposed nuclear powerpla...

Original comment by kalema...@gmail.com on 24 Feb 2011 at 8:40

GoogleCodeExporter commented 8 years ago
I fixed it by changing the call to 
http://api.bit.ly/shorten?longUrl=http://www.validurl.com&login=kalemanzi&apiKey
=R_bd0373notrealkey9995bf7d1553e32d&format=json after looking at the api.
Thanks

format=json 

Original comment by kalema...@gmail.com on 24 Feb 2011 at 9:25

GoogleCodeExporter commented 8 years ago
thanks for the bug report; this has been fixed. 

You should however upgrade to the current /v3/shorten endpoint as the /shorten 
endpoint your are using was deprecated in March 2010. you can find current 
documentation for /v3/shorten at http://api.bit.ly/

Original comment by jehiah on 24 Feb 2011 at 10:54