Skip to content
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

ApiClient object missing #35

Open
code4ghana opened this issue Jan 4, 2021 · 2 comments
Open

ApiClient object missing #35

code4ghana opened this issue Jan 4, 2021 · 2 comments

Comments

@code4ghana
Copy link

Hello,

It appears the ApiClient object is missing from the definitions.

More Specifically because swagger doesn't contain the ApiClient object, I don't see any actual way of authenticating the requests via the API.

The documentation calls for

`
import * as docusign from 'docusign-esign';

const apiClient = new docusign.ApiClient(); // ApiClient doesn't exist
// use jwt authentication through apiClient object
`

I'm following the logic in your auto-generated Quickstart project for nodejs, the corresponding code location is on github.
Is there a new way to authenticate? If not could you help fix this? thanks!

@LarryKlugerDS
Copy link

Hi @code4ghana ,
The Swagger file includes the specification for the eSignature REST API itself. The ApiClient is how the SDKs keep track of the baseUrl and other information.

To obtain an access_token for the API, create a client_id (what DocuSign calls an integration key), and then use Authorization Code, Implicit, or JWT grant to get an access token.

Include the access token with each API call in an Authorization header.

See https://developers.docusign.com/platform/auth/choose/

@code4ghana
Copy link
Author

Hey @LarryKlugerDS

thanks for the response! The ApiClient class also has methods that help with the jwt flow for you, so it was useful being able to abstract the auth-dance to it. The demo code explicitly uses that object so I was just surprised when I could not find it, perhaps the demo could be updated to not use it since it's not meant to be be used.

Most of this was prompted by me wanting to use typescript so I :

  1. npm i docusign-esign
  2. npm i @types/docusign-esign
  3. Getting missing/undefined object errors (e.g. EnvelopeDefinition) and realizing that the two libraries are out of sync (I believe the types library is out of date).
  4. Decided to regen the newest types with Swagger, which lead to its own rabbit-hole.

My issue is solved, but I'll leave this bug open for you to decide whether any tasks should come out of it!

thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants