简体   繁体   中英

Facebook POST request failure

Im having trouble when i try to do a POST request of anything (greeting, persistent_menu, get_started) to facebook. The response is always :

{"error":{"message":"(#100) Requires one of the params: get_started,persistent_menu,target_audience,whitelisted_domains,greeting,account_linking_url,payment_settings,home_url","type":"OAuthException","code":100,"fbtrace_id":"AK39y2gSSOU"}}

here is my code:

PAGE_ACCESS_TOKEN = <MY_PAGE_ACCES_TOKEN>

url = 'https://graph.facebook.com/v2.6/me/messenger_profile?access_token=' + PAGE_ACCESS_TOKEN

data = {'greeting': '{"locale":"default", "text":"Hola {{user_first_name}}!"}'}

r = requests.post(url, data=json.dumps(data))

I really need to do this, can somebody help?

Thanks

try, the following and tell me if/what error comes back:

PAGE_ACCESS_TOKEN = <MY_PAGE_ACCES_TOKEN>

url = 'https://graph.facebook.com/v2.6/me/messenger_profile?access_token=' + PAGE_ACCESS_TOKEN


data = {'greeting': '[{"locale":"default", "text":"Hola {{user_first_name}}!"}]'}

r = requests.post(url, data=data)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM