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

How Do I: get a private_key in the Create Application v2 API in nodejs SDK? #955

Closed
s-lukashenka-micoworks opened this issue Sep 2, 2024 · 6 comments
Assignees
Labels
question Question about how to use the SDK waiting-for-reporter Waiting for response from the reporter

Comments

@s-lukashenka-micoworks
Copy link
Contributor

s-lukashenka-micoworks commented Sep 2, 2024

How do I

If I am getting it right, a call to Create Account v2 API is supposed to return a private key alongside the public one, but in nodejs SDK it returns only the public one. Please, make it return the private key as well as that is important for application creation automation.

API/Product

Applications

Code Sample

API documentation pointing to its existence in the API response: https://developer.vonage.com/en/api/application.v2#createApplication-responses

@manchuck
Copy link
Contributor

manchuck commented Sep 3, 2024

@s-lukashenka-micoworks The keys should be in the response after you call createApplication. The only thing the SDK is doing, is adding the camelCasing properties to the response. This means that you should have the private key under the keys response:

const newApplication = await vonage.applications.createApplication({
  name: 'my-awesome-app',
})

console.log(newApplication.keys.privateKey)
console.log(newApplication.keys.private_key);

LMK if you need any more assistance with this

@manchuck manchuck closed this as completed Sep 3, 2024
@s-lukashenka-micoworks
Copy link
Contributor Author

s-lukashenka-micoworks commented Sep 4, 2024

@manchuck I understand that the actual API returns that parameter, but the types in SDK do not have it: https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/applications/lib/types/Application.ts#L29.
Could it be added, please? I can make a PR for that if needed.

@s-lukashenka-micoworks
Copy link
Contributor Author

@manchuck I have tried making a PR for the changes needed: #956

@manchuck manchuck reopened this Sep 5, 2024
@manchuck
Copy link
Contributor

manchuck commented Sep 5, 2024

Ahh, I can see the issue if you're using TypeScript.

@manchuck
Copy link
Contributor

@s-lukashenka-micoworks are you still experiencing this issue?

@manchuck manchuck added the waiting-for-reporter Waiting for response from the reporter label Sep 23, 2024
@manchuck
Copy link
Contributor

Haven't heard back from @s-lukashenka-micoworks , If you are still having an issue, please re-open this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question about how to use the SDK waiting-for-reporter Waiting for response from the reporter
Projects
None yet
Development

No branches or pull requests

4 participants