I’m trying to use the facebook graph api to update the message on a previous post. I have the original post id and a valid never ending user access token. I am getting a “success” message back, but the post message is NOT getting updated.
<CFHTTP METHOD="POST" URL="https://graph.facebook.com/v3.2/#qPost.PostID#?message=#URLEncodedFormat(Message)#&access_token=#AccessToken#" THROWONERROR="YES">
<cfhttpparam type="header" name="Accept-Encoding" value="*" />
<cfhttpparam type="header" name="TE" value="deflate;q=0" />
</CFHTTP>
Success Message:
I’m going off the facebook graph details here (i know it says publish_actions permission has been removed), but certainly there has to be a way to update a page post via the graph api.
https://developers.facebook.com/docs/graph-api/reference/v3.2/post#updating
Also when I say I’m trying to update the message, basically the text that is written in the post (see image)
2
Answers
I got this figured out, i was not using the full
postid
in my request. When the original post was created it sends back a post id, which is a combination of thepageid
and thepostid
(with an underscore in between), it looks like this below, with the first part being thepageid
and the one after the underscore being thepostid
, I was only putting the 2nd part as thepostid
:It's funny that i would still get a "success" even though I had an invalid
postid
.The documentation example states
So
message
is part of the POST body. But your code sends themessage
as part of the query string. Solution: Movemessage
andaccess_token
to the body.Encoding is done by
cfhttpparam
automatically, so keep the readable/desired text in themessage
variable.