Skip to navigation

How to invite a notary to your pool

View as Markdown

This topic demonstrates how to invite a notary to your pool. Each Docusign organization is allowed to have only one pool.

Important: You will receive a 400 error if you invite a notary who is already pending or active in the sender’s Docusign account.

Run this code example from our Quickstart or launcher projects: Bash, PowerShell.

Required data

Running the code in this how-to requires this data:

Data elementDescription
{API_ACCOUNT_ID}A GUID value that identifies your account. This value is automatically generated by Docusign for any account you create. Copy the value from the API Account ID field on the Apps and Keys page.
{BASE_PATH}A string value that forms the root of the URL required to make API calls. The base path value in the example code is set to target the developer environment at
https://<domain>/restapi
Where <domain> is notary-d.docusign.net for the developer environment and na-notary.docusign.net for production.
{NOTARY_EMAIL}A string value for the email address where the notary will receive a notification.
{NOTARY_NAME}A string value for the full name of the notary.
{ORGANIZATION_ID}A GUID value that identifies the the organization that contains the account to which the user will be added. Copy the value from the Organization ID field in the Organization section of the Account Profile page.
{POOL_ID}A GUID value that identifies the notary pool within your organization.

Step 1. Obtain your OAuth token

To make the API calls shown in this how-to, you need a valid OAuth access token. Docusign supports access tokens for three different recommended OAuth grant types: Public Authorization Code Grant, Confidential Authorization Code Grant, and JSON Web Token (JWT) Grant. Choose the OAuth grant type appropriate for your scenario.

Docusign Notary OAuth access tokens are the same ones used for our eSignature REST API, although you must request four scopes to call the Docusign Notary API endpoints: notary_read, notary_write, organization_read, and signature.

See Authentication for guidance on your options to get an OAuth token.

Three icons that represent the three methods a user can use to obtain an OAuth token: JSON Web Token (JWT), Public Authorization Code Grant (ACG), and Confidential Authorization Code grant

Step 2. Construct your API headers

After you have a valid OAuth access token, you are ready to construct the API headers that you will pass to the API call. Construct your headers like this, but make sure to substitute your valid OAuth access token for {ACCESS_TOKEN}.

declare -a Headers=('--header' "Authorization: Bearer ${ACCESS_TOKEN}" \
'--header' "Accept: application/json" \
'--header' "Content-Type: application/json")

Step 3. Retrieve your notary pool ID

Now, create a GET request to the Pool:getPools endpoint to retrieve your pool ID. Here’s how you make the call, but make sure to substitute your organization ID for {ORGANIZATION_ID}.

Status=$(curl -w '%{http_code}' -i --request GET ${base_path}/v1.0/organizations/${ORGANIZATION_ID}/pools \
"${Headers[@]}" \
--output ${response})
POOL_ID=$(cat "$response" | sed -n 's/.*"poolId":"\([^"]*\)".*/\1/p')

Step 4. Construct the request body

Next, create the request body. Make sure to substitute the notary’s name for {NOTARY_NAME} and their email address for {NOTARY_EMAIL}.

printf \
'
{
"email" : "'"${NOTARY_EMAIL}"'",
"name" : "'"${NOTARY_NAME}"'",
}' >$request_data

Step 5. Call the Notary API

Now that you have constructed your API headers and request body, you can make a POST request to the PoolInvite:createPoolInvite endpoint to send the pool invitation to the notary you have specified. Here’s how you make the call, but make sure to substitute your organization ID for {ORGANIZATION_ID} and pool ID for {POOL_ID}.

View the source code for this how-to on GitHub: Bash, PowerShell.

Status=$(curl -w '%{http_code}' -i --request POST ${base_path}/v1.0/organizations/${ORGANIZATION_ID}/pools/${POOL_ID}/invites \
"${Headers[@]}" \
--data-binary @${request_data} \
--output ${response})

Expected response

If you run this code example from our Quickstart or launcher projects, you should see a JSON response similar to the code shown.

Sample response
{
"poolInviteId": "b18ac890-xxxx-xxxx-xxxx-ef9830699f62",
"createdByUserId": "dfb914c4-xxxx-xxxx-xxxx-2c91443f632e",
"createdDate": "2023-06-28T23:50:43.8688272Z",
"lastupdatedByUserId": "dfb914c4-xxxx-xxxx-xxxx-2c91443f632e",
"lastUpdatedDate": "2023-06-28T23:50:43.8688272Z",
"poolId": "f622a36a-xxxx-xxxx-xxxx-2c104f60e126",
"email": "example_notary@example.com",
"name": "Example Notary"
}

Next steps