API Reference#
- GraphAPI.send_raw_request(method, endpoint, **kwargs)#
Send a raw request to WhatsApp Cloud API.
Use this method if you want to send a request that is not yet supported by pywa.
Every request will automatically include the
AuthorizationandContent-Typeheaders. you can override them by passing them inkwargs(headers={…}).
- Parameters:
- Return type:
Example
>>> wa = WhatsApp(...) >>> wa.api.send_raw_request( .. method="POST", .. endpoint="/{phone_id}/messages", .. json={"to": "1234567890", "type": "text", "text": {"body": "Hello, World!"}} .. ) { 'messaging_product': 'whatsapp', 'contacts': [{'input': '1234567890', 'wa_id': '1234567890'}], 'messages': [{'id': 'wamid.XXXXXXXXXXXXXXXX=='}] }
- Returns:
The response from the WhatsApp Cloud API.
- Return type: