iosinstagram

Delete comments on Instagram media through Instagram API


I'm developing an Instagram app. Everything was fine till I reached deleting comments from Instagram media. Here is my request URL:

https://api.instagram.com/v1/media/[media_id]/comments?access_token=[access_token]

and post body

--xXxBoUnDaRyxXx
Content-Disposition: form-data; name="comment_id"

309854812055300359
--xXxBoUnDaRyxXx
Content-Disposition: form-data; name="_method"

DELETE
--xXxBoUnDaRyxXx

I have tried to remove the _method=DELETE and set httpmethod to DELETE, but no luck. Server just returns empty data, no error, no meta information. Anybody tried and succeeded with this? Please, help.

EDIT
I have just discovered that server is returning response with code 405 - remote URL returned error 405 method not allowed.


Solution

  • Ok, I have solved the problem with the help of Will https://github.com/wfleming/WFInstagramAPI/issues/1#issuecomment-9779870. Actually, I had to send DELETE request to the URL like https://api.instagram.com/v1/media/{media-id}/comments/{comment-id}?access_token=foo:. Instagram docs have to be updated.