Delete Post on Facebook Ruby Curl:Easy

509 views Asked by At

I am using curl easy library to make http delete requests to Facebook graph to delete a post. Code snippet is below:

url = "https://graph.facebook.com/#{id}?access_token=#{token}"
curl = Curl::Easy.new(url)
result = nil
retries = 2
while (!result || curl.response_code != 200) && retries >= 0
    result = curl.http_delete
    retries -= 1
end
return result

Facebook returns "not valid request" each time. I have verified access_token in facebook debugger. What am i missing here? Can someone please help?

1

There are 1 answers

2
DiegoSalazar On

You should add /post to your url as per the reference:

url = "https://graph.facebook.com/post/#{id}?access_token=#{token}"