tags:

views:

49

answers:

1

How to implement bit.ly api in android or any url shorten api plz suggest me something

+1  A: 

To get started, you'll need a free bit.ly user account and apiKey. Signup at: http://bit.ly/a/sign_up

Read developer documentation of bit.ly: creating a new URL, authentication, etc. Once authenticated you need to fire a HTTP GET request to shorten a URL.

Sample url:

http://api.bit.ly/v3/shorten?login=bitlyapidemo&apiKey=yourAPIkey&longUrl=http%3A%2F%2Fbetaworks.com%2F&format=xml

Response:

<?xml version="1.0" encoding="UTF-8"?>
<response>
    <status_code>200</status_code>
    <status_txt>OK</status_txt>
    <data>
        <url>http://bit.ly/cmeH01&lt;/url&gt;
        <hash>cmeH01</hash>
        <global_hash>1YKMfY</global_hash>
        <long_url>http://betaworks.com/&lt;/long_url&gt;
        <new_hash>0</new_hash>
    </data>
</response>
Ankit Jain
hey thanks ankit it works for me.
ankitagahoi