Legacy Dev Forum Posts

 View Only

Sign Up

Agentless email data action test error

  • 1.  Agentless email data action test error

    Posted 06-05-2025 18:26

    Korecherla_Sapna | 2023-05-12 16:54:31 UTC | #1

    I am setting up the data action for the agentless email.

    when I test it , I get "message": "The request could not be understood by the server due to malformed syntax.", "code": "bad.request",

    Not sure where to look for this. Any ideas?


    Korecherla_Sapna | 2023-05-12 16:59:11 UTC | #2

    { "fromAddressEmail": "test@dev.example.com", "toAddressName": "sapna", "rawRequest": "{\"fromAddressEmail\":\"test@dev.example.com\",\"fromAddressName\":\"test-dev\",\"toAddressEmail\":\"sap-kore@example.com\",\"toAddressName\":\"sapna\",\"replyToAddressEmail\":\"test@dev.example.com\",\"replyToAddressName\":\"tester\",\"subject\":\"test1\",\"htmlBody\":\"<html><head>test></head><body>testing1</body></html>\"}", "replyToAddressEmail": "test@dev.example.com", "htmlBody": "<html><head>test></head><body>testing1</body></html>", "subject": "test1", "fromAddressName": "test-dev", "integrationId": "cb98c908-091b-43af-865a-fc3f296deb7f", "toAddressEmail": "sap-kore@example.com", "orgId": "2779583b-7035-4801-ba13-e9177054763b", "replyToAddressName": "tester" }


    Eos_Rios | 2023-05-12 18:15:51 UTC | #3

    You put the opening brace of your raw request in quotes so it's illegal JSON.

    Is this what you meant to say?

    {
    	"fromAddressEmail": "test@dev.example.com",
    	"toAddressName": "sapna",
    	"rawRequest": 
    	{
    		"fromAddressEmail": "test@dev.example.com",
    		"fromAddressName": "test-dev",
    		"toAddressEmail": "sap-kore@example.com",
    		"toAddressName": "sapna",
    		"replyToAddressEmail": "test@dev.example.com",
    		"replyToAddressName": "tester",
    		"subject": "test1",
    		"htmlBody": "test>testing1"
    	},
    	"replyToAddressEmail": "test@dev.example.com",
    	"htmlBody": "test>testing1",
    	"subject": "test1",
    	"fromAddressName": "test-dev",
    	"integrationId": "cb98c908-091b-43af-865a-fc3f296deb7f",
    	"toAddressEmail": "sap-kore@example.com",
    	"orgId": "2779583b-7035-4801-ba13-e9177054763b",
    	"replyToAddressName": "tester"
    }

    Korecherla_Sapna | 2023-05-12 18:48:34 UTC | #4

    Oh! that's interesting. but that's coming from the first step of the display when I test my data action

    Operations

    1. Validate request body contains simple json (key-value pairs)

    I am not sure how it is forming that invalid JSON

    1. I have Action contracts for Input as

    { "type": "object", "properties": { "fromAddressEmail": { "type": "string" }, "fromAddressName": { "type": "string" }, "toAddressEmail": { "type": "string" }, "toAddressName": { "type": "string" }, "replyToAddressEmail": { "type": "string" }, "replyToAddressName": { "type": "string" }, "subject": { "type": "string" }, "htmlBody": { "type": "string" } }, "additionalProperties": true }

    1. Output contract as

    { "title": "ResponseObject", "type": "object", "properties": { "id": { "type": "string" }, "conversationId": { "type": "string" }, "senderType": { "type": "string" }, "fromAddress": { "type": "object", "properties": { "email": { "type": "string" }, "name": { "type": "string" } }, "additionalProperties": true }, "toAddresses": { "type": "array", "items": { "title": "Item 1", "type": "object", "properties": { "email": { "type": "string" }, "name": { "type": "string" } }, "additionalProperties": true } }, "replyToAddress": { "type": "object", "properties": { "email": { "type": "string" }, "name": { "type": "string" } }, "additionalProperties": true }, "subject": { "type": "string" }, "dateCreated": { "type": "string" } }, "additionalProperties": true }

    1. In config section, I have

    VERB: POST URL: /api/v2/conversations/emails/agentless

    1. request body template as

    { senderType: "Outbound", fromAddress: { email: "${input.fromAddressEmail}", name: "${input.fromAddressName}" }, toAddresses: [ { email: "${input.toAddressEmail}", name: "${input.toAddressName}" } ], replyToAddress: { email: "${input.replyToAddressEmail}", name: "${input.replyToAddressName}" }, subject: "${input.subject}", htmlBody: "${input.htmlBody}" }

    1. response body as

    { "translationMap": {}, "translationMapDefaults": {}, "successTemplate": "${rawResult}" }

    What could be messing up the JSON ? :frowning: :frowning:


    Korecherla_Sapna | 2023-05-12 18:52:55 UTC | #5

    the request body should have been { "senderType": "Outbound", "fromAddress": { "email": "${input.fromAddressEmail}", "name": "${input.fromAddressName}" }, "toAddresses": [ { "email": "${input.toAddressEmail}", "name": "${input.toAddressName}" } ], "replyToAddress": { "email": "${input.replyToAddressEmail}", "name": "${input.replyToAddressName}" }, "subject": "${input.subject}", "htmlBody": "${input.htmlBody}" }

    it worked now


    Korecherla_Sapna | 2023-05-12 20:03:31 UTC | #6

    This worked with sending one email id, How do it modify to send to multiple email ids?


    system | 2023-06-12 20:04:20 UTC | #7

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 19894