You can programmatically update endpoint settings using it's JSON file, avoiding the need to manually intervene and modify the file as seen in the User Guide: Making changes to the endpoint connection information
When working with Google Big Query as the credentials themselves are in JSON format, an escape character is needed in order to avoid parsing errors. Hence the need to use "\" as an escape character before double quotes (so that it does not consider the double quote for parsing).
Similarly, there are newline characters "\n" that are part of the credentials which also need an additional escape character so that the credential is preserved intact without Parsing errors.
In the example below:
{
"type": "service_account",
"project_id": "project_id",
"private_key_id": "8556d6442eb7913c29af6b249e9f4b7267faa7",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDXIchHncmQd5eR
There should be added a slash as escape character "\" before the double quotes, resulting in:
{
\"type\": \"service_account\",
\"project_id\": \"project_id\",
\"private_key_id\": \"8556d6442eb7913c29af6b249e9f4b7267faa7\",
\"private_key\": \"-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDXIchHncmQd5eR
The information in this article is provided as-is and to be used at own discretion. Depending on tool(s) used, customization(s), and/or other factors ongoing support on the solution below may not be provided by Qlik Support.