Tools API returning Invalid Credentials provided as argument

New Here ,
Feb 16, 2021 Feb 16, 2021

Copy link to clipboard

Copied

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();

Views

16

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation