Example #1
0
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.')
Example #2
0
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.')
Example #3
0
 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
Example #4
0
 def get_text(self):
     request = base.exec_request('GET', self.graphAPIURLGET)
     if request:
         return request
     else:
         raise HttpError('Unable to complete request.')
Example #5
0
 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.')
Example #6
0
 def delete_message(self):
     request = base.exec_request('DELETE', self.graphAPIURLGET)
     if request:
         return request
     else:
         raise HttpError('Unable to complete request.')
Example #7
0
 def delete_menu(self):
     request = base.exec_request('DELETE', self.graphAPIURLGET)
     if request:
         return request
Example #8
0
 def get_menu(self):
     request = base.exec_request('GET', self.graphAPIURLGET)
     if request:
         return request