Closed fstovarr closed 7 months ago
@fstovarr can you provide a code sample of how you are creating messages client?
@manchuck
const vonage = new Vonage(
new Auth({
apiKey: config.vonage.apiKey,
apiSecret: config.vonage.apiSecret,
})
)
const res = await vonage.messages.send(
new SMS({
to: to,
from: FROM,
text: text,
})
)
@fstovarr the messages API does not allow Basic auth. You will need to create an application and import the private key. If you only have an API Key/Secret, then you can use the legacy SMS api vonage.sms.send( ...)
If you have any more questions, feel free to reach out in our community Slack
https://github.com/Vonage/vonage-node-sdk/blob/65d4bcf525661f1f35161980d0ad6dd5fafcf81a/packages/messages/lib/messages.ts#L21 This line is not allowing to set the Basic auth type when using key/secret.
Therefore, the Authorization headers are not being set in the requests, and the API's answer is always being: