Discussions

Ask a Question
Back to All

Sorry, but you couldn't be authenticated with thos credentials

Hello. I always get the error "Sorry, but you couldn't be authenticated with thos credentials" when I try to execute any GET or POST request ( whether via the examples in the API docs or via a custom xmlHTTPrequest implementation). My username and my password is correctly entered, but the response is:

{
"message": "Unauthorized"
}

I'm trying to implement your API in a Javascript based add-on for an e-learning authoring tool.

Can you please help? Here is the example code from your side:

const options = {
method: 'GET',
headers: {
accept: 'application/json',
authorization: 'Basic XYZ'
}
};

fetch('https://api.d-id.com/tts/voices', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));