2 Replies Latest reply on Nov 25, 2015 5:51 AM by javier-pex

    transient document API response

    javier-pex Level 1

      Hi,

       

      Hope anyone might shed more light on this issue. When using the API v4 transientDocument operation I got a 200 Response (OK) but a weird response content, instead of a JSON response I got a text/html

       

      Any help would be more than welcome, many thanks

       

      URL

      https://api.na1.echosign.com:443/api/rest/v4/transientDocuments

       

      RESPONSE

      Metadata

      content-type : text/html

      status : 200

      x-request-id : 28c593a8-5999-4f08-99d0-e0bf10b4aac7

       

      Body

      eyJ0cmFuc2llbnREb2N1bWVudElkIjoiM0FBQUJMYmxxWmhESUluOGV6cHZtZ3NOWDh2TnRlM1JGdVdkNTUzQkhvYm xpTDBVNEFudmwyWjkxdmprcGNYeGVSRFdSMjFtSkluekNTa1poYzFKSjZpcUhGdVR1SndrbE4yYmhBQW9uc1hrMEVm ektrOGFBM01UeUJWOXV2cFZud3h1cS1NY0N6SldjVmk3dF9RbFlMQWFTWXVId005dUhpY3ZaWTcwWTM0aWwyZUg0N1 NzMVNjanAxY3RLelB6RjFhQnJoenA3MzJjY3dUMUxqZmFaS1p6MVQ1cW5uaHhPIn0=

       

       

      REQUEST

      Metadata

      cache-control : no-cache

      content-type : multipart/form-data; boundary=MultiPartFileBoundary150dde63685

      connection : keep-alive

      host : api.na1.echosign.com

      access-token : 3AAABLxxxxxx

      original-path : /rest/v4/transientDocuments

      content-length : 2793

      accept : text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2

      method : POST

      user-agent : Java/1.7.0_51

      requestUrl : rest/latest/transientDocuments

      pragma : no-cache

       

      Body

      boundary=MultiPartFileBoundary150dde63685

       

      Content-Disposition: form-data; name="File-Name"

      MyFileName

       

      boundary=MultiPartFileBoundary150dde63685

       

      Content-Disposition: form-data; name="Mime-Type"

      application/pdf

       

      boundary=MultiPartFileBoundary150dde63685

       

      Content-Disposition: form-data; name="File"; File-Name="MyFileName"

      Content-Type: application/pdf

      Content-Transfer-Encoding: binary

      JVBERi0xLjQKJeLjz9MKMyAwIG9iaj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KZW5kb2JqCjcgMC BvYmo8PC9UeXBlL1BhZ2VzL0NvdW50IDIvS2lkc1sxIDAgUiA5IDAgUl0+PgplbmRvYmoKMTAgMCBvYmo8PC9UeXBl L0NhdGFsb2cvUGFnZXMgNyAwIFI+PgplbmRvYmoKMTEgMCBvYmo8PC9Qcm9kdWNlcihpVGV4dCAyLjAuOCBcKGJ5IG xvd2FnaWUuY29tXCkpL01vZERhdGUoRDoyMDE1MTEwNjE3MDIxNlopL0NyZWF0aW9uRGF0ZShEOjIwMTUxMTA2MTcw MjE2Wik+PgplbmRvYmoKeHJlZgoxxxxxxxxOCAwMDAwMCBuIAowMDAwMDAxODYzIDAwMDAwIG4gCnRyYWlsZXIKPDw vUm9vdCAxMCAwIFIvSUQgWzw3Zjk1ZTA4ZGJmMzllMjg3Yzk4NDAzMTE2NTk1M2M1ND48NmRjZmRlMjkxMGY4MTRlN DVlMGU3M2M2MTc3MjFlNmU+XS9JbmZvIDExIDAgUi9TaXplIDEyPj4Kc3RhcnR4cmVmCjE5ODMKJSVFT0YK

       

      boundary=MultiPartFileBoundary150dde63685

       

      Regards

      Javier

        • 1. Re: transient document API response
          havermeyer Level 1

          Hi Javier,

           

          I think I was getting the same error. I contacted support and this is what they told me:

           

          Our Engineering Team believes they have found the resolution, I have received the below information:

           

          In our latest release 8.0, we started honoring the 'text/html' in the HTTP Accept header. This was done to enable some new integrations that expected a text/html response. The API requests from Snap Finance have the following in the Accept header:

          accept : text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2

           

          As such the service is honoring the priority of text/html and returning in the appropriate format. Could you please try replacing the header in the integration with the value:

          Accept : */*

           

          This will ensure that we can respond correctly to your API requests as well as the requests from other integrators.

           

          If you have any other questions or concerns, please let us know.

           

          I've modified my Java code to include the following:

          headers.put(RestApiUtils.HttpHeaderField.ACCEPT.toString(), "*/*");

          • 2. Re: transient document API response
            javier-pex Level 1

            Many thanks havermeyer, that was the solution!

             

            After playing around with the "accept" header parameter and in order to be more restrictive with the response:

             

                        // Set the Accept header

                        headers.put(RestApiUtils.HttpHeaderField.ACCEPT.toString(), MimeType.JSON.toString());

             

            That works too