Skip to main content
Participant
February 16, 2021
Question

Tools API returning Invalid Credentials provided as argument

  • February 16, 2021
  • 0 replies
  • 323 views

I am building a web app running on localhost as my development environment, but the Tools APi keeps returning "Exception encountered while executing operation Error: Invalid Credentials provided as argument."

 

The sample code runs just fine using the exact same credentials code.  This only occurs when running the Node.js Express server and attempting to access the Tools API.

 

Any help would be most appreciated.  Code is below.

 

        // Initial setup, create credentials instance.
        const credentials =  PDFToolsSdk.Credentials
            .serviceAccountCredentialsBuilder()
            .fromFile("pdftools-api-credentials.json")
            .build();
        console.log(credentials)
    
        // Create an ExecutionContext using credentials and create a new operation instance.
        const executionContext = PDFToolsSdk.ExecutionContext.create(credentials),
            createPdfOperation = PDFToolsSdk.CreatePDF.Operation.createNew();
    This topic has been closed for replies.