# Shortening URL - either bit.ly or short.io

**URL:** https://community.glideapps.com/t/shortening-url-either-bit-ly-or-short-io/36405
**Category:** Ask for Help
**Created:** [December 27, 2021, 8:32pm UTC](https://community.glideapps.com/t/shortening-url-either-bit-ly-or-short-io/36405 "2021-12-27T20:32:55Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![Test\_Test](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/test_test/32/30930_2.png) [@Test\_Test](https://community.glideapps.com/u/Test_Test)
#### Post date: [December 27, 2021, 8:32pm UTC](https://community.glideapps.com/t/shortening-url-either-bit-ly-or-short-io/36405/1 "2021-12-27T20:32:55Z")

</div>

Continuing the discussion from [Link shortener with Experimental column](https://community.glideapps.com/t/link-shortener-with-experimental-column/32380/4):

Hi,  
I’ve recategorized this for “How To” as I’m not sure this need to be under an experimental code.  
Trying to shorten a url using either bit.ly or [short.io](http://short.io). This worked perfectly on Google Script, but I cannot get it to work on Glide. Tried all possible column types, including the experimental code suggested in the discussion above.

From [Short.io](http://Short.io), I got this url:  
[https://api.short.io/links/tweetbot?domain=YOURDOMAIN&apiKey=SECRETKEY&originalURL=https://google.com/](https://api.short.io/links/tweetbot?domain=YOURDOMAIN&apiKey=SECRETKEY&originalURL=https://google.com/)

This works fine (using a secret key) when opening it in a browser. It generates a shortlink and the short link is working.  
I simply cannot get it to work inside Glide.

Rather similar situation with bit.ly, although I played with this option less.

Any ideas?

---

<div class="post-metadata">

### Author: ![Yasin\_Hassanien](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/yasin_hassanien/32/9042_2.png) [@Yasin\_Hassanien](https://community.glideapps.com/u/Yasin_Hassanien)
#### Post date: [December 27, 2021, 9:01pm UTC](https://community.glideapps.com/t/shortening-url-either-bit-ly-or-short-io/36405/2 "2021-12-27T21:01:31Z")

</div>

You need to use api column

---

<div class="post-metadata">

### Author: ![Test\_Test](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/test_test/32/30930_2.png) [@Test\_Test](https://community.glideapps.com/u/Test_Test)
#### Post date: [December 27, 2021, 9:04pm UTC](https://community.glideapps.com/t/shortening-url-either-bit-ly-or-short-io/36405/3 "2021-12-27T21:04:01Z")

</div>

Sure, tried it.  
fetch JSON column directed towards the column with that [short.io](http://short.io) URL.  
Not getting anything. Just an empty column.

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [December 28, 2021, 1:13am UTC](https://community.glideapps.com/t/shortening-url-either-bit-ly-or-short-io/36405/4 "2021-12-28T01:13:36Z")

</div>

Have you tried using a [Construct URL](https://docs.glideapps.com/all/topics/computed-columns/primary/construct-url) column?

---

<div class="post-metadata">

### Author: ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)
#### Post date: [December 28, 2021, 1:19am UTC](https://community.glideapps.com/t/shortening-url-either-bit-ly-or-short-io/36405/5 "2021-12-28T01:19:32Z")

</div>

I use webhook to create the [short.io](http://short.io) links and a construct URL column to use within the app. Used it to develop this:  
[Dygi.me — My first ever SaaS built with Glide](https://community.glideapps.com/t/dygi-me-my-first-ever-saas-built-with-glide/34754)

---

<div class="post-metadata">

### Author: ![Test\_Test](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/test_test/32/30930_2.png) [@Test\_Test](https://community.glideapps.com/u/Test_Test)
#### Post date: [December 28, 2021, 5:46am UTC](https://community.glideapps.com/t/shortening-url-either-bit-ly-or-short-io/36405/6 "2021-12-28T05:46:48Z")

</div>

> [@Robert\_Petitto](#):
>
> [Dygi.me](http://Dygi.me) — My first ever SaaS built with Glide

Wonderful app, but I can’t see below the hood. Reading the follow-up posts on that showcase, I understand you’re using Zapier. While it’s a great, and super-clean solution, I prefer to avoid it as I don’t want to give Zapier access to these confidential Google Sheets. Any other ideas?

---

<div class="post-metadata">

### Author: ![Test\_Test](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/test_test/32/30930_2.png) [@Test\_Test](https://community.glideapps.com/u/Test_Test)
#### Post date: [December 28, 2021, 5:56am UTC](https://community.glideapps.com/t/shortening-url-either-bit-ly-or-short-io/36405/7 "2021-12-28T05:56:27Z")

</div>

> [@Darren\_Murphy](#):
>
> Have you tried using a [Construct URL](https://docs.glideapps.com/all/topics/computed-columns/primary/construct-url) column?

Hi  
I was able to create the URL which I plan to send to the API using template. My logical skills are still not sharp enough to grasp the full power of Construct URL, but template is fine for now.  
The second step is where I’m stuck. Using Fetch JSON column but not getting anything back.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/1/51270337132e77decbf2c75285d97a85dc954963.png)

When I manually follow the same exact link from the template column I do get a response (masked some part with XXX):

> {“id”:1172828683,“DomainId”:259875,“OwnerId”:260172,“clicksLimit”:null,“path”:“Z5bUSl”,“originalURL”:“[https://google.com/",“cloaking”:false,“archived”:false,“redirectType”:302,“icon”:null,“title”:null,“iphoneURL”:null,“androidURL”:null,“expiresAt”:null,“expiredURL”:null,“source”:“api”,“splitURL”:null,“splitPercent”:null,“integrationGA”:null,“integrationGTM”:null,“integrationFB”:null,“integrationAdroll”:null,“createdAt”:“2021-12-27T19:59:56.000Z”,“updatedAt”:“2021-12-27T19:59:56.000Z”,“secureShortURL”:“XXXXXXXX/Z5bUSl”,“idString”:“lnk\_15Bx\_1hn4jF”,“shortURL”:“XXXXX/Z5bUSl”,"duplicate](https://google.com/%22,%22cloaking%22:false,%22archived%22:false,%22redirectType%22:302,%22icon%22:null,%22title%22:null,%22iphoneURL%22:null,%22androidURL%22:null,%22expiresAt%22:null,%22expiredURL%22:null,%22source%22:%22api%22,%22splitURL%22:null,%22splitPercent%22:null,%22integrationGA%22:null,%22integrationGTM%22:null,%22integrationFB%22:null,%22integrationAdroll%22:null,%22createdAt%22:%222021-12-27T19:59:56.000Z%22,%22updatedAt%22:%222021-12-27T19:59:56.000Z%22,%22secureShortURL%22:%22XXXXXXXX/Z5bUSl%22,%22idString%22:%22lnk_15Bx_1hn4jF%22,%22shortURL%22:%22XXXXX/Z5bUSl%22,%22duplicate)”:true}

* * *

edit:  
Just found [this tutorial](https://developers.short.io/docs/creating-short-links-from-javascript) but I still get this to work inside a Glide column… ☹

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [December 28, 2021, 6:35am UTC](https://community.glideapps.com/t/shortening-url-either-bit-ly-or-short-io/36405/8 "2021-12-28T06:35:57Z")

</div>

My reason for suggesting the Construct URL column is that it will automatically take care of URL escaping where necessary. It’s just a guess, but that’s what might be tripping you up here.

---

<div class="post-metadata">

### Author: ![Test\_Test](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/test_test/32/30930_2.png) [@Test\_Test](https://community.glideapps.com/u/Test_Test)
#### Post date: [December 28, 2021, 7:20am UTC](https://community.glideapps.com/t/shortening-url-either-bit-ly-or-short-io/36405/9 "2021-12-28T07:20:48Z")

</div>

> [@Darren\_Murphy](#):
>
> automatically take care of URL escaping where necessary.

Understood, thanks.  
Any thoughts about why the JavaScript column isn’t working, although it’s working perfectly fine on Google Script?

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [December 28, 2021, 7:36am UTC](https://community.glideapps.com/t/shortening-url-either-bit-ly-or-short-io/36405/10 "2021-12-28T07:36:51Z")

</div>

My only thought was that there might be some characters in the templated URL that is causing it to break. Which again, is why I suggested the URL column.  
Pasting it into a browser most likely works because most browsers will automatically add URL escaping. You could test this by copying the URL that your browser produces and pasting it back into a template column, and then try that with the Fetch JSON column.

Again, this is just a guess.

---

<div class="post-metadata">

### Author: ![Test\_Test](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/test_test/32/30930_2.png) [@Test\_Test](https://community.glideapps.com/u/Test_Test)
#### Post date: [December 28, 2021, 7:49am UTC](https://community.glideapps.com/t/shortening-url-either-bit-ly-or-short-io/36405/11 "2021-12-28T07:49:03Z")

</div>

I 100% agree with you that the Construct URL solution is the best way to move forward here, but I’m truly struggling with it.  
When I configure this:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/e/6e95d385d37d99df9132f718afc994a8b620905b.png)

I get this URL:  
[https://api.short.io/links/tweetbot?domain=XXXXXX&apiKey=XXXXXX&originalURL=WALINK?WALINK=https%3A%2F%2Fwa.me%2Fsend%3Fphone%XXXXXXXX](https://api.short.io/links/tweetbot?domain=XXXXXX&apiKey=XXXXXX&originalURL=WALINK?WALINK=https%3A%2F%2Fwa.me%2Fsend%3Fphone%25XXXXXXXX)

In other words. not sure how to use the parameters section here…

* * *

OK, I might have partly understood how to use these parameters:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/d/0d40b25f1af40f946efaa255393bb03c0ed36873.png)

But it still doesn’t work. The response I get is:

> {“error”:“No originalURL parameter provided”,“success”:false}

I have provided this parameter but I think that it’s actually something with the transitioning to percentage URL coding. It’s not recognized by either WhatsApp (when trying to run manually in a browser) or by [Short.io](http://Short.io), as you can see in the response above.

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [December 28, 2021, 8:25am UTC](https://community.glideapps.com/t/shortening-url-either-bit-ly-or-short-io/36405/12 "2021-12-28T08:25:25Z")

</div>

> [@Darren\_Murphy](#):
>
> You could test this by copying the URL that your browser produces and pasting it back into a template column, and then try that with the Fetch JSON column.

Have you tried the above?  
If that works, it would confirm that you need the Construct URL column. If it doesn’t work, then the problem lies elsewhere.

Anyway, for your Construct URL column:

- Data  
– `https`  
– `api.short.io`  
– `links/tweetbot`
- Query Parameters  
– `domain` : `XXXXX`  
– `apiKey` : `XXXXXX`  
– `originalURL` : `WALINK`

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [December 28, 2021, 8:55am UTC](https://community.glideapps.com/t/shortening-url-either-bit-ly-or-short-io/36405/13 "2021-12-28T08:55:17Z")

</div>

If you can manually follow that link and get a response but not in Glide, I think this is a CORS problem and I haven’t found a way to deal with it when I ran into it.

> **[What is CORS (cross-origin resource sharing)? Tutorial & Examples | Web...](https://portswigger.net/web-security/cors)**
>
> In this section, we will explain what cross-origin resource sharing (CORS) is, describe some common examples of cross-origin resource sharing based attacks, ...

---

<div class="post-metadata">

### Author: ![Test\_Test](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/test_test/32/30930_2.png) [@Test\_Test](https://community.glideapps.com/u/Test_Test)
#### Post date: [December 28, 2021, 11:25am UTC](https://community.glideapps.com/t/shortening-url-either-bit-ly-or-short-io/36405/14 "2021-12-28T11:25:00Z")

</div>

Happy to say that I solved it, or at least I think so… 🙂  
Simplest solution was to add another service to the party: [shareaholic](https://www.shareaholic.com/api/shortener)

Once registered at both shareaholic and Bit.ly, we build something like this:  
first column - thanks to @Darren_Murphy  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/2/c2dc375cefe056efa1f09feb2705f89aba0f27f8.png)

Second column

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/3/b399af89030aa8a97edb1d9c2b5691e45b827e8e.png)

Note, parameters:  
apikey - free from shareaholic  
url - pointing to the first column  
service[token] - free from Bit.ly

Third, and last, column  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/1/b18ccce00b37a04d9fc4159fc307e74024ccef73.png)

And now, we have a short URL curtesy of Bit.ly and shareaholic 🙂

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [December 28, 2021, 3:13pm UTC](https://community.glideapps.com/t/shortening-url-either-bit-ly-or-short-io/36405/15 "2021-12-28T15:13:07Z")

</div>

Looking at your screenshot, a giant red flag for me was that you had ‘originalURL=’ as a query parameter name instead of ‘originalURL’. That extra equal symbol probably resulted in a parameter name of ‘originalURL==’. Which makes sense that the error you were given was ‘No original url parameter’. It couldn’t find the parameter value because no value existed after the first equal symbol, other than another equal symbol, and the second equal just threw everything off.

---

<div class="post-metadata">

### Author: ![Test\_Test](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/test_test/32/30930_2.png) [@Test\_Test](https://community.glideapps.com/u/Test_Test)
#### Post date: [December 28, 2021, 7:00pm UTC](https://community.glideapps.com/t/shortening-url-either-bit-ly-or-short-io/36405/16 "2021-12-28T19:00:07Z")

</div>

> [@Jeff\_Hager](#):
>
> a giant red flag for me was that you had ‘originalURL=’ as a query parameter name instead of ‘originalURL’.

Hi  
Yes, you’re right. I also noticed it after posting. I corrected it but, sadly, it didn’t do any good.  
Happy to review your solution if you can make it work. I actually prefer [short.io](http://short.io) to bit.ly, but at the end of the day they’re both fine.  
Thanks

---

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)
#### Post date: [December 29, 2021, 7:00pm UTC](https://community.glideapps.com/t/shortening-url-either-bit-ly-or-short-io/36405/17 "2021-12-29T19:00:13Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
