Can I make a REST API call to check the count of pending envelopes for any particular user?
Below is my use case: In an organization any sender can send envelopes to different user. I have to find any user pending envelopes. Envelopes can be sent by any sender. How can I achieve this scenario ?
Actually, GET https://demo.docusign.net/restapi/v2.1/accounts/{{accountid}}/folders/ this call is returning me the folder id of my folder, but I want to check for other users' folders.
for example: I am the admin, and I have 5 users in the dousign, I have my account ID from which I can request folder ID by using (GET https://demo.docusign.net/restapi/v2.1/accounts/{{accountid}}/folders/) method. But if I want to know the folder id details of the remaining 5 users then how can I get that details as I won't be having their accountID's.
If I know the account Id of another user then can I make an API call ? I have tried to pass different user account Id in request but getting below error: URL: https://demo.docusign.net/restapi/v2.1/accounts/{account_Id}/folders
Error: { "errorCode": "USER_DOES_NOT_BELONG_TO_SPECIFIED_ACCOUNT", "message": "The specified User is not a member of the specified Account." }
Please let me know if anything is possible ? I am very much trying to resolve this issue.
You're asking a number of questions:
Access to other accounts
You can only access accounts that your user (via an access token) has access to. You can determine the accounts that your access token has access to by calling the oauth/userinfo API. Note: you must cache this information; don't call this API over and over again.
Added: You must make an API call per account. All DocuSign eSignature API calls are account-specific. Webhooks are the exception, webhook configurations in multiple accounts can all send to the same server URL.
Access to other users' envelopes
I don't have good info on this. I don't think you can do it directly. An admin can transfer an envelope to themself, but that'd be quite heavy handed!
Access to other users' envelope statuses
You can do this by setting up a Connect webhook. This way your application can receive a notification anytime an envelope is sent, a recipient views/signs an envelope, and when an envelope completes.
Your app can use this information to create a display of envelope statuses for all of your account users.
Added
The OP comments that he's using
/accounts/{accountId}/envelopes?from_date=2024-03-25&userid={userId}&include=recipients&status=sentbut it's only working for a specific accountId/userId.Answer: yes, that's as designed.