was unable to send the a object that is stringified to the google chat through webhook
below is the input
401 - “{\n "error": {\n "code": 401,\n "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.\”,\n "errors": [\n {\n "message": "Login Required.",\n "domain": "global",\n "reason": "required",\n "location": "Authorization",\n "locationType": "header"\n }\n ],\n "status": "UNAUTHENTICATED",\n "details": [\n {\n "@type": "type.googleapis.com/google.rpc.ErrorInfo",\n "reason": "CREDENTIALS_MISSING",\n "domain": "googleapis.com",\n "metadata": {\n "method": "ccc.hosted.frontend.directory.v1.DirectoryGroups.Get",\n "service": "admin.googleapis.com"\n }\n }\n ]\n }\n}\n"
my post method for this is
{
“text”:{{ 'name ’ + $json.name + ’ ’ + $json.error.toJsonString() }}
}
when i do this i am getting the below error
{
“errorMessage”: “JSON parameter need to be an valid JSON”,
“errorDetails”: {},
“n8nDetails”: {
“nodeName”: “HTTP Request11”,
“nodeType”: “n8n-nodes-base.httpRequest”,
“nodeVersion”: 4.2,
“itemIndex”: 0,
“time”: “23/10/2024, 23:26:39”,
“n8nVersion”: “1.62.1 (Self Hosted)”,
“binaryDataMode”: “default”,
“stackTrace”: [
“NodeOperationError: JSON parameter need to be an valid JSON”,
" at Object.execute (/home/harshavardhan.macchetti/zemoso/it-security/n8n-testing/packages/nodes-base/nodes/HttpRequest/V3/HttpRequestV3.node.ts:1520:14)“,
" at Workflow.runNode (/home/harshavardhan.macchetti/zemoso/it-security/n8n-testing/packages/workflow/src/Workflow.ts:1382:31)”,
" at /home/harshavardhan.macchetti/zemoso/it-security/n8n-testing/packages/core/src/WorkflowExecute.ts:1167:42",
" at /home/harshavardhan.macchetti/zemoso/it-security/n8n-testing/packages/core/src/WorkflowExecute.ts:1887:11"
]
}
}
i need to send the error as a message into my google chat using webhook suggest the best way to do it