โ12-08-2020 03:01 PM
DocuSignโs latest REST API version is 2.1 and also supports OAuth 2.0 authentication (replacing the legacy X-DocuSign-Authentication
header-based auth).
DocuSign also provides free (no credit card neccessary) developer accounts to try out their API.
First, sign up for a DocuSign developer account here: DocuSign Developer Account
Next, in the DocuSign Apps and Keys page inside the DocuSign Settings application, youโll see your account information, including API Username, API Account ID, and Accountโs Base URI.
Click on the blue โAdd App & Integration Keyโ button:
Provide an appropriate application name and click โAddโ:
On the next page, your Integration Key (also known as a โClient IDโ) will be displayed. Under the โAuthenticationโ section, ensure the โAuthorization Code Grantโ radio button is enabled for a โUser Applicationโ. Then click on โAdd Secret Keyโ:
IMPORTANT! Copy this secret key value immediately and paste it somewhere just for now - it will no longer be available to be used once you navigate away from this page.
Further down, under โAdditional settingsโ, click the โAdd URIโ button and paste in the following value: https://elastic.snaplogic.com/api/1/rest/admin/oauth2callback/rest
Finally, click the โSaveโ button and youโll return to the โApps and Keysโ section of the Developer admin console, where your application will now be visible.
Next, log into SnapLogicโs Designer web application, create a new pipeline and drag a REST GET Snap to the empty canvas. Switch to the โAccountโ tab and click the โAdd Accountโ button:
Now itโs time to use the values from the DocuSign developer/integration web console - in another tab, click on the application you created within DocuSign and enter the following information:
Since we are using the DocuSign Demo Environment, weโll be using the demo-specific
account-d.docusign.com
domain - the-d
suffix is reserved for demo use.
Click the โAuthorizeโ button towards the bottom to initiate the process to get an OAuth 2.0 access token.
Your web browser will send a request to the OAuth2 Endpoint URL (the Auth endpoint) - you may be asked to login and possibly to approve the application. After doing so, the request will redirect back to the SnapLogic platform (the redirect_uri
where a new token request to the โOAuth2 Tokenโ URL (the token endpoint) will automatically take place in the background and an access- and refresh tokens will be acquired.
If all goes well, the browser will navigate back to the SnapLogic Designer and your account will now have encrypted entries for the โAccess-โ and โRefresh tokenโ fields, plus a timestamp value for the โAccess token expirationโ settings field.
Click โApplyโ to save the account and we can now test that the access token we received is valid by making requests to the DocuSign eSignature REST API:
GET User Info
The first request will be to the User Info endpoint - https://account-d.docusign.com/oauth/userinfo
This endpoint will return environment data such as accountId
, userId
, and baseUrl
- these are required to make any eSignature API call:
For Each Account
Since the responseโs entity.accounts
is an array, we can use the JSON splitter to operate on the account data that we will leverage in subsequent API calls:
GET Account Info
Finally, we can now make a call to the DocuSign eSignature REST API.
After the Splitter add another REST GET Snap, configure it with the same account used previously, and leverage the ability to refer to the input data ($base_uri
, $account_id
) to build the request URL to the demo.docusign.net
API domain:
Validating and/or executing this Snap should result in a 200 OK response with a response body containing the metadata of the desired account, which can be further isolated with a Mapper mapping the $entity
field to $
:
And that should get your started. Consult the DocuSign REST API reference documentation to learn about other endpoints that can be used.
โ03-23-2021 01:08 PM
Is it possible to document something using JWT tokens when integrating with DocuSign?
โ05-05-2021 08:36 PM
@snowamigo yes! DocuSign + JWT is documented here: Tutorial: Using the DocuSign eSignature REST API with the REST Snap Pack and JWT Authentication
โ05-05-2021 08:25 PM
I am trying to set up REST OAuth2 Account set up in snaplogic,getting below message on click Authorize button.
{โresponse_mapโ: {โerror_listโ: [{โmessageโ: โAccess token value is emptyโ}]}, โhttp_status_codeโ: 500}
I am providing all mandatory information.
1- Client ID*
2-client secret
3- OAuth2 Endpoint*
4-OAuth2 Token =https://servername.mktorest.com/identity/oauth/token*
5-Grant Type= client_credentials
Will snaplogic binding all input parameter to this url (client id ,client secret etcโฆ)(https://servername.mktorest.com/identity/oauth/token ) or we need to bind in token endpoint config!
Any suggestion would be help full.
This is the post man url which one is working fine and giving new token (https://{{base_url}}.mktorest.com/identity/oauth/token?grant_type=client_credentials&client_id={{cli...)