How to refresh / get new Access token automatically in rest message`

shaik_irfan
Tera Guru

Hi,

I am doing integration with Bitly whcih is working fine. but the token is keep expiring every 15 mins and i dont see any refresh token option in bitly documentation can anyone please help me how to autmatically refresh the token upon expires ?

1 ACCEPTED SOLUTION

kklosterman
Giga Guru

?

"

Application using a single account

Most folks using the Bitly API will be writing one or more applications that are used within a single account, such as a CMS integration or bulk shortening script that creates all short URLs in a single account. For this use case, you don't need to worry about implementing entire OAuth 2.0 flows just to obtain an access token. Instead, you can use our Generic Access Token. Log in to Bitly and navigate to the OAuth Apps page, click "Generic Access Token", enter your Bitly password, copy the access token, and paste it into your application for use in making API requests.

"

https://dev.bitly.com/v4_documentation.html

 

 

 

View solution in original post

4 REPLIES 4

kklosterman
Giga Guru

?

"

Application using a single account

Most folks using the Bitly API will be writing one or more applications that are used within a single account, such as a CMS integration or bulk shortening script that creates all short URLs in a single account. For this use case, you don't need to worry about implementing entire OAuth 2.0 flows just to obtain an access token. Instead, you can use our Generic Access Token. Log in to Bitly and navigate to the OAuth Apps page, click "Generic Access Token", enter your Bitly password, copy the access token, and paste it into your application for use in making API requests.

"

https://dev.bitly.com/v4_documentation.html

 

 

 

Hi sir,

Yes this is to shorten the long url

 

I did generate the access token, so now when i change the Authentication type as Basic and when i change the access token to with the generate token value.

 

 

 

find_real_file.png

 

 

 

 

When i test i am getting 403 error

 

find_real_file.png 

error 403 occur due to necessary permission .

check if it has permission to create record on target environment. 

Thank you Kris.

 

As suggested i created Generic Access Token and called in the Rest Message and later in the Get method just called https://api-ssl.bitly.com/v4/shorten endpoint and in the parameters passed in json format as suggested by Bit ly.

 

{
"group_guid": "Get the group guid",
"domain": "bit.ly",
"long_url": "URL to shorten"
}