我正在尝试使用 API 将联系人添加到我的 sendgrid。
const addContactToList = async (email, listId) => {
try {
await axios.post(
`https://api.sendgrid.com/v3/marketing/contacts`,
{
list_ids: [listId],
contacts: [
{
email: email,
},
],
},
{
headers: {
Authorization: `Bearer ${SENDGRID_API_KEY}`,
'Content-Type': 'application/json',
},
}
)
console.log('Works')
} catch (error) {
console.log(error.message)
}
}
但我收到错误 405 作为回报。我已授予此特定 API 密钥完全权限。
为什么 API 会报 405 错误?