I am trying to use the Instagram API to keep track of an array of users (through their identifiers). I use the last endpoint described here: http://instagram.com/developer/endpoints/relationships/ . After sending the request, I get some data back (code: 200, incoming_status: "none", outgoing_status: "none").
Here is the code snippet (javascript with jQuery):
var access_parameters = {action:"follow"}; for (key in users) { if (users.hasOwnProperty(key)) { var username = key; var instagramUrl = "https://api.instagram.com/v1/users/"+users[key][0]+"/relationship?access_token=[ACCESS_TOKEN]"; //where users[key][0] is the id of the user intended to follow and [ACCESS_TOKEN] is my access token $.ajax({ type:"POST", async: false, dataType: 'jsonp', url: instagramUrl, contentType: 'text/plain; charset=UTF-8', data: access_parameters }).done(function ( data ) { if( console && console.log ) { console.log(data); //this is where the above data comes through } }); } }
I tried a few permutations by putting the access_token in the data array and in the url, also the same as action = "follow". It seems that the endpoint does not receive the action parameter and simply returns the status of the current relationship.
source share