HULFT Square Technical Column [Connecting Edition]
I connected to Adobe Acrobat Sign.
HULFT Square Technical Column [Connecting Edition] List
I connected to Adobe Acrobat Sign.
Introduction
The trend towards paperless systems, which was brought about by the Electronic Bookkeeping Act of 2016, is still having a significant impact, and I believe many companies are using related services. In this article, I would like to explore the digital transformation of one of these services, Adobe's Acrobat Sign, using HULFT Square.
What is Acrobat Sign?
Acrobat Sign is an electronic contract service provided by Adobe.
By creating a user account, you can easily use the electronic contract function. Also, because Acrobat Sign is a service for those who send contract documents, the recipient of the contract does not need to have an Acrobat Sign account.
Furthermore, Acrobat Sign implements various processes via API, allowing it to be integrated with other systems and services using REST. For example, you can use an HTTP trigger to kick off a Hulft Square process, and then use the API to send contract documents from Acrobat Sign, as shown below.
Verification details
This time, we will use the bulk sending function of HULFT Square and Acrobat Sign to confirm that the following processes can be performed.
- Sending contracts to multiple recipients at once
- Bulk sending in Acrobat Sign refers to sending an agreement to multiple recipients at the same time.
When specifying multiple recipients when sending a general contract, it will behave like a workflow, with one contract being sent in the specified order.
Advance preparation
◎Acrobat Sign settings
To use the Acrobat Sign API, you need to create a gateway application.
- * If you do not have an Acrobat Sign user account, you will need to register for an account from the URL below.
- * The above method is for the trial version. Product version Product version separate activation procedures, but these are not covered in this article.
Once you have created your account, please log in.
Once you log in, the home screen will open. Click [Account] from the top menu, then click [Acrobat Sign API] → [API Applications] on the left menu.
Click the ⊕ in the upper right corner to create a new application. Enter a name for the application and specify the domain as [Customer].
Once completed, click the blue [View/Edit] button below and save the displayed client ID and client secret values in a notepad or similar. If you do not have a secret, create a new one.
Next, click the blue "Configure for OAuth Application" next to it to configure OAuth. Hulft Square's OAuth requires a callback, so enter the callback URL in the redirect URI as shown below to grant the application any permissions you want. (In this example, we'll be sending and retrieving contract documents, so check "agreement_read" and "agreement_write.")
Callback URL: https://app.square.hulft.com/v1/oauth2/callback
Finally, we will send the draft contract in the folder of Acrobat Sign's bulk sending function. Create a draft contract for testing purposes from [Management] > [Bulk Send].
This completes the settings on the Acrobat Sign side.
◎ HULFT Square settings
Once the setup on the Acrobat Sign side is complete, we will proceed to set up the connection between Acrobat Sign and HULFT Square.
First, set up the connection. Open [Resources] > [Connections], select the blue [Add New] button, and create it with the following settings:
- Connection Information
Type: REST > REST Connection
Name: acrobat_sign_api_base
URL: https://api.{region_shard}.adobesign.com/api/rest/v6/
- * The region_shard represents the region in the URL when you log in to Acrobat Sign. In Japan, this is [jp1]. It may also be na1 or other values depending on the location.
Create an auth connection in the same way. Select the same blue [Add New] and create it with the following settings.
- Connection information (for copying. Change the information in {} as needed)
Name: acrobat_sign_oauth
Client_id : {client_id}
Client_secret : {client_secret}
Auth URL: https://secure.{region_shard}.adobesign.com/public/oauth/v2
Token URL: https://api.{region_shard}.adobesign.com/oauth/v2/token
Scope: agreement_read, agreement_write, any other
Select [Issue Refresh Token], and when it says successful, select [Continue] to complete the creation.
Script Overview
The script we will create this time is as follows:
- Send contracts to multiple recipients at once via API
(The draft contract document obtained with get_megaSign is sent with put_megaSign_send.)
Scripting: Sending contracts to multiple recipients at once via API
Create a script in any project and define a script variable. Select [Create New Script Variable] from the top menu of the designer.
Specify the variable name as [document_id], the variable type as string, and leave the value empty.
Next, from the right menu, select [Network] > [REST] > [Get Execution] and drop it into the script field. Enter the settings in the settings screen that appears.
First, configure the required settings tab as follows:
- Connection information (for copying)
name : get_megaSign
Destination: acrobat_sign_api_base
Path: megaSigns (/ is not necessary)
Next, go to the Response Settings tab. Here you can configure how the response will be handled. Since you need to set a schema to handle the HTTP response body as data, first set [Data Output Destination] to [File]. Specify any location for [File Path]. For ease of organization, we recommend creating a folder for Acrobat Sign and placing the files in it.
ex) /Personal/data/acrobat_sign/getMegaSign.json
Finally, set the authentication in the Authentication Settings tab to [Use Auth connection], and from the additional connection destinations displayed, select [Acrobat Sign_auth] that you just created.
This completes the setup. Select [Finish].
Next, drag and drop [start] onto [get_megaSign]. This will create a flow. In the same way, create a flow from [get_megaSign] to [end], and click the following button in the top menu. This is the button to run the script.
If successful, a pop-up will open informing you that the script was successful. Once you have confirmed this, proceed to the next step.
Next, open the [get_megaSign] settings again. Change the response setting to [Data] as shown below, click the blue [Specify a JSON file to set the output schema], and search for and specify the JSON file you just created. Once you're done, click the Done button and close the tab.
Next, drag and drop [Network] > [REST] > [Execute PUT] into the script field. Set it as follows:
- Required settings
- Connection information (for copying)
name : put_megaSign_send
Destination: acrobat_sign_api_base
path : megaSigns/${document_id}/status
- You can assign a variable value with ${variable name}.
-
Request Settings
First, create the following json file in Hulft Square.-----state.json-----
{
"state": ""
}
----------Then, set the request settings as follows, click the blue [Specify a JSON file to set the output schema] and specify the json file (state.json) you created.
- Authentication Settings
Once you have completed the above steps, click Finish to close the Settings tab.
Next, create a [put_megaSign_sed] flow from [get_megaSign]. A popup will appear, so select [Draw Process Flow and Data Flow] and also check [Add Mapping].
A [mapping] will be created in the script field, so click here to open the settings. Then set it as follows:
Map the input source [root/megaSignList/element/id] to the script variable [document_id]. Also, drag and drop two [String] > [Single-line string constant] from the tool palette on the right into the basic mapping field and set them as follows.
Finally, map [object] to [root/type] and [IN_PROCESS] to [root/state] to complete the mapping. Switch the tab above the mapping field to return to the script field.
Creating and Running Scripts
Click the run button below from the top menu to run the test.
(If you select the insect button on the left, a log will be saved in the execution log.)
Once the script is complete, check Acrobat Sign's [Management] > [Bulk Send]. If all drafts in the Bulk Send box are marked as Sent, the script has been successfully completed.
Conclusion
What did you think?
By using HULFT Square, we were able to send contract documents in Acrobat Sign.
Although what was implemented this time was a simple connection check, various information and operations of Acrobat Sign can be obtained and operated using the API, such as user integration with other services, document sending processing, and destination control. We hope you will take this opportunity to try out integration with Acrobat Sign with HULFT Square.