AxiosError: unable to get local issuer certificate ERROR while using Platform API JS SDK

Hi, I am facing the following error when I am trying to use Platform API through Node.JS
AxiosError: unable to get local issuer certificate
at TLSSocket.onConnectSecure (node:_tls_wrap:1550:34)
at TLSSocket.emit (node:events:514:28)
at TLSSocket._finishInit (node:_tls_wrap:967:8)
at ssl.onhandshakedone (node:_tls_wrap:743:12) {
code: 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY',
config: {
transitional: {
silentJSONParsing: true,
forcedJSONParsing: true,
clarifyTimeoutError: false
},..

Following is the code which is giving me an error
// Obtain a reference to the platformClient object
const platformClient = require('purecloud-platform-client-v2');

const clientId = "my-client-id"
const clientSecret = "my-client-secret"

const client = platformClient.ApiClient.instance;

client.loginClientCredentialsGrant(clientId,clientSecret).then(()=> {
// Do authenticated things
console.log("Authenticated");
})
.catch((err) => {
// Handle failure response
console.log("fail");
console.log(err);
});

The API with the same client ID & client Secret is working when I am invoking it through Postman
Am I doing anything wrong, please help

This sounds like your local machine is having trouble managing its SSL certs; there is no specific configuration done for this under normal circumstances. This can be caused by invasive tooling your IT department may have installed on your machine to block DNS, intercept network traffic, or manage SSL certs. Working with your company's IT group to diagnose your machine's handling of SSL certs should be a good next step.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.