How can I get a list of followers of a twitter account - api

I'm trying to get a list of the accounts being followed by https://twitter.com/verified
how can I do this?
when I try to use the api I get this
{"errors":[{"message":"Bad Authentication data","code":215}]}
I have a developer key but I dont know if I had to paste it in the URL?
please help.
thanks!

You need to obtain a access token before requesting followers.
As specified by the REST API you are required to be authenticated before making the request.
https://dev.twitter.com/docs/api/1.1/get/followers/ids
The options of getting authentication here listed here:
https://dev.twitter.com/docs/auth/obtaining-access-tokens

Related

Cannot get data using LinkedIn api

I am trying to get data using API provided by LinkedIn. I have got the API key, API secret, and the access key as well. After going through the documentation I got to know that now they perform authentication with OAuth 2.0. I am trying to access the following API :
https://api.linkedin.com/v2/me?oauth2_access_token= my access token
The response returns the follwing:
{"serviceErrorCode":100,"message":"Not enough permissions to access: GET /me","status":403}
I have also sought permission for the API.
Why is this happening?
Note: The "Default Application Permissions" of my app is set to "r_basicprofile".
Please wait for about 2 hours after registration to get the permissions. Sometimes it take time to register for access.
if i am correct, for the V2 you need a linkedin partnership : https://developer.linkedin.com/partner-programs
if you do not need the partnership program. use the v1 api.
https://api.linkedin.com/v1/people/~
this will work with your current permissions.

Twitter API 1.1 collections show 403/220

I can't access this particular Twitter API endpoint:
https://api.twitter.com/1.1/collections/show.json?id=576828964162965504
(with any ID I tried). The request returns an error with the message "Your credentials do not allow access to this resource" and code "220".
The App-only authentication Bearer Token I'm using for the request is exactly the same as for my requests to /search/tweets.json, /statuses/user_timeline/show.json, /statuses/show.json and /users/show.json, all of which work just fine. Also the collection is public, so App-only authentication should suffice, I'm thinking.
I'm somehow sure that I'm missing something here, but can't find it anywhere in the official API docs, nor on StackOverflow, nor on Google.
According to the Twitter API documentation, collections/show requires a user context - so app-only authentication will not work in this case.
Additionally, collection IDs are usually in the form "custom-756140390927872000" or similar. You can get the list of collection IDs from a user by hitting the collections/list?screen_name=handle query.

Where to find token on token based authentication

I was trying to find the token on a login page. I've already searched on page source but it'isnt here. I'd like to know the practices for passing an access token and then the way to find it
The best way for token authentication is to pass it along with the request headers.
Normally u can find the tokens in the cookies with the respective key name

Trying to Understand Google Calendar API Service Account Authorization

I am new to using Google API and I am struggling to understand how it works. I want to be able to access a calendar and add events to it. I don't want the user to login every time because it will be a universal calendar that holds invoice due dates so from what I understand I want to use a service account. I created a calendar api project and a service account. I set the calendar share permissions to the project email. I have an API key and a service account key. However, I get confused with understanding how it needs to be authenticated. Unfortunately I am using Filemaker so I don't have any helper libraries to help me. I basically just have a POST option.
The google api documentation states that the insert event call requires authorization:
"This request requires authorization with the following scope (read more about authentication and authorization)" https://www.googleapis.com/auth/calendar"
https://developers.google.com/google-apps/calendar/v3/reference/events/insert
So if I was just using basic POST requests how would I authorize this and which keys do I need? Do I need the API key and Service Account Key? Do i have to use a client key even if I want all users to access the same calendar?
If I need to clarify anything just let me know.
Thanks!
You will need to include a valid access_token in the HTTP headers of your POST request, e.g. Authorization: Bearer ya29.xxxxxxxxxxxxxxxxxx
In order to get a valid access_token, you will need to go through the OAuth2 Authorization process as described at https://developers.google.com/identity/protocols/OAuth2ServiceAccount#authorizingrequests
Note: Please click on "HTTP/REST" to see the details of doing that without using any specific client libraries.

How to make twitter api calls using access token

I have managed to get an access token from the twitter api. Now I want to use that token for my further data fetching things, so please help me here to get the details of my twitter account.
For example, lets say I wanted to get the user's data, so when I tested this in apigee console, I got my result.
But how to get the same result, using same api, by hitting on a browser using the access token
something like this
Please help
It's a little more complex than the URL you suggested, but you can use Twitter's OAuth tool to generate the OAuth signature you need to make requests to its Home Timeline API call.
You can find the OAuth tool here:
https://dev.twitter.com/docs/api/1.1/get/statuses/home_timeline#oauth-tool
it's not like that when making twitter api calls you need to send consumer key, consumer secret, your_access_token and your_access_token_secret together
Eg: oauth_consumer_key="KEY",oauth_signature_method="HMAC-SHA1",oauth_timestamp="TIMESTAMP",oauth_nonce="NONCE",oauth_version="1.0",oauth_token="YOUR_TOKEN",oauth_signature="SIGN"
Source: https://twittercommunity.com/t/getting-the-user-details-using-access-token/6325/3