const headers = {
"Content-Type": "application/json",
"api-Key": <api_key>
}
// // construct body
const data = {
...body,
}
// send request
try {
const res = await axios.post(""https://api.brevo.com/v3/smtp/email", data, { headers })
return res
} catch (err) {
console.log(err)
return err
}
I tried doing it using sib-api-v3-sdk as well, but everytime it gives the same error:
status: 401,
text: ‹ {« message »:« Key not found »,« code »:« unauthorized »}\n ›,
method: ‹ POST ›,
path: ‹ /v3/smtp/email ›
i verified and i am using the correct key.
What are the possible reasons for this ? Am i missing something?