Skip to content

Commit b6ac03b

Browse files
Add code samples and snippets for Workspace API (#121)
* add snippets and code samples * file structure reorg --------- Co-authored-by: Karissa Jacobsen <[email protected]>
1 parent 202d608 commit b6ac03b

16 files changed

+101
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#apx-snippet-start:deleteWorkspaceDocument
2+
Status=$(curl -s -w "%{http_code}\n" -i \
3+
--request DELETE "https://api-d.docusign.com/v1/accounts/${account_id}/workspaces/${workspace_id}/documents/${document_id}" \
4+
--header "Authorization: Bearer ${access_token}" \
5+
--output ${response})
6+
#apx-snippet-end:deleteWorkspaceDocument
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#apx-snippet-start:getWorkspaceDocument
2+
Status=$(curl -s -w "%{http_code}\n" -i \
3+
--request GET "https://api-d.docusign.com/v1/accounts/${account_id}/workspaces/${workspace_id}/documents/${document_id}" \
4+
--header "Authorization: Bearer ${access_token}" \
5+
--output ${response})
6+
#apx-snippet-end:getWorkspaceDocument
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#apx-snippet-start:getWorkspaceDocumentContents
2+
Status=$(curl -s -w "%{http_code}\n" -i \
3+
--request GET "https://api-d.docusign.com/v1/accounts/${account_id}/workspaces/${workspace_id}/documents/${document_id}/contents" \
4+
--header "Authorization: Bearer ${access_token}" \
5+
--output ${response})
6+
#apx-snippet-end:getWorkspaceDocumentContents
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#apx-snippet-start:getWorkspaceDocuments
2+
Status=$(curl -s -w "%{http_code}\n" -i \
3+
--request GET "https://api-d.docusign.com/v1/accounts/${account_id}/workspaces/${workspace_id}/documents" \
4+
--header "Authorization: Bearer ${access_token}" \
5+
--output ${response})
6+
#apx-snippet-end:getWorkspaceDocuments
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#apx-snippet-start:addWorkspaceUser
2+
printf \
3+
'{
4+
"email": "'"${email}"'",
5+
"first_name": "'"${first_name}"'",
6+
"last_name": "'"${last_name}"'",
7+
"role_id": "'"${role_id}"'"
8+
}' >> $request_data
9+
10+
Status=$(curl -s -w "%{http_code}\n" -i \
11+
--request POST "https://api-d.docusign.com/v1/accounts/${account_id}/workspaces/${workspace_id}/users" \
12+
--header "Authorization: Bearer ${access_token}" \
13+
--header 'Content-Type: application/json' \
14+
--data-binary @${request_data} \
15+
--output ${response})
16+
#apx-snippet-end:addWorkspaceUser
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#apx-snippet-start:getWorkspaceUsers
2+
Status=$(curl -s -w "%{http_code}\n" -i \
3+
--request GET "https://api-d.docusign.com/v1/accounts/${account_id}/workspaces/${workspace_id}/users" \
4+
--header "Authorization: Bearer ${access_token}" \
5+
--output ${response})
6+
#apx-snippet-end:getWorkspaceUsers
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#apx-snippet-start:restoreWorkspaceUserAccess
2+
Status=$(curl -s -w "%{http_code}\n" -i \
3+
--request POST "https://api-d.docusign.com/v1/accounts/${account_id}/workspaces/${workspace_id}/users/${user_id}/actions/restore-access" \
4+
--header "Authorization: Bearer ${access_token}" \
5+
--output ${response})
6+
#apx-snippet-end:restoreWorkspaceUserAccess
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#apx-snippet-start:revokeWorkspaceUserAccess
2+
Status=$(curl -s -w "%{http_code}\n" -i \
3+
--request POST "https://api-d.docusign.com/v1/accounts/${account_id}/workspaces/${workspace_id}/users/${user_id}/actions/revoke-access" \
4+
--header "Authorization: Bearer ${access_token}" \
5+
--output ${response})
6+
#apx-snippet-end:revokeWorkspaceUserAccess
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#apx-snippet-start:updateWorkspaceUser
2+
printf \
3+
'{
4+
"role_id": "'"${role_id}"'"
5+
}' >> $request_data
6+
7+
Status=$(curl -s -w "%{http_code}\n" -i \
8+
--request PUT "https://api-d.docusign.com/v1/accounts/${account_id}/workspaces/${workspace_id}/users/${user_id}" \
9+
--header "Authorization: Bearer ${access_token}" \
10+
--header 'Content-Type: application/json' \
11+
--data-binary @${request_data} \
12+
--output ${response})
13+
#apx-snippet-end:updateWorkspaceUser
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#apx-snippet-start:getWorkspace
2+
Status=$(curl -s -w "%{http_code}\n" -i \
3+
--request GET "https://api-d.docusign.com/v1/accounts/${account_id}/workspaces/${workspace_id}" \
4+
--header "Authorization: Bearer ${access_token}" \
5+
--output ${response})
6+
#apx-snippet-end:getWorkspace

0 commit comments

Comments
 (0)