How to create a workspace upload request
This topic demonstrates how to create a workspace upload request. Each workspace upload request represents a task in a workspace that is assigned to specific participants, such as asking a wealth management client to upload proof of income like a pay stub or tax document.
Run this code example from our Quickstart or launcher projects: Bash, C#, Java, Node.js, PowerShell.
Required data
Running the code in this how-to requires this data:
Step 1. Obtain your OAuth token
To make the API call 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.
Wondering which grant type suits your integration? See Authenticate for guidance on your options to get an OAuth token.
Workspaces OAuth access tokens are the same ones used for our eSignature REST API, although you must request the signature scope and one or more Workspaces scopes to call the Workspaces API.
See Workspaces authentication for details and the full list of Workspaces scopes.
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}.
Step 3. Construct the request body
Next, create the request body. An upload request requires a name, description, due date, and assignments. The following example shows a request body with all required fields. Make sure to substitute your due date for {DUE_DATE}, your email for {SIGNER_EMAIL}, and your workspace creator ID for {WORKSPACE_CREATOR_ID}.
Step 4. Call the Workspaces API
Now that you have constructed your API headers and request body, make a POST request to the Workspaces: createWorkspaceUploadRequest endpoint and include the request body to create the workspace. Here’s how you make the call, but make sure to substitute your API account ID for {account_id} and your workspace ID for {workspace_id}.
View the source code for this how-to on GitHub: Bash, C#, Java, Node.js, and PowerShell.
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.
Next steps
- Run this code example from our Quickstart or launcher projects: Bash, C#, Java, Node.js, PowerShell.
- See How to add a document to workspace.
- See How to send an envelope with recipient info.
- See how to Go-Live with a completed app.