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.

Ankur Bawiskar
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  ||  10x 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  ||  10x 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.