Recherches récentes


Pas de recherche récente

How to resolve the invalid token error



Publication le 04 juin 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 commentaire

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

      0


      Se connecter pour laisser un commentaire.

      Vous ne trouvez pas ce que vous cherchez ?

      Nouvelle publication