- This topic has 3 replies, 2 voices, and was last updated June 22, 2020 by Dennis L.
Zerto Analytic API authentication bad request erro
The forum ‘Scripting and APIs’ is closed to new topics and replies.
Hi All,
I am trying to collect the status of all VPG from zerto analytics API in google spreadsheet using google script .
While running below code , getting error “Request failed for https://analytics.api.zerto.com returned code 400. Truncated server response: {“errorCode”:4,”errorMessage”:”Bad Request”}”
Code :
function vpgStat() {
var Username = ‘username’;
var Password = ‘password’;
var API_URL = ‘https://analytics.api.zerto.com/v2/auth/token’;
var options =
{
method: “POST”,
contentType: “application/json”,
headers:{
Authorization : “Basic” + Utilities.base64Encode(Username + ‘:’ + Password)
},
};
var response = UrlFetchApp.fetch(API_URL, options);
}
Can someone help meĀ to identify the error.
Thank you in advance.
Regards,
Sagar
Hi Justin P,
Thank you for the help. This issue has been resolved .
Regards,
Sagar
Awesome news! Let us know if you run into anything else.
Have a great day!
Justin
The forum ‘Scripting and APIs’ is closed to new topics and replies.