Pesquisas recentes


Sem pesquisas recentes

How to resolve the invalid token error



Publicado 04 de jun. de 2023

I'm trying to integrate the Zendesk API into my application. I keep getting the "invalid_token" error each time I request the visitors' API endpoint to save users' contacts.
How do I resolve this, please?

Here's a sample of my code:

const encodedToken = Buffer.from(
'myTokenHere'
).toString('base64');


const config = {
method: 'POST',
data: {
name: 'example name',
phone: '908256325365',
banned: false,
},
headers: {
'Content-Type': 'application/json',
Authorization: `Basic ${encodedToken}`,
},
};

axios(config)
.then(function (response) {
console.log('success', response.data);
})
.catch(function (error) {
console.log('error', error?.response?.data);
});

0

1

1 comentário

Hi Etiene! It looks like you got your answer in this post, but let us know if you need anything else.

0


Entrar para comentar.

Não encontrou o que estava procurando?

Nova publicação