API Url shortner API not registering Shortcut history with API key

I use the Goo.gl API to shorten some links. Calling the POST method works well, and short URLs also work, but I have a question regarding the history of short links.

If I create a short URL on goo.gl, it will be stored there for viewing and viewing all analytics related to it, but if I generate it through the POST API using my API key, the link will not be added to my history, and I don’t see any data related to it on the Goo.gl page. Is there access to this information?

+5
source share
1 answer

This is the difference between public and private.

Url Shortener API is a public API. This means that you do not need to authenticate in order to use it. This is why the API public key works. However, when you use the public api key, the api does not know who you are personally.

Solution: you need to switch to Oauth2 . Authenticate your application with an access token, and instead send the API key, send access_token. Then, when links are created, they must be added to your account, and you will get analytics for them.

+3
source

Source: https://habr.com/ru/post/1266824/


All Articles