Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DocuSign and APEX -The request has an invalid header name.

sect55Oct 29 2020 — edited Oct 29 2020

I am developing an APEX application which will integrate DocuSign to use embed electronic signature.
I am testing access to DocuSign and receive the following error:
<h2>Bad Request - Invalid Header</h2>
<hr><p>HTTP Error 400. The request has an invalid header name.</p>
I followed the following blog:
Oracle APEX and DocuSign part 2 (0 Bytes)Here is the code I used:
DECLARE
l_clob clob;
l_email_address varchar2(100);
l_password varchar2(255);
l_integration_key varchar2(2000);
l_headers varchar2(2000);

BEGIN
l_email_address := 'myemailaddress@company.com';
l_password := 'mypassword';
l_integration_key := 'myintegrationkey';
l_headers := '{ "Username":"#yourdocusign@address#",
"Password":"#yourpassword#",
"IntegratorKey":"#yourIntegratorkey#" }';
--
-- Headers
-- Name Value
-- Content-Type application/x-www-form-urlencoded
-- X-DocuSign-Authentication {"Username":"your email address",
-- "Password":"your password",
-- "IntegratorKey:"your integrator key"}
--
l_headers := replace(l_headers,'#yourdocusign@address#',l_email_address);
l_headers := replace(l_headers,'#yourpassword#',l_password);
l_headers := replace(l_headers,'#yourIntegratorkey#',l_integration_key);
--dbms_output.put_line('l_headers=' || l_headers);
--
apex_web_service.g_request_headers(1).name := 'Content-Type';
apex_web_service.g_request_headers(1).value := 'application/x-www-form-urlencoded';
--
apex_web_service.g_request_headers(2).name := 'X-DocuSign-Authentication';
apex_web_service.g_request_headers(2).value:=l_headers;
--
-- Make the REST API REQUEST
-- URL = https://demo.docusign.net/restapi/v2/login_information
-- Method = GET
--
l_clob := apex_web_service.make_rest_request(
p_url => 'https://demo.docusign.net/restapi/v2/login_information',
p_http_method => 'GET'
);
-- Display the whole document returned.
dbms_output.put_line('l_clob=' || l_clob);
END;
/

Comments
Post Details
Added on Oct 29 2020
3 comments
854 views