When I try to post to a page I control I get this error:

Facebook SDK threw an error: FacebookApiException: Invalid parameter

I have set-up an app and have authenticated a user who the app should have promistion to post with. I am having no issues connecting to my account through Drupal. What should I do?

Comments

e0ipso’s picture

Category: Bug report » Support request
Status: Active » Postponed (maintainer needs more info)

Many people seem to be able to set up the module just fine. Can you provide more information about what is causing the error?

jamiemarchant’s picture

Well I'm trying to post to this test page with the name 'testPageJamieMarchant'. You can append this name to the end of the Facebook URL.

My web host is webhostinghub. I took the test site off-line, it was being hosted with my personal site and my was slowing down the server, sorry.

My PHP version is 5.4.45.

My app is currently set to private but I seem to have the correct settings for the app and for my user. My user is an admin of the app so I shouldn't need adinstial promision.

!!! NOTE: This post has been updated !!!

e0ipso’s picture

Did you try setting the app to public?

jamiemarchant’s picture

Makeing the app public does not help. It is now public, so you can take a loo at it but I'm not sure how this will help.

jamiemarchant’s picture

Do you have any ideas what's going on?

jamiemarchant’s picture

Status: Postponed (maintainer needs more info) » Active
Chris.H.’s picture

I'm experiencing the same problem and I've tested everything I can think of!

This is the Rule I'm using (it should post to the FB page when a blogpost is added): http://pastebin.com/2NSvKVXv

Any ideas on how tho fix this!?

almador’s picture

Same problem:
"Facebook SDK threw an error: FacebookApiException: Invalid parameter"

almador’s picture

My rule:

{ "rules_facebook_autopost_option" : {
    "LABEL" : "Facebook autopost option",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules", "fb_autopost_entity" ],
    "ON" : {
      "node_insert--article" : { "bundle" : "article" },
      "node_update--article" : { "bundle" : "article" }
    },
    "IF" : [
      { "entity_has_field" : { "entity" : [ "node" ], "field" : "field_post_to_facebook" } },
      { "data_is" : { "data" : [ "node:field-post-to-facebook" ], "value" : "1" } }
    ],
    "DO" : [
      { "entity_create" : {
          "USING" : {
            "type" : "facebook_publication",
            "param_type" : "post",
            "param_user" : [ "site:current-user" ]
          },
          "PROVIDE" : { "entity_created" : { "facebook_link" : "Facebook Link" } }
        }
      },
      { "publish_to_facebook" : {
          "USING" : { "publication" : [ "facebook-link" ], "pages" : "169875783140874" },
          "PROVIDE" : { "facebook_publication_id" : { "facebook_publication_id" : "Facebook publication returned ID" } }
        }
      }
    ]
  }
}
delacosta456’s picture

hi

i am facing the same problem to right now

e0ipso’s picture

@delacosta456 hopefully you can come back and post a solution for the next person when you figure it out.

delacosta456’s picture

hi e0ipso

Finally success and this is a little description of how i proceed (sorry if my english is bad):

-****** it looks like, as we, most of the time, are trying to setup things from http://localhost errors of types Facebook SDK threw an erro : ....( Invalid parameter, service unavilable ) occur because facebook api doesn't sometimes recognize "localhost" as a valid posting link (that is what i read somewhere ) , even if you added it to your Apps Domain/Website url and Oauth access whitelist in your Facebook Developper settings so if your local site was setup with base url like dev.example.com there is no problem but if it is like http://localhost or http://mysite you have to create an alias to make sure it's look's like complete url's pattern and make sure your are in Drupal through that alias so that connecting from "Autopost Settings page" will come go and connect to Facebook using your alias.

And also , be careful that those step are followed ..

-****** Really Making sure carefully that , in the Graph API Explorer console , at https://developers.facebook.com/tools/explorer/ you use the select box """Application:? Graph API Explorer""" to select the the App( Devlopper app) for/trough which you want to give post permission.

-****** Once the page is reload, use the select box near the long text field "Access Token:" to choose the Page (Facebook created App ..ex page, event,... ) on which you want to post. Access token will reload.

-****** Once access token is reloaded , AGAIN reuse this same select box to choose "request publish_pages" (because looks like by default when only manage access is allowed ) and if the "Save session" button at the bottom is activated click to save.

baikho’s picture

Hi there,

For what it's worth, when dumping the $result in base_facebook.php from the (deprecated) SDK library, we're given a more indicating error apart from the "Invalid parameter" message:

array (
  'error' => 
  array (
    'message' => 'Invalid parameter',
    'type' => 'OAuthException',
    'code' => 100,
    'error_subcode' => 1349125,
    'is_transient' => false,
    'error_user_title' => 'Missing Message Or Attachment',
    'error_user_msg' => 'Missing message or attachment.',
    'fbtrace_id' => 'E+kHoutbvjX',
  ),
)

After providing the required message through the rule actions, the "Invalid parameter" error was gone & the post was pushed correctly to facebook. This will probably vary between the facebook-publications types, but at least for a fb post a message is required.

mjdriver’s picture

HI Baik Ho,

Can you explain this a little bit more?
I'm still having this error message and dont know how to fix it.

I'm a student so i dont know everything about drupal.

Ty for your help

mvg jannes