How to get followers list from Twitter? - twitter

I am trying to call following Twitter's API to get a list of followers for a user.
http://api.twitter.com/1.1/followers/ids.json?cursor=-1&screen_name=username
And I am getting this error message in response.
{
code = 215;
message = "Bad Authentication data";
}
I can't seem to find the documentation related to this error code. Anyone has any idea about this error?

Your request lacks authentication data. I got that error when I simply clicked on http://api.twitter.com/1.1/followers/ids.json?cursor=-1&screen_name=username. This is not the way to access twitter API.
Create a Twitter app from https://apps.twitter.com/. Then, try using a Twitter API Library to access REST API. If you are comfortable with using ruby apps on command line interface check out https://github.com/sferik/t. Set it up and then try t followers [USER] for listing all followers of USER.

You will have to use OAuth. More info can be found on Twitter website. Here: https://dev.twitter.com/oauth

This error is coming because your Twitter developers account is not approved. Now-a-days you can't make app without getting your developers account approved from Twitter.
To make an app, you need to contact Twitter and apply for developers account. If you are lucky engough, you will get approval although this process may take months.
If you just need the data, go for third party services like followersanalysis[dot]com, birdsonganalytics[dot]com

Related

SendGrid User Authorization from iOS App

I am trying to add email contact to my SendGrid Account List, but am unable to authenticate from the iOS App. I have tried authentication from https://sendgrid.com/docs/API_Reference/Web_API_v3/How_To_Use_The_Web_API_v3/authentication.html but getting 404 NOT Found Error. To add contact to a list, I need to hit https://sendgrid.com/docs/API_Reference/Web_API_v3/Marketing_Campaigns/contactdb.html#Add-a-Single-Recipient-to-a-List-POST API referenced here, but its returning "Authentication Required".
Got it. Answer to my question is SendGrid API v3 Documentation i.e. https://sendgrid.com/docs/API_Reference/api_v3.html. Need to send the API key in request headers.

Instagram api not returning any followers although response code is 200

I am using instagram to recieve the list of people i follow and although api returns the status code 200 I recieve absolutely no data.I tried using postman client instead of my code and even from there no data is being returned I am hitting the following service.
https://api.instagram.com/v1/users/self/follows?access_token=token
one thing to be noted is my application is in sandbox mode and this same access token is working and fetching other information about the user including media shared by the user and its basic information etc and user follows and is followed by several users.
Please suggest the solution thanks in advance.
I may have answer to this question since I was facing the same issue on my WinRT project yesterday.
You may need the relationship scope instead of 'follower_list' scope.
I am assuming that you have provided the scope as 'follower_list' in the authorization URL and logged in as yourself or through your own Instagram account(the same account with which you have created your Instagram app). And now if you are hitting the above service it will return nothing in data since you are requesting if the user is following you or not(so obviously you are not following yourself)!! So if you try logging in with someone else's Instagram account and hit the above service with follower_list scope it will return your Instagram account in data if the logged in person is following you.
EDIT
The above service will return all the users that are following you AND present in your sandbox users list. (Or at least that is my conclusion on this)
For further clarification try https://apigee.com/console/instagram for hitting this service there they are using the relationship scope.

Submitting Instagram to iOS app

I'm new to the site and new to developing so I'm looking for some general advice here.
I'm looking to build and app which works along side Instagram. So this is what I want to be able to do to start with.
User opens app and can submit an already posted (and held on Instagram) photo to the app. The user at this point will need to be asked to log into their Instagram account. So for example they would select submit and it will open a window asking them to log into Instagram and then it will display all their available photos which they have posted.
User selects the post they wish to submit to the app.
Image displays on app in a gallery of submitted posts by all the other users for people to see.
Thats the basic premise. It's actually a lot more involved than that but I am learning and trying to keep it simple at the moment.
What I would like to know is. Is this possible, are there any guides which exist on how to do this.
What sort of process will I be looking at here. I've tried looking for posts on Instagram integration etc but I can't find anything similar to this.
Thanks in advance any help or pointers on where to even start will be helpful.
error instagramdemo
Stpes to integrate instagram:
1)https://www.instagram.com/developer/
You would have to create an application on the instagram developer portal, get a client ID for performing OAuth flow.
2)Ask your users to login to the instagram app and get the auth_token from instagram API.
3) Use the auth_token in all your requests basically.
4) Download code from here: https://www.sendspace.com/file/mnuqck
and replace your clientid in my code. you will get response in code.
These libraries should help you get started,
https://github.com/shyambhat/InstagramKit
https://github.com/crino/instagram-ios-sdk
You would have to create an application on the instagram developer
portal, get a client ID for performing OAuth flow.
Ask your users to login to the instagram app and get the auth_token
from instagram API.
Use the auth_token in all your requests basically.
The whole flow would have been implemented for you in the libraries I mentioned.
Say for example if you are using InstagramKit and after integrating/authorisation by the user getting images from the users feed would be as simple as below,
InstagramEngine *engine = [InstagramEngine sharedEngine];
[engine getSelfFeedWithSuccess:^(NSArray *media, InstagramPaginationInfo *paginationInfo) {
// media is an array of InstagramMedia objects
...
} failure:^(NSError *error, NSInteger statusCode) {
...
}];
Steps to get InstagramKit up an running,
Download the InstagramKit from github.
Make sure you have cocoapods installed on your mac, refer
https://cocoapods.org/ for help.
Open the InstagramKit-Example on terminal and run the following
command,
pod install
Wait for the pod to finish its magic.
Now you should have InstagramKit-Example.xcworkspace created in the InstagramKit-Example, open it and run.
I just did it now,

Twitter API issues.“Authentication needed”"Failed to validate oauth signature and token"

Friends,I got a question,and I have googled it,but I didn't find the answer.
I create an iOS twitter app,and apply for a twitter API.
I used my API key in my app,Xcode returns error.
Just like this: http://tinypic.com/r/262ksnk/8
("Failed to validate oauth signature and token")
and this picture is my twitter api status
(sorry,I do not have enough coin to upload a pic,so post my pic here. )
what is wrong with my twitter api,can anyone help me?
Thanks very much.
What is wrong?
Best regards.
This error message relates to a HTTP 401 response.
Please make sure you are properly signing your OAuth requests. This guide will help you with the common pitfalls: Troubleshooting OAuth 1.0A.
In particular, if you are using valid keys and properly signing your OAuth requests but still receiving 401 errors, please check your system time. Since the OAuth signature relies on the current time, it must be in sync with the one from Twitter servers (exposed in all Date response headers from the Twitter API).
The "performance issues" described on the Twitter API status page apply to Twitter as a whole, and have nothing to do with your application. If you are having issues interacting with the Twitter API, we cannot diagnose those from the information provided ("error 3").

Update thumbnail without asking for google login - Youtube API V3.0 - OAuth2.0 -

My goal is quite simple : Use php files that will log on my youtube account and upload custom thumbnails.
I already successfully used Youtube API V2 to upload videos with no problem,
but the V3 requires OAuth2.0, and I can't found a way to avoid my server keeps ask me "Please login from your google account"
I use the example from the official place, here :
And created my OAuth token (tried web application and service) but it keeps ask me to log in...
I only want the php files to log on alone, because I want to share them to some friends that will be able to change thumbnails without having a google acount or knowing my youtube/google password.
You can do so by getting a refresh token from OAuth2 Playground and setting it in your youtube object.
Here it explains a little more.
And a step by step video.
Thank you Ibrahim, it solved my problem :) !
Except you didn't mentionned that I had to use $client->refreshToken('Refresh Token'); and then start the conditional : if ($client->getAccessToken()) { [...] . Very important to the others one who could encounter the problem : You need to use google developper console https://cloud.google.com/console and specify in APIs & Ath > Credentials the exact adress of your PHP script, and set a product name and email address in Consent Screen.

Resources