Skip Menu |
 

This queue is for tickets about the Document-eSign-Docusign CPAN distribution.

Report information
The Basics
Id: 121296
Status: new
Priority: 0/
Queue: Document-eSign-Docusign

People
Owner: Nobody in particular
Requestors: jonleigh1960 [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: requestSignatureFromDocument giving "415 Unsupported Media Type" error
Date: Sat, 22 Apr 2017 17:43:20 +0200
To: <bug-Document-eSign-Docusign [...] rt.cpan.org>
From: "Jon Leigh" <jonleigh1960 [...] gmail.com>
Download (untitled) / with headers
text/plain 3.5k
Module version/distribution: I am running the very latest distribution, installed from CPAN today: Document::eSign::Docusign 0.06. Perl version: perl, v5.10.1 (*) built for x86_64-linux-thread-multi Operating System vendor and version (by running the command uname -a) : Linux 404494-web1.portology.com 2.6.32-431.29.2.el6.x86_64 #1 SMP Sun Jul 27 15:55:46 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux ERROR MESSAGE : The hashref returned, when converted to json, is as follows:- {"error":"415 Unsupported Media Type"} First of all, I know that the PDF document I am trying to send is FINE because I have sent it successfully using the API Explorer in the Docusign Sandbox. The following code gives the error (and note that if I try removing anything from the baseUrl then it gives an error!) : Notes: 1. Anything like <this> is a note e.g. obviously I've not shown my password 2. I've also amended the Integrator Key 3. hash_to_json is a callable subroutine I have written to display $response as json. ----------------- use Document::eSign::Docusign; my $html=''; my $ds = Document::eSign::Docusign->new( baseUrl => 'https://demo.docusign.net/restApi/v2/accounts/<7-digit A/C No>/envelopes', username => '<my_email_address>', password => '<my password>', integratorkey => 'b094xxxx-855f-1x11-a929-xxxxxxxxxxxx' ); &requestSignatureFromDocument; print "Content-type: text/html\n\n"; print '<html><body>'; print $html; print '</body></html>'; exit; ######################################### sub requestSignatureFromDocument { my $response = $ds->requestSignatureFromDocument ( { emailSubject => "You have a Document to sign ", emailBlurb => "Please sign my document", documents => [ { documentId => "1", name => "/var/www/path/to/my/doc/PARTICIP_62386082.pdf" } ], recipients => { signers => [ { email => "<signer email address>", name => "<signer name>", recipientId => "1", tabs => { signHereTabs => [ { xPosition => "100", yPosition => "100", documentId => "1", pageNumber => "1" } ] } } ] }, status => "sent" } ); $html='<p>Response JSON:<br><br>'.hash_to_json($response).'</p>'; } ----------------- I can't help noticing that the `sendRequest` sub-module does not include any conversion to base64 - which the API seems to demand - nor does it include the statement `Content-Transfer-Encoding: Base64` - see http://stackoverflow.com/questions/28839919/docusign-api-format-conversion-e rror I've been going round in circles on this all day. Jon Leigh
Download (untitled) / with headers
text/html 19.8k

Message body is not shown because it is too large.

Subject: RE: [rt.cpan.org #121296] AutoReply: requestSignatureFromDocument giving "415 Unsupported Media Type" error
Date: Mon, 24 Apr 2017 15:40:43 +0200
To: <bug-Document-eSign-Docusign [...] rt.cpan.org>
From: "Jon Leigh" <jonleigh1960 [...] gmail.com>
Download (untitled) / with headers
text/plain 4.6k
Fixed: The cause of the bug was actually a bug in an old version of LWP::UserAgent. Upgrading to the latest version of LWP fixes this bug. Show quoted text
-----Original Message----- From: Bugs in Document-eSign-Docusign via RT [mailto:bug-Document-eSign-Docusign@rt.cpan.org] Sent: 22 April 2017 17:44 To: jonleigh1960@gmail.com Subject: [rt.cpan.org #121296] AutoReply: requestSignatureFromDocument giving "415 Unsupported Media Type" error Greetings, This message has been automatically generated in response to the creation of a trouble ticket regarding: "requestSignatureFromDocument giving "415 Unsupported Media Type" error", a summary of which appears below. There is no need to reply to this message right now. Your ticket has been assigned an ID of [rt.cpan.org #121296]. Your ticket is accessible on the web at: https://rt.cpan.org/Ticket/Display.html?id=121296 Please include the string: [rt.cpan.org #121296] in the subject line of all future correspondence about this issue. To do so, you may reply to this message. Thank you, bug-Document-eSign-Docusign@rt.cpan.org ------------------------------------------------------------------------- Module version/distribution: I am running the very latest distribution, installed from CPAN today: Document::eSign::Docusign 0.06. Perl version: perl, v5.10.1 (*) built for x86_64-linux-thread-multi Operating System vendor and version (by running the command uname -a) : Linux 404494-web1.portology.com 2.6.32-431.29.2.el6.x86_64 #1 SMP Sun Jul 27 15:55:46 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux ERROR MESSAGE : The hashref returned, when converted to json, is as follows:- {"error":"415 Unsupported Media Type"} First of all, I know that the PDF document I am trying to send is FINE because I have sent it successfully using the API Explorer in the Docusign Sandbox. The following code gives the error (and note that if I try removing anything from the baseUrl then it gives an error!) : Notes: 1. Anything like <this> is a note e.g. obviously I've not shown my password 2. I've also amended the Integrator Key 3. hash_to_json is a callable subroutine I have written to display $response as json. ----------------- use Document::eSign::Docusign; my $html=''; my $ds = Document::eSign::Docusign->new( baseUrl => 'https://demo.docusign.net/restApi/v2/accounts/<7-digit A/C No>/envelopes', username => '<my_email_address>', password => '<my password>', integratorkey => 'b094xxxx-855f-1x11-a929-xxxxxxxxxxxx' ); &requestSignatureFromDocument; print "Content-type: text/html\n\n"; print '<html><body>'; print $html; print '</body></html>'; exit; ######################################### sub requestSignatureFromDocument { my $response = $ds->requestSignatureFromDocument ( { emailSubject => "You have a Document to sign ", emailBlurb => "Please sign my document", documents => [ { documentId => "1", name => "/var/www/path/to/my/doc/PARTICIP_62386082.pdf" } ], recipients => { signers => [ { email => "<signer email address>", name => "<signer name>", recipientId => "1", tabs => { signHereTabs => [ { xPosition => "100", yPosition => "100", documentId => "1", pageNumber => "1" } ] } } ] }, status => "sent" } ); $html='<p>Response JSON:<br><br>'.hash_to_json($response).'</p>'; } ----------------- I can't help noticing that the `sendRequest` sub-module does not include any conversion to base64 - which the API seems to demand - nor does it include the statement `Content-Transfer-Encoding: Base64` - see http://stackoverflow.com/questions/28839919/docusign-api-format-conversion-e rror I've been going round in circles on this all day. Jon Leigh


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.