Skip to content

Client

In order to create an instance of the Client, a page access token is needed.

from fbotics.client import Client

client = Client(page_access_token="PAGE_ACCESS_TOKEN")

send_button_template

send_button_template(recipient_id=None, user_ref=None, phone_number=None, text=None, quick_replies=None, buttons=None)

Sends a button template to the recipient.

Arguments

  • recipient_id: page specific id of the recipient
  • user_ref: optional. user_ref from the checkbox plugin
  • phone_number: Optional. Phone number of the recipient with the format +1(212)555-2368. Your bot must be approved for Customer Matching to send messages this way.
  • text: UTF-8-encoded text of up to 640 characters. Text will appear above the buttons.
  • quick_replies: An array of objects the describe the quick reply buttons to send. A maximum of 11 quick replies are supported.
  • buttons: Set of 1-3 buttons that appear as call-to-actions.

send_text

send_text(recipient_id=None, user_ref=None, phone_number=None, text=None)

Sends a text message to the recipient.

Arguments

  • recipient_id: page specific id of the recipient
  • user_ref: Optional. user_ref from the checkbox plugin
  • phone_number: Optional. Phone number of the recipient with the format +1(212)555-2368. Your bot must be approved for Customer Matching to send messages this way.
  • text: must be UTF-8 and has a 2000 character limit.

send_audio

send_audio(recipient_id=None, user_ref=None, phone_number=None, url=None, quick_replies=None)

Sends an audio to the recipient.

Arguments

  • recipient_id: page specific id of the recipient
  • user_ref: Optional. user_ref from the checkbox plugin
  • url: URL of the audio
  • quick_replies: An array of objects the describe the quick reply buttons to send. A maximum of 11 quick replies are supported.

send_image

send_image(recipient_id=None, user_ref=None, phone_number=None, url=None, quick_replies=None)

Sends an image to the recipient.

Arguments

  • recipient_id: page specific id of the recipient
  • user_ref: Optional. user_ref from the checkbox plugin
  • url: URL of the image
  • quick_replies: An array of objects the describe the quick reply buttons to send. A maximum of 11 quick replies are supported.

send_file

send_file(recipient_id=None, user_ref=None, phone_number=None, url=None, quick_replies=None)

Sends a file to the recipient.

Arguments

  • recipient_id: page specific id of the recipient
  • user_ref: Optional. user_ref from the checkbox plugin
  • url: URL of the file
  • quick_replies: An array of objects the describe the quick reply buttons to send. A maximum of 11 quick replies are supported.

send_generic_template

send_generic_template(recipient_id=None, user_ref=None, phone_number=None, elements=None, quick_replies=None)

Sends a generic template to the recipient.

Arguments

  • recipient_id: page specific id of the recipient
  • user_ref: optional. user_ref from the checkbox plugin
  • phone_number: Optional. Phone number of the recipient with the format +1(212)555-2368. Your bot must be approved for Customer Matching to send messages this way.
  • elements: An array of element objects that describe instances of the generic template to be sent. Specifying multiple elements will send a horizontally scrollable carousel of templates. A maximum of 10 elements is supported.
  • quick_replies: An array of objects the describe the quick reply buttons to send. A maximum of 11 quick replies are supported.

send_quick_replies

send_quick_replies(recipient_id=None, user_ref=None, phone_number=None, text=None, quick_replies=None)

Sends quick replies to the recipient.

Arguments

  • recipient_id: page specific id of the recipient
  • user_ref: Optional. user_ref from the checkbox plugin
  • phone_number: Optional. Phone number of the recipient with the format +1(212)555-2368. Your bot must be approved for Customer Matching to send messages this way.
  • text: must be UTF-8 and has a 2000 character limit.
  • quick_replies: An array of objects the describe the quick reply buttons to send. A maximum of 11 quick replies are supported.