I'm trying to switch from feed.publishActionOfUser to feed.publishTemplatizedAction but I'm having a prob I just can't resolve.
Basically when I call feed.publishTemplatizedAction instead of getting the success XML response:
<?xml version="1.0" encoding="UTF-8"?>
<feed_publishTemplatizedAction_response xmlns="http://api.facebook.com/1.0/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd">
1
</feed_publishTemplatizedAction_response>
I'm getting this:
<?xml version="1.0" encoding="UTF-8"?>
<feed_publishTemplatizedAction_response xmlns="http://api.facebook.com/1.0/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd" list="true">
<feed_publishTemplatizedAction_response_elt>0</feed_publishTemplatizedAction_response_elt>
</feed_publishTemplatizedAction_response>
In the docs it say a 0 response is a permissions error, but doesn't say what this is or how to fix it (nor why there should be a permission prob on publishTemplatizedAction when there isn't on publishActionOfUser). Can someone help me out?
Thanks
Chris
Offline
did you test it in preview:
http://developers.facebook.com/tools.php?feed
Offline
Yes. No probs there. Have tried it with the most basic of params (even with none at all), and keeps coming back with the same response
Offline
In the feed preview, it just does what you expect -- render the params you've given it. From my app, it always returns a 0
Offline
Here's what I'm submitting, although I've tried simpler versions too (have obviously replace actual session key and uid for security)
{"session_key"=>"foo123", "v"=>"1.0", "api_key"=>"d441463016804412cbd2b80138855ce0", "method"=>"facebook.feed.publishTemplatizedAction", "title_template"=>"{actor} added news on <fb:pronoun uid='{owner}' possessive='true' /> {vehicle}", "sig"=>"37a8ef42715aa07435e8084ed49efc19", "call_id"=>"1195504097.45741", "title_data"=>"{'vehicle':'Volvo Amazon 130 (two-door)','owner':'123456'}"}
Offline
I thought it was 60 chars excluding tags. Either way, it doesn't help. Even "title_template"=>"{actor} says hello world" gives the same response
Offline
OK. My screw up. Hadn't read the API properly, and wasn't submitting actor_id with the params (as you can prob tell from the above, if you're more on the ball than I am). I assumed that actor was the user represented by the session_key.
Also, I was thrown by the permission error response -- NB if there's anyone from from FB reading this might be better to return error code 100 ("One of the parameters specified was missing or invalid"), and/or make it clear in the docs that actor_id is a required parameter.
Hope this helps some other similarly confused person in the future.
Cheers
Chris
Offline
ctagg wrote:
OK. My screw up. Hadn't read the API properly, and wasn't submitting actor_id with the params (as you can prob tell from the above, if you're more on the ball than I am). I assumed that actor was the user represented by the session_key.
lol
Offline
ctagg wrote:
OK. My screw up. Hadn't read the API properly, and wasn't submitting actor_id with the params (as you can prob tell from the above, if you're more on the ball than I am). I assumed that actor was the user represented by the session_key.
Also, I was thrown by the permission error response -- NB if there's anyone from from FB reading this might be better to return error code 100 ("One of the parameters specified was missing or invalid"), and/or make it clear in the docs that actor_id is a required parameter.
Hope this helps some other similarly confused person in the future.
Cheers
Chris
glad that u managed to solve it at last ![]()
Offline