22 * Authorizes and makes a request to the Docusign API.
33 */
44function rundocusign ( ) {
5- var payload =
5+ var payload =
66 {
7- " emailSubject" : " EMAIL-SUBJECT" ,
8- " status" : " sent" ,
9- " emailBlurb" : " EMAIL-CONTENT" ,
10- " templateId" : " TEMPLATE-ID-TO-BE-USED" ,
11- " templateRoles" : [
7+ ' emailSubject' : ' EMAIL-SUBJECT' ,
8+ ' status' : ' sent' ,
9+ ' emailBlurb' : ' EMAIL-CONTENT' ,
10+ ' templateId' : ' TEMPLATE-ID-TO-BE-USED' ,
11+ ' templateRoles' : [
1212 {
13- " email" : " joebloggs@sample.com" ,
14- " name" : " Joe Blogger" ,
15- " roleName" : " role1"
13+ ' email' : ' joebloggs@sample.com' ,
14+ ' name' : ' Joe Blogger' ,
15+ ' roleName' : ' role1'
1616 }
1717 ]
1818} ;
@@ -27,14 +27,11 @@ function rundocusign() {
2727 method : 'post' ,
2828 contentType : 'application/json' ,
2929 grant_type : 'authorization_code' ,
30- payload : JSON . stringify ( payload )
31-
30+ payload : JSON . stringify ( payload )
3231 } ) ;
3332 var result = response . getContentText ( ) ;
3433 Logger . log ( result , null , 1 ) ;
35- } else {
36-
37-
34+ } else {
3835 var authorizationUrl = service . getAuthorizationUrl ( ) ;
3936 Logger . log ( 'Open the following URL and re-run the script: %s' ,
4037 authorizationUrl ) ;
@@ -52,7 +49,7 @@ function reset() {
5249 * Configures the service.
5350 */
5451function getService ( ) {
55- return OAuth2 . createService ( " Docusign" )
52+ return OAuth2 . createService ( ' Docusign' )
5653 // Set the endpoint URLs.
5754 . setAuthorizationBaseUrl ( 'https://account-d.docusign.com/oauth/auth' )
5855 . setTokenUrl ( 'https://account-d.docusign.com/oauth/token' )
@@ -67,10 +64,8 @@ function getService() {
6764
6865 // Set the property store where authorized tokens should be persisted.
6966 . setPropertyStore ( PropertiesService . getUserProperties ( ) )
70- . setScope ( 'openid' )
71-
67+ . setScope ( 'openid' ) ;
7268} ;
73-
7469/**
7570 * Handles the OAuth callback.
7671 */
0 commit comments