Ajax post cross domain request to instagram

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

I am trying to make request to delete comment via Instagram API. This is my code:

$.ajax({
    type: "POST",
    url: "https://api.instagram.com/v1/media/" + mediaId + "/comments/" + commentId + "?access_token=" + accessToken,
    data: { _method: "DELETE" },
    success: function(result){
        ...
    }
});

But I get this two errors:

    http://timetoplay.alexjcomp.lclients.ru http://timetoplay.alexjcomp.lclients.ru
     Status Code:400 BAD REQUEST
    

First is from console and second from network tab in chrome. As I understand my problem is that I can not make CORS Post request. With CORS GET request everything was just fine because I used dataType: "jsonp". How can I fix it in this case?

Answers

Check this link for how to delete an Instagram comment:

http://instagram.com/developer/endpoints/comments/#delete_media_comments http://instagram.com/developer/endpoints/comments/#delete_media_comments

And I didn t test this code but I would assume all you need is this:

$.ajax({
    type: "DELETE",
    url: "https://api.instagram.com/v1/media/" + mediaId + "/comments/" + commentId + "?access_token=" + accessToken,
    success: function(result){
        ...
    }
});

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/27766844/ajax-post-cross-domain-request-to-instagram

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils