A
A
Alexander2021-01-11 12:01:30
API
Alexander, 2021-01-11 12:01:30

Why does an error appear when authorizing in the instagram API?

I can not understand why when accessing the instagram API an error is returned?

I created an application on https://developers.facebook.com/ and generated a token according to the instructions
https://nikolaus.by/blog/integratsii/kak-poluchit-...

My request: https://api.instagram.com /v1/users/search?q=[USERN... TOKEN]
where in USERNAME I specify my name which I take from the user profile

5ffc124352345559236230.png

In access_token I specify my token which was received when registering the application in the section for developers https://developers .facebook.com/ which is generated by clicking on the Generate Token button

5ffc12559991a853505691.png

When I make a request, the following code is returned:

{"meta": {"code": 400, "error_type": "OAuthAccessTokenException", "error_message": "The access_token provided is invalid."}}


error_message: The access_token provided is invalid

In the instagram testers section, I specified my Instagram account via the add Instagram testers button.

5ffc12656d1fc515777876.png

The access_token provided is invalid - maybe I'm not passing all the necessary parameters, or I didn't specify all the necessary rights when creating the application?

Could it be that the reason is that my Instagram account is based on a facebook account? In order to log in to Instagram, I first log in to facebook, because of this, the rights of the Instagram user may not be transferred correctly, but this is just an assumption.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Danny Arty, 2021-01-11
@DanArst

Because this is a short-term token and it is valid only for 1 hour. Create a token and exchange it for a long-term one and try again. Read more here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question