Set Messenger Profile
Replaces the ice breakers and persistent menu of a Facebook Page's Messenger. A field you leave out keeps its current value.
PUT
Bearerheader
AuthorizationBearer <op_>Workspace API key, sent as Authorization: Bearer op_... Keys are created in the dashboard.
id*stringLength
1 <= lengthapplication/json- body
iceBreakers?array<>Up to 4 questions shown when a conversation starts.
Items
items <= 4persistentMenu?array<>Up to 3 menu items. web_url items need url, postback items need payload.
Items
items <= 3Updated Messenger profile
application/json- response
accountId*stringiceBreakers*array<>Questions shown when a conversation starts.
persistentMenu*array<>Menu items shown in every conversation.
Example Request
import { Configuration, AccountsApi } from "@onepostly/sdk";const accountsApi = new AccountsApi( new Configuration({ accessToken: process.env.ONEPOSTLY_API_KEY }));const response = await accountsApi.setMessengerProfile({ id: "acc_YOUR_FACEBOOK_ACCOUNT_ID", setMessengerProfileBody: { "iceBreakers": [ { "question": "What are your opening hours?", "payload": "HOURS" }, { "question": "Do you deliver?", "payload": "DELIVERY" } ], "persistentMenu": [ { "type": "web_url", "title": "Order online", "url": "https://example.com/order" } ] },});console.log(response);Example Response
{ "accountId": "acc_YOUR_FACEBOOK_ACCOUNT_ID", "iceBreakers": [ { "question": "What are your opening hours?", "payload": "HOURS" }, { "question": "Do you deliver?", "payload": "DELIVERY" } ], "persistentMenu": [ { "type": "web_url", "title": "Order online", "url": "https://example.com/order", "payload": null } ]}