Philip Tenn
Philip Tenn

Reputation: 6073

DocuSign Java SDK: USER_LACKS_PERMISSIONS

I am developing against DocuSign's docusign-esign-java 2.8 SDK and am encountering an error attempting to create an Envelope using the EnvelopesApi.

Here's the specific error I am hitting:

com.docusign.esign.client.ApiException: Error while requesting server, received a non successful HTTP code 400 with response Body: '{
  "errorCode": "USER_LACKS_PERMISSIONS",
  "message": "This user lacks sufficient permissions to access this resource."
}'
        at com.docusign.esign.client.ApiClient.invokeAPI(ApiClient.java:1036) ~[docusign-esign-java-2.8.0.jar:na]
        at com.docusign.esign.api.EnvelopesApi.createEnvelope(EnvelopesApi.java:702) ~[docusign-esign-java-2.8.0.jar:na]
        at com.docusign.esign.api.EnvelopesApi.createEnvelope(EnvelopesApi.java:652) ~[docusign-esign-java-2.8.0.jar:na]

The client went through DocuSign OAuth Code Flow and granted our Application scope=signature+extended.

Does anyone have any ideas or suggestions on what I could look into?

I feel like this is somehow a DocuSign account configuration issue more than a code issue or an OAuth authorization issue, but I'm not sure where to look.

Upvotes: 0

Views: 163

Answers (1)

Inbar Gazit
Inbar Gazit

Reputation: 14015

This can happen because:

  1. There's a mismatch between the accountId in the URL that you are making API calls for (you pass accountId to the API call from the Java SDK) to the account that you used to authenticate (which may be different) when you implemented OAuth.
  2. There's a mismatch between developer and production env. Make sure you use the same env for both authentication and API Call.
  3. The user you authenticated with actually don't have permission to create envelopes. Some users cannot do that.
  4. Account has an option to only allow creation of envelopes from templates.

I would try a new developer account and make sure that you are using the correct account in both the authentication piece and the API calls.

Upvotes: 1

Related Questions