def subscribe_app(): subscription_endpoint = '/me/subscription' subscribe_uri = URIHandler(subscription_endpoint).configure() request = base.exec_request('POST', subscribe_uri) if request: return request else: raise HttpError('Unable to complete request.')
def validate_webhook(**kwargs): validation_endpoint = 'subscriptions_sample' validation_uri = URIHandler(validation_endpoint).configure( uri_format='appIDFirst', request_args=kwargs) request = base.exec_request('POST', validation_uri) if request: return request else: raise HttpError('Unable to complete request.')
def set_menu(self, menu_data): """ https://developers.facebook.com/docs/messenger-platform/messenger-profile/persistent-menu has a detailed documentation on the menu data and formats. :param menu_data: :return: """ request = base.exec_request('POST', self.graphAPIURL, data=menu_data) if request: return request
def get_text(self): request = base.exec_request('GET', self.graphAPIURLGET) if request: return request else: raise HttpError('Unable to complete request.')
def set_text(self, payload): request = base.exec_request('POST', self.graphAPIURL, data=payload) if request: print(request) else: raise HttpError('Unable to complete request.')
def delete_message(self): request = base.exec_request('DELETE', self.graphAPIURLGET) if request: return request else: raise HttpError('Unable to complete request.')
def delete_menu(self): request = base.exec_request('DELETE', self.graphAPIURLGET) if request: return request
def get_menu(self): request = base.exec_request('GET', self.graphAPIURLGET) if request: return request