cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Google Sheet API (GetJSON SSLHandshakeException)

dmittelstadt
7-Bedrock

Google Sheet API (GetJSON SSLHandshakeException)

Hi:

Looking for tips on how to configure Resources["ContentLoaderFunctions"].GetJSON(params) to retrieve data from google sheet API.

If I use a service like below, the service throws a "Wrapped javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target Cause: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target" error.

Service Javascript...

var params = { proxyScheme: undefined /* STRING */, headers: undefined /* JSON */,

                    ignoreSSLErrors: true /* BOOLEAN */,

                    useNTLM: undefined /* BOOLEAN */,workstation: undefined /* STRING */,useProxy: undefined /* BOOLEAN */,withCookies: undefined /* BOOLEAN */,proxyHost: undefined /* STRING */,

url: "https://sheets.googleapis.com/v4/spreadsheets/{sheet}/values/A1%3AZ999?key={key}" /* STRING */,

    timeout: undefined /* NUMBER */,proxyPort: undefined /* INTEGER */,password: undefined /* STRING */,domain: undefined /* STRING */,username: undefined /* STRING */

};

var result = Resources["ContentLoaderFunctions"].GetJSON(params);



Using a URL of form shown in params above in a unauthenticated web browser, the google API return JSON like the below.

JSON Example

    {  "range": "Sheet1!A1:Z997",

            "majorDimension": "ROWS",

            "values": [ [ "a", "b", "c"], ["1", "2", "3"]] }.

Any suggestions on resolving the handshake issue?

Thanks,

Dan

2 REPLIES 2

It appears that the snippet above works fine on a Thingworx 7 cloud server, but not my local Thingworx 8 server.

bwirz
4-Participant
(To:dmittelstadt)

I'm having the same problem on a TWX 8.1 Docker PostgreSQL installation running on Linux, trying to access another API using GetJSON.

Top Tags