0

I am new to call the document send Docusign REST API and using the document free docusign IDs, while calling the document send DocuSign REST API, getting BAD 400 request error and it's showing the error message "error-code": "UNSPECIFIED_ERROR" and "message": "Non-static method requires a target.

<script>
$(document).ready(function(){
$("#Submit").click(function(){
$.ajax({
method  : 'POST',
crossDomain : true,
headers: {
"X-DocuSign-Authentication":
"{\"Username\":\"username\",\"Password\":\"password\",\"IntegratorKey\":\"HEWL-dadabbac-6614-\"}"  },
body: 
{
  "emailBlurb": "DocuSign",
  "emailSubject": "DocuSign",
  "status": "Sent",
  "templateId": "738411FD-73BD-4CE8-9BE2-D944943FE3DE",
  "templateRoles": [
    {
      "roleName": "signer"
    }
  ]
},

success: function(result){
  var len = result.length;
 alert("Success");
},
 error: function(result){
    alert("Please Checkit Once..... !");
},
 error: function(result){
    alert("Please Checkit Once..... !");
},
});
Max Leske
  • 5,007
  • 6
  • 42
  • 54
kumar
  • 11
  • 1
  • 2
  • Not sure what's going on but the "Non-static method requires a target" error message seems to be coming from C# which suggests a problem on the receiving end (which I assume is DoguSign). Do you send that request to Docusign directly or do you somehow pass it through a C# application of yours? – Max Leske Sep 19 '14 at 07:42
  • Hi Max , Thanks for your replay, i am trying to send the document through Docusign portal, here i am using the jquery/java script functionality to call REST API... i am able to send the document successfully from docusing portal, if i try to call the same rest api( which one send the document to the respective users) by using jquery/javascript, its showing the error.. could you please check if any thing is require to pass to the API... – kumar Sep 19 '14 at 08:28
  • Can you please post the code you use in the case of the portal? And can you include a link to it so we can look at it? – Max Leske Sep 19 '14 at 12:51

1 Answers1

1

FYI - DocuSign does not support CORS (Cross Origin Resource Sharing), so you'll need to make backend API requests to access DocuSign's core platform. See this post including comments:

Unable to login in Docusign

Additionally, with regards to your specific 400 - Bad Request I believe it's because you are not specifying any recipient information. You are setting a template role but not assigning an actual recipient to it. Try altering your templateRoles structure so that it's something like this:

"templateRoles": [
    {
        "roleName": "signer",
        "email": "john@email.com",
        "Name": "John Dow",
    }
Ergin
  • 9,254
  • 1
  • 19
  • 28
  • Hi Argin, Thanks for your respons, i am able to get the login information successfully, envalope send API is only showing the 400 error .. remaining API'S are working fine... I made the some changes in my google chrome browser properties for your specified error... – kumar Sep 19 '14 at 17:10
  • Hi Kumar, I edited my post as I think I see the problem in your request. Please test and let me know... Thx. – Ergin Sep 26 '14 at 17:02