Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
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
It appears that the snippet above works fine on a Thingworx 7 cloud server, but not my local Thingworx 8 server.
I'm having the same problem on a TWX 8.1 Docker PostgreSQL installation running on Linux, trying to access another API using GetJSON.