Method to Use Bit.ly URL Shortener Service


#1

We all make Apps. In some apps we also use URL Shortening Component. It can be used by the Google URL Shortener Extension by @Mika.
But I think why don’t we make Bitly URL Shortener Method. So I found the most easiest way by sending a Request to Bit.ly by using a Web Component. See the below Attached Screenshot.

I have made a Proper Procedure for the link Shortening Method. The URL we send to Web Component is as Follows
https://api-ssl.bitly.com/v3/shorten?access_token=(Access_Token)&longUrl=(Your_URL)&format=txt
*Things you need
A Access Token of Bitly and the Long URL
You can get the Access token by going to bit.ly>Menu>Settings>Advance Settings>Oauth>Generic Access Token
Remember you can’t just send a Normal URL to be Shortened. It should be Percent Encoded. For Percent Encoding I make another Result Procedure. It carries around 18 Text Replacement Blocks as their are total 18 Characters in a URL which needs to be encoded.
All this setup works to send a Request to bit.ly and when we got the Response from Web Component we can use it anywhere we need it.
You can Download Sample Apk and Aia below
bitly.aia (4.2 KB)
bitly.apk (2.3 MB)


#2

Thanks for sharing this @Techy_Guy,

I’ve tidied up the screenshot a bit so that we can see all the blocks! :smile:


#3

there is one method in Web component: text UriEncode(text text), you may use it for what you did with percent_encoding procedure.


#4

Actually I did not saw other blocks in web Component. Thanks for your suggestion.
I just started to found on Google how to encode a URL using Java Script but I did not find a way. So I just used the Replacement Blocks


#5

Hi thank you for the post. But im having an error invalid uri? I already added my generic access token form bitly. I did not change anything. I just added my access token. Thank you


#6

You solved my issue Thanks man
Sandeep