Error 45003 Wrong client ID given

Hello, please help me fix error. Why this request does not work. All worked yesterday.
This is my code, when I get code and api works i get error

const getGrand = async(token: string) => {
    console.log(token, 'tocken')
    try {
     const response = await fetch('https://api.us.nylas.com/v3/connect/token', {
       method: 'POST',
       headers: {
         'Content-Type': 'application/json',
         Authorization: `Basic ${NylasConfig.apiKey}`,
       },
       body: JSON.stringify({
         client_id: `${NylasConfig.clientIdNylas}`,
         client_secret: `${NylasConfig.apiKey}`,
         grant_type: 'authorization_code',
         code: token,
         redirect_uri:'http://localhost:8080/choosecalendar',
       }),
     });
 
     if (!response.ok) {
       throw new Error('Network response was not ok');
     }
 
     const dataConnectToken = await response.json();
     console.log(dataConnectToken, 'dataConnectToken')
 
    } catch (error) {  
    }  
   }

Hello @Kateryna most likely you’re own grant has expired. Go to your dashboard and check. I had situations were my own samples start failing due to the same reason…

@Blag Do I understand correctly, I need to check my Client ID or grand user?
I get the Client ID from my account, and this grand user does not exist. I send a token to the request and should receive a grand in response, and the user must appear in my account Nylas.

@Blag i have problem with my client id which i use for develop. When i try other account for production all works corectly.

@Kateryna What I mean is…

  • Go to your dashboard and check if your own grant is valid or not

If it’s expired, delete it and add it again…this should fix your issue…

2 Likes