Not getting the catalog list. Im writing code in node js my code is correct still getting undefined

listCatalog: function (companyKey, callback) {

     var appName = "squarepos"
     commonHelper.getCredentials(companyKey,appName, function (credErr, credentialsData) {
         if(credErr){
             responseMsg = commonHelper.commonMsg('failure', ' Failed to get credentials ', '', credErr);
             callback(null,responseMsg);
         }else{
           const client = new Client({
             environment: credentialsData.environment,
             accessToken: credentialsData.consumerSecret
           })
           console.log("client secret is ============>",client);
           try {
          
            const response =  client.catalogApi.listCatalog();

            console.log("response is ===========>",response.result);
          } catch (error) {
            if (error instanceof ApiError) {
              console.log(error.errors)
            } else {
              console.log("Unexpected Error: ",  error)
            }
          }



          }
        
        })
  
      },

Hi @sandeept, looking at your logs it looks like you are making successful calls to the Catalog API with the SDK. Were you able to get it to work?

1 Like