Import following and followers details to my web application

javascript
api

#1

I am trying to import my followers and following users list to my contact storing web app.
So i am trying to get user details such as name,email, phone number,company information etc.

https://api.twitter.com/1.1/friends/list.json
https://dev.twitter.com/rest/reference/get/followers/list

But the above apis are only returning twitter app related information.

Is there any settings that have to be enabled by the user to avail these data?
Or can we get these information by any other methods??


#2

I’m not sure what you mean by that. If you call that endpoint, you should get back a JSON array with a list of followers. Is that not what you are seeing?

I have some “recipes” on my Github gist that may help you here.


#3

@andypiper Thanks for the reply.

    $http({
      method: 'GET',
      url: 'https://api.twitter.com/1.1/friends/list.json?screen_name=%40name',
      headers: {
        Authorization: 'bearer AAAAAAAAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
      }
    }).then(function (data) {
         console.log(data);
       });

this is my call.
But i am getting error on my browser as

XMLHttpRequest cannot load https://api.twitter.com/1.1/friends/list.json?screen_name=%name. Response for preflight has invalid HTTP status code 400.

Whats wrong with my code?
How can i make it run?


#4

You won’t be able to do this in a browser-based Javascript app due to CORS etc. You might want to look at a solution like CodebirdJS instead.


#5

@andypiper :Thank you very much.That was a life saver !


#6