Bitly API Shorten call..

307 views
Skip to first unread message

Rajesh Tambe

unread,
Oct 15, 2013, 2:53:40 PM10/15/13
to bitl...@googlegroups.com
Trying to test the Bitly Dot Net DLL using Powershell. I am loading the DLL successfully, but the call to Shorten fails. Error says "unable to extract errorCode". Where do I go from here.
Powershell code is below:

cls
$opsdir = "C:\Bitly\"
[Reflection.Assembly]::LoadFile($opsdir +"BitlyDotNET.dll")
$Bitly = New-Object BitlyDotNET.Implementations.BitlyService("x...@mycompany.com", "API Key I got")
[string]$ROutput = $Bitly.Shorten("http://cnn.com")

Thoughts?

ja...@bit.ly

unread,
Oct 15, 2013, 3:18:01 PM10/15/13
to bitl...@googlegroups.com
It looks like the endpoint that DLL hits does still work, but the first argument to BitlyService should be your login, not your email address.

You can find the login on the settings page, just click on the "Show Legacy API Key" link.

Hope that helps,
James

Rajesh Tambe

unread,
Oct 15, 2013, 4:42:33 PM10/15/13
to bitl...@googlegroups.com
James,
I decided to move away from using the DLL. Instead I am simply going to use HTTPS POSTS. I am successfully able to get a short Bitly URL. Is it possible to delete/remove/update this Short URL? My application requirement is that first I create a short bitly URL and then after pre-defined number of days, I need to expire/remove/delete this short URL. How can I do that?

Thanks

James Socol

unread,
Oct 15, 2013, 4:45:08 PM10/15/13
to bitl...@googlegroups.com
Given how old that DLL is, I think that's for the best. The /v3/shorten endpoint should be fairly easy to use with the docs: http://dev.bitly.com/links.html#v3_shorten

Once a short URL has been created, there's no way to delete it. You could have your application respond to the long URL with a page informing users that the original page has expired.

James


--
You are subscribed to the bitly API discussion group.
for API Documentation visit http://dev.bitly.com/
---
You received this message because you are subscribed to the Google Groups "bitly API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bitly-api+...@googlegroups.com.
To post to this group, send email to bitl...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
James Socol
API Hacker
ja...@bitly.com

Rajesh Tambe

unread,
Oct 15, 2013, 4:53:10 PM10/15/13
to bitl...@googlegroups.com
That's a bummer!!! So, there is no way to update the short URL either? I might be using the short URL to point to a video file, hence I can't put up a maintenance/redirect page.
Regards

James Socol

unread,
Oct 15, 2013, 4:57:26 PM10/15/13
to bitl...@googlegroups.com
Nope. Bitly URLs are immutable. Is it possible to just respond with an 404 page?

Rajesh Tambe

unread,
Oct 15, 2013, 4:59:43 PM10/15/13
to bitl...@googlegroups.com
I guess. I will have to conjure up something like that.
Thanks for all your help.
Reply all
Reply to author
Forward
0 new messages