When using google Apps Script, sometimes I create errors on external API's I'm using.
The response is:
Exception: Request failed for https://dev1.example.com returned code 400. Truncated server response: {"code":"rest_invalid_param","message":"Invalid parameter(s): line_items","data":{"status":400,"params":{"line_items":"line_items[0][subtotal] is n... (use muteHttpExceptions option to examine full response)
I understand how to set the muteHttpExceptions :
var options = {
'method': 'post',
'contentType': 'application/json',
'headers': headers,
'muteHttpExceptions': true,
'payload': JSON.stringify(data)
};
apiurl = "https://" + apidomain + "/wp-json/wc/v3/customers/"
but I don't understand where I should then be looking for the untruncated server response.
The documentation: https://developers.google.com/apps-script/reference/url-fetch/url-fetch-app is not something I'm finding very helpful
Am I looking on the API server endpoint logs?
Or somewhere in Appscript?
Maybe here?
var response = UrlFetchApp.fetch(apiurl, options);
Logger.log(response);
Or in my local web browser?
Or am I totally confused?
I'm new to SO and Apps Script, so please be gentle.