Skip to content

Add code samples and snippets for Workspace API #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions api-reference/workspace/addWorkspaceDocument.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#apx-snippet-start:addWorkspaceDocument
curl --request POST "https://api-d.docusign.com/v1/accounts/${accountId}/workspaces/${workspaceId}/documents" \
--header "Authorization: Bearer ${accessToken}" \
--header 'Content-Type: application/json' \
-F "file=@${filePath}" \
-F "name=${docName}"
#apx-snippet-end:addWorkspaceDocument
11 changes: 11 additions & 0 deletions api-reference/workspace/addWorkspaceUser.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#apx-snippet-start:addWorkspaceUser
curl --request POST "https://api-d.docusign.com/v1/accounts/${accountId}/workspaces/${workspaceId}/users" \
--header "Authorization: Bearer ${accessToken}" \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "'"${email}"'",
"first_name": "'"${firstName}"'",
"last_name": "'"${lastName}"'",
"role_id": "'"${roleId}"'"
}'
#apx-snippet-end:addWorkspaceUser
8 changes: 8 additions & 0 deletions api-reference/workspace/createWorkspace.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#apx-snippet-start:createWorkspace
curl --request POST "https://api-d.docusign.com/v1/accounts/${accountId}/workspaces" \
--header "Authorization: Bearer ${accessToken}" \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "'"${name}"'"
}'
#apx-snippet-end:createWorkspace
9 changes: 9 additions & 0 deletions api-reference/workspace/createWorkspaceEnvelope.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#apx-snippet-start:createWorkspaceEnvelope
curl --request POST "https://api-d.docusign.com/v1/accounts/${accountId}/workspaces/${workspaceId}/envelope" \
--header "Authorization: Bearer ${accessToken}" \
--header 'Content-Type: application/json' \
--data-raw '{
"envelope_name": "'"${envelopeName}"'",
"document_ids": ["'"${documentId}"'"]
}'
#apx-snippet-end:createWorkspaceEnvelope
4 changes: 4 additions & 0 deletions api-reference/workspace/deleteWorkspaceDocument.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#apx-snippet-start:deleteWorkspaceDocument
curl --request DELETE "https://api-d.docusign.com/v1/accounts/${accountId}/workspaces/${workspaceId}/documents/${documentId}" \
--header "Authorization: Bearer ${accessToken}"
#apx-snippet-end:deleteWorkspaceDocument
4 changes: 4 additions & 0 deletions api-reference/workspace/getWorkspace.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#apx-snippet-start:getWorkspace
curl --location "https://api-d.docusign.com/v1/accounts/${accountId}/workspaces/${workspaceId}" \
--header "Authorization: Bearer ${accessToken}"
#apx-snippet-end:getWorkspace
4 changes: 4 additions & 0 deletions api-reference/workspace/getWorkspaceAssignableRoles.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#apx-snippet-start:getWorkspaceAssignableRoles
curl --location "https://api-d.docusign.com/v1/accounts/${accountId}/workspaces/${workspaceId}/assignable-roles" \
--header "Authorization: Bearer ${accessToken}"
#apx-snippet-end:getWorkspaceAssignableRoles
4 changes: 4 additions & 0 deletions api-reference/workspace/getWorkspaceDocument.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#apx-snippet-start:getWorkspaceDocument
curl --location "https://api-d.docusign.com/v1/accounts/${accountId}/workspaces/${workspaceId}/documents/${documentId}" \
--header "Authorization: Bearer ${accessToken}"
#apx-snippet-end:getWorkspaceDocument
4 changes: 4 additions & 0 deletions api-reference/workspace/getWorkspaceDocumentContents.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#apx-snippet-start:getWorkspaceDocumentContents
curl --location "https://api-d.docusign.com/v1/accounts/${accountId}/workspaces/${workspaceId}/documents/${documentId}/contents" \
--header "Authorization: Bearer ${accessToken}"
#apx-snippet-end:getWorkspaceDocumentContents
4 changes: 4 additions & 0 deletions api-reference/workspace/getWorkspaceDocuments.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#apx-snippet-start:getWorkspaceDocuments
curl --location "https://api-d.docusign.com/v1/accounts/${accountId}/workspaces/${workspaceId}/documents" \
--header "Authorization: Bearer ${accessToken}"
#apx-snippet-end:getWorkspaceDocuments
4 changes: 4 additions & 0 deletions api-reference/workspace/getWorkspaceEnvelopes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#apx-snippet-start:getWorkspaceEnvelopes
curl --location "https://api-d.docusign.com/v1/accounts/${accountId}/workspaces/${workspaceId}/envelopes" \
--header "Authorization: Bearer ${accessToken}"
#apx-snippet-end:getWorkspaceEnvelopes
4 changes: 4 additions & 0 deletions api-reference/workspace/getWorkspaceUsers.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#apx-snippet-start:getWorkspaceUsers
curl --location "https://api-d.docusign.com/v1/accounts/${accountId}/workspaces/${workspaceId}/users" \
--header "Authorization: Bearer ${accessToken}"
#apx-snippet-end:getWorkspaceUsers
4 changes: 4 additions & 0 deletions api-reference/workspace/getWorkspaces.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#apx-snippet-start:getWorkspaces
curl --location "https://api-d.docusign.com/v1/accounts/${accountId}/workspaces" \
--header "Authorization: Bearer ${accessToken}"
#apx-snippet-end:getWorkspaces
4 changes: 4 additions & 0 deletions api-reference/workspace/restoreWorkspaceUserAccess.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#apx-snippet-start:restoreWorkspaceUserAccess
curl --request POST "https://api-d.docusign.com/v1/accounts/${accountId}/workspaces/${workspaceId}/users/${userId}/actions/restore-access" \
--header "Authorization: Bearer ${accessToken}"
#apx-snippet-end:restoreWorkspaceUserAccess
4 changes: 4 additions & 0 deletions api-reference/workspace/revokeWorkspaceUserAccess.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#apx-snippet-start:revokeWorkspaceUserAccess
curl --request POST "https://api-d.docusign.com/v1/accounts/${accountId}/workspaces/${workspaceId}/users/${userId}/actions/revoke-access" \
--header "Authorization: Bearer ${accessToken}"
#apx-snippet-end:revokeWorkspaceUserAccess
8 changes: 8 additions & 0 deletions api-reference/workspace/updateWorkspaceUser.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#apx-snippet-start:updateWorkspaceUser
curl --request PUT "https://api-d.docusign.com/v1/accounts/${accountId}/workspaces/${workspaceId}/users/${userId}" \
--header "Authorization: Bearer ${accessToken}" \
--header 'Content-Type: application/json' \
--data-raw '{
"role_id": "'"${roleId}"'"
}'
#apx-snippet-end:updateWorkspaceUser