Hi! I'm trying to send a template massage with Whatsapp Official API using PL/SQL in SQLDeveloper. The code runs without problem, but i dont receive the massage.
If i try to run with APEX I get "ORA-29273: HTTP request failed". Any Ideas of what im doing wrong? Thank You!
(I read that maybe could be something related to my wallet configs, but i'm not sure, perhaps is something wrong with the way im doing the API call.)
Code im using below:
DECLARE
v_url VARCHAR2(4000);
v_access_token VARCHAR2(4000);
v_json CLOB;
v_request_body CLOB;
v_response CLOB;
v_whatsapp_id VARCHAR2(4000);
v_message_id VARCHAR2(4000);
v_wallet_path varchar2(200) :='file:MY WALLET PATH';
v_wallet_pwd varchar2(200) :='MY WALLET PASSWORD';
BEGIN
v_request_body := '{"messaging_product": "whatsapp", "recipient_type": "individual", "to": "' || ‘MY PHONE NUMBER’ || '", "type": "template", "template": {"name": "novo_chamado", "language": {"code": "pt_BR"}, "components": [{"type": "body", "parameters": [{"type": "text", "text": "' || 'teste' || '"}, {"type": "text", "text": "' || 'teste' || '"}]}}';
v_access_token := 'my access token';
v_response := apex_web_service.make_rest_request(
p_url => 'https://graph.facebook.com/v19.0/MY ACCOUNT ID/messages',
p_http_method => 'POST',
p_wallet_path => v_wallet_path,
p_wallet_pwd => v_wallet_pwd,
p_parm_name => apex_util.string_to_table('Content-Type', 'Authorization'),
p_parm_value => apex_util.string_to_table('application/json', 'Bearer ' || v_access_token),
p_body => v_request_body
);
END;