2016-12-31 158 views
1

我試圖執行一個CURL命令來爲我正在構建的bot設置一個問候消息。從Facebook蒞臨指導:https://developers.facebook.com/docs/messenger-platform/thread-settings/greeting-textCURL命令不能在SSH中執行

例來自Facebook:

curl -X POST -H "Content-Type: application/json" -d '{ 
    "setting_type":"greeting", 
    "greeting":{ 
    "text":"Timeless apparel for the masses." 
    } 
}' "https://graph.facebook.com/v2.6/me/thread_settings?access_token=PAGE_ACCESS_TOKEN" 

我試圖運行從SSH命令提示符 - 我做出的唯一改變是使其成爲1號線,讓我可以一次執行它從命令行。

curl -X POST -H "Content-Type: application/json" -d '{"setting_type":"greeting", "greeting":{"text":"Hi {{user_first_name}}! I am a bot. Simply say 'Hi' to start.. yes, it's as simple as that!"}}' "https://graph.facebook.com/v2.6/me/thread_settings?access_token=EAAFXmrm6M8cBAHF2TwfWMnQfksHnZBtQQIHYWjIFpmTffkG" 

但是,當我嘗試執行上面的1班輪時,我從SSH中收到此錯誤消息。

-bash: !"}}': event not found 

我在這裏做錯了什麼?任何幫助表示讚賞。

回答

1

你有單引號'一個問題,你可以用\u0027替換它們:

curl -X POST -H "Content-Type: application/json" -d '{"setting_type":"greeting", "greeting":{"text":"Hi {{user_first_name}}! I am a bot. Simply say \u0027Hi\u0027 to start.. yes, it\u0027s as simple as that!"}}' "https://graph.facebook.com/v2.6/me/thread_settings?access_token=EAAFXmrm6M8cBAHF2TwfWMnQfksHnZBtQQIHYWjIFpmTffkG"