Re: [bitly-api] How do you just get a shortened link from PHP?

284 views
Skip to first unread message

Matt LeMay

unread,
Jul 25, 2012, 2:37:48 PM7/25/12
to bitl...@googlegroups.com

Hi, Bob-

The above example should still work, yes. Can you verify once that you're using the exact login and API key values shown at http://bitly.com/a/your_api_key? We'll work on making the documentation clearer for endpoints that still support API key authentication, sorry for the confusion.

Thanks, and all the best,
Matt

On Jul 25, 2012 2:23 PM, "Bob S" <bsab...@gmail.com> wrote:
Hello,

  I've tried following several examples from the web of how to get a shortened URL using bit.ly and PHP, like so:

            $api_call = file_get_contents("http://api.bitly.com/v3/shorten?login=".BIT_USER."&apiKey=".BIT_API."&longUrl=".$url);

Apparently this doesn't work anymore?  I get error 500 invalid login.  Is there a simple example somewhere of how to do it now?  I tried to follow the OAuth API documentation but don't know if I need to.   It set my head spinning compared to the above.  Any comparable examples to the above?

Thanks
Bob


--
You are subscribed to the bit.ly API discussion group.
To post, email to bitl...@googlegroups.com
For more options, visit http://groups.google.com/group/bitly-api

Matt LeMay

unread,
Jul 27, 2012, 2:40:31 PM7/27/12
to bitl...@googlegroups.com
Hi, Bob-

The 'o_7h2i2h3nat' value is actually the one you should use to call the API; it is an opaque, unique identifier that is generated when you create an account via Facebook or Twitter. "@voxelapp" is your display name, which you should see consistently in the bitly visual interface.

We're going to update the dev site next week to make this clearer; you aren't doing anything wrong! 

Thanks, and all the best,
Matt

On Fri, Jul 27, 2012 at 2:19 PM, Bob S <bsab...@gmail.com> wrote:

When I go to that link, I see the correct API key, but it says my user name is 'o_7h2i2h3nat'.

It should be 'voxelapp'.  What am I doing wrong?

Matt LeMay

unread,
Jul 30, 2012, 11:13:27 AM7/30/12
to bitl...@googlegroups.com
Hi, Bob-

http://bitly.com/a/your_api_key was linked from the very bottom of the "authentication" page, but it was way hard to find, and not directly linked to from the /v3/shorten API endpoint documentation. We updated the documentation this morning to make this clearer:


Thanks again for your feedback here, this was really helpful!

All the best,
Matt

On Fri, Jul 27, 2012 at 3:13 PM, Bob S <bsab...@gmail.com> wrote:
OK -- but where did you get that link from?  In other words, how do I find that name when I am logged into my account?  I don't see it anywhere, and I would not have known about 
 http://bitly.com/a/your_api_key without posting a question here to these groups.  
Reply all
Reply to author
Forward
0 new messages