javascript - make facebook page post -


I am not using javascript SDK because it is client-side whereas I am making server-side calls.

I want to post a page so that I can make an ad creative with it. I can call perfectly right in the Graph API Explorer tool, but I can not do with javascript with the same call (with the same long access token which continues to work in graph explorer). Here's my code:

  tok = & lt; Valid and ending user token & gt;; Var pg_tok = & lt; Legitimate and never ending page token & gt ;; Var act_id = & lt; Account_id & gt ;; Var pg_id = & lt; Page_ id & gt ;; Var call_to_action = 'INSTALL_MOBILE_APP'; Var fb_app_url = 'https://itunes.apple.com/us/app/id284882215'; Var Message = 'Test Creative, or Watch'; Var pic_url = 'https://s3.amazonaws.com/< path_to_my_image' gt; '; Var ROOT = 'https://graph.facebook.com/'; Var pagepost_endpoint = Root + pg_id + '/ feed'; Console.log (pagepost_endpoint); Var pagepost_params = {access_token: pg_tok, call_to_action: {type: call_to_action, value: {link: fb_app_url}}, Message: msg, picture: pic_url, published: false}; Console.log (pagepost_params); Var pagepost_race = HTTP.post (pagepost_endpoint, {params: pagepost_params}); Console.log (pagepost_res);  

I have played around a bunch of parameters vs. data, where on pagepost_param goes to http.post which is giving error (which is HTT Btw of Meteorite).

- Returns the error by entering everything into parametric : {"error": {"type": "exception", "message": "A call to action type No Parser was qualified. Please call Call Action API "," Code "View: 1373054," I_transient ": Incorrect}} .

- Returns the error by entering everything into data : {"Error": {"message": "(# 200) This API call is a valid app_id Required. " , "Type": "OAuthException", "code": 200}} .

- Everything in the parameter and data in access_token returns: {"error": { "Message": "Invalid parameter", "Type": "FacebookAPI Express", "Code": 100, "Error_sub code": 1349125}} .

If I change HTTP.post to http.get, and simply enter access_token in parameter there is another clue for everyone and there is no one in it There are no other parameters (in the ultimate or data ), the call is successful, and on this article I have a graph explorer (only those who have published) , though), then the access tokens and the closing point work, just post-ing instead of some disturbances and I am using V Isht flawed about the parameters.

Do you / photo / feed > Have tried to post? The error subcode is exactly what is mentioned here

Hope it helps


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -