Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bit.ly bitlink creation always return forbidden even after email verification?

I have registered and done email verification. Then, I try the most baisc API trying to shorten a testing link. The following is my HTTP packet.

POST /v4/shorten HTTP/1.1
Host: api-ssl.bitly.com
Content-Type: application/json
Authorization: Bearer my-generic-access-token
Cache-Control: no-cache

{
"group_guid": "shorten_link_testing",
"domain": "mytesting.site.com",
"long_url": "http://mytesting.site.com/"
}

And the following is the return from bit.ly:

{
    "message": "FORBIDDEN",
    "resource": "bitlinks",
    "description": "You are currently forbidden to access this resource."
}

I am using Postman to test, so I am quite sure it is not the problem of my code. And the message format meets that in the documentation of bit.ly, so at least the connection is success. As far as I know, bit.ly should have 10,000 quota for free shorten link per month for every account, right? What have I missed so that I am banned from the shorten link service?

like image 592
cytsunny Avatar asked Jul 20 '18 07:07

cytsunny


People also ask

Why do Bitly links not work?

Any time a bit.ly or bitly.com link leads to a page that says "Something's wrong here...", the link that was entered is either invalid or wasn't set up properly. Remember that Bitly is a link-shortening service, and any of our users can create a bit.ly link.

What is Group_guid in Bitly?

The group_guid param needs to reference the id of a group associated with your bitly account. Hit this api endpoint with your generic access token to get a list of the groups/guids bitly has associated with your account: GET https://api-ssl.bitly.com/v4/groups. Hope this helps!!


1 Answers

The group_guid param needs to reference the id of a group associated with your bitly account. Hit this api endpoint with your generic access token to get a list of the groups/guids bitly has associated with your account: GET https://api-ssl.bitly.com/v4/groups.

Apparently the domain param is optional, because your account may have a default domain associated with it. It worked for me after removing the domain param altogether. https://groups.google.com/forum/#!topic/bitly-api/9RywN3ETLkg

Hope this helps!!

like image 164
LMabley Avatar answered Nov 03 '22 04:11

LMabley