1
votes

I'm trying to read insights of my Twitter account with Twitter Insights API and when I request to that given end point I get and error called :

{
    "errors": [
        {
            "code": "UNAUTHORIZED_ACCESS",
            "message": "This request is not properly authenticated"
        }
    ],
    "request": {
        "params": {}
    }
}

This is the end point I tried :

https://ads-api.twitter.com/2/insights/accounts/:account_id/available_audiences

I used the given credentials like Consumer Key, Secret and Token, Token secret.

Can anyone explain me why I'm getting this error ? And what I should do ?

Here is a screenshot

enter image description here

Header:

enter image description here

1
Did you send token in headers ?Sergio Escudero
Yes I ticked that checkbox when I was doing the API call.Tharindu Thisarasinghe
With Bearer + TOKEN ?Sergio Escudero
Well, I don't know that. I just fill up the header information with the details on my Twitter AppTharindu Thisarasinghe
try in headers put a key: "Authorization" and a value: "Bearer "+YOURTOKENSergio Escudero

1 Answers

0
votes

You have to check box "Add params to header"

Everything else should be ok. Just check Consumer Key, Consumer Secret,... data