The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Docusign Integration with Servicenow using REST API

harishdasari
Tera Guru

Hi,

Anyone integrated docusign with servicenow.

I am able to generate OAuth Token, can I know what are steps next steps to send the envelopes to the users and what is the procedure.

Thank you.

1 ACCEPTED SOLUTION

Hi Harish,



So here is my understanding and accordingly the approach:



1) User raises RITM and attaches an attachment i.e. pdf file and submits the request.


2) Approvals etc if any will trigger as per the workflow.


3) Now the pdf file has to be sent to whom for signing. Will there be a variable to hold the signing person i.e recipient for docusign.


a) If yes then you can trigger the docusign code from workflow script and pick that's user's email address and DocuSign will send an email to that user.


In the subject keep the RITM number so that when DocuSign sends completion email it will be present in subject line.


b) If no then you need to check to whom it has to be sent. Will that be a hardcoded value of email address


4) Have an inbound email action on the custom table with type as new.


5) Have workflow to copy the incoming signed document from custom table to the RITM table.



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

35 REPLIES 35

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Harish,



Here are the steps which you can follow:


1) Use the Oauth token and consume the api with post method, send the token in header. This you can find easily. example below.



KeyValue
AuthorizationBearer ${token you received in earlier step}
Content-Typeapplication/json


2) view here for the post body. this link should explain you how to send various parameters


DocuSign



Links:


Following links should be helpful:


Service-now integrate with   docusign


How to Create Docusign envelop using service Now rest Message


DocuSign web service integration


DocuSign REST API Guide



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Ankur,



Thanks for the response.



I am not sure what I have to give here in the HTTP request as shown in screenshot, can you please help me what I have to give here.



and where should I use Key & Value ?






find_real_file.png


Hi Harish,



Set one of the http header as static as follows:


Name - Content-Type


Value - application/json



the other header for the authorization you need to set as dynamic. so have it as follows and set the header through scripts


no need to create it under http header request since you will be setting it with script



var authorizationHeader = "Bearer " + accessToken; //accessToken already you have in step 1



try {


var r = new sn_ws.RESTMessageV2('DocuSign API', 'post');


r.setRequestHeader('Authorization', authorizationHeader);


// set other parameters



var response = r.execute();


var responseBody = response.getBody();


var httpStatus = response.getStatusCode();


}


catch(ex) {


var message = ex.getMessage();


}



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Ankur,



Thank you so much for your help.



I am almost getting it done.



I have few doubts please clarify me.



Where I have to set header for the authorization as dynamic ?, I mean where that script should be written.



Do I need write business rules as well ?



I got access token but i am not understanding where should I see that access token as it is not displaying anywhere here.



what is bearer ?



thanks once again.