Skip to navigation

How to grant office access to a form group

View as Markdown
Docusign Rooms for Real Estate only

This topic demonstrates how to assign an office to a form group for your Docusign Rooms for Real Estate account. As a prerequisite, make sure that you have created a form group. Assigning an office to a form group associates that group with that office, granting the group access to the office. Granting office access to a form group will enable you to filter which form groups are available based on that office.

Run this code example from our Quickstart or launcher projects: Bash, C#, Java, Node.js, PHP, PowerShell, Python, or Ruby.

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/v2
Where <domain> is demo.rooms.docusign.com for the developer environment and rooms.docusign.com for production.
{FORM_GROUP_ID}A GUID value that identifies your form group. This value is created by Docusign when you create a form group.
Forms enabled on your Rooms accountThe user role needs the Manage form groups permission assigned. These permissions are only available to accounts with Forms enabled. To enable this feature, contact your Account Manager or Business Development representative.
{OFFICE_ID}An identifier for the office location that is responsible for the room itself. Retrieve this value with the Offices:GetOffices method.
Rooms enabled for your accountYou will need access enabled to use the Rooms API. See creating a Rooms developer account.

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.

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 an office ID

Next, make a GET request to your Rooms account by using the Offices:GetOffices method or supporting SDK method to get your office ID. Here’s how you make the call, but make sure to substitute your base path for {BASE_PATH} and your API account ID for {API_ACCOUNT_ID}. Select one of the returned office IDs to use in the next step.

printf \
'
{
"name": "Sample Room Form Group",
}' >$request_data

Step 4. Select a form group ID

To find the form group that you want to assign the office to, you need to make a GET request to obtain an available form group ID. The Rooms API will return a list of available form group IDs; select the one you want to continue through the example. Here’s how you make the call but make sure to substitute your API account ID for {API_ACCOUNT_ID}.

Status=$(curl -w '%{http_code}' --request POST ${base_path}/restapi/v2/accounts/${API_ACCOUNT_ID}/form_groups \
"${Headers[@]}" \
--data-binary @${request_data} \
--output ${response})

Step 5. Call the Rooms API

Now that you have constructed your API headers, make a POST request to the FormGroups:GrantOfficeAccessToFormGroup method to grant office access to your form group for your Rooms account. Here’s how you make the call, but make sure to substitute your base path for {BASE_PATH}, API account ID for {API_ACCOUNT_ID}, form group ID for {FORM_GROUP_ID}, and office ID for {OFFICE_ID}.

Note: This Rooms API call does not require a request body, but still needs to be sent as a POST request.

View the source code for this how-to on GitHub: Bash, C#, Java, Node, PHP, PowerShell, Python, or Ruby.

Status=$(
curl -w '%{http_code}' --request POST ${base_path}/restapi/v2/accounts/${API_ACCOUNT_ID}/form_groups/$FORM_GROUP_ID/grant_office_access/${OFFICE_ID} \
"${Headers[@]}" \
--data-binary @${request_data} \
--output ${response}
)

Expected response

You will receive a 204 Status code response with an empty response body.

Next steps