Question

Webhook Custom Request Json Formatting

  • 19 May 2020
  • 1 reply
  • 1577 views

Hi,

i am trying to post data to ms teams using incoming webhook connector. the json payload is sent correctly but the json body part is being evaluated before sent to ms teams. here is the picture

 

here is the code

{
    "@type": "MessageCard",
    "@context": "http://schema.org",
    "Summary": "Test",
    "themeColor": "0076D7",
     "sections": [{
        "activityTitle": "![TestImage](https://47a92947.ngrok.io/Content/Images/default.png)Data Validation For Infosec",
        "activitySubtitle": "On Project ",
        "activityImage": "https://teamsnodesample.azurewebsites.net/static/img/image5.png",
        "facts": [{
            "name": "Assigned to",
            "value": "Sam"
        }, {
            "name": "Status",
            "value": "Not started"
        }],
        "markdown": true
    }],
    "potentialAction": [{
        "@type": "ActionCard",
        "name": "Add a comment",
         "id": "Comment",
        "inputs": [{
            "@type": "TextInput",
            "@id": "Comment",
            "id": "Comment",
            "isMultiline": false,
            "title": "Add a comment here for this task"
        }],
        "actions": [{
            "@type": "HttpPOST",
            "name": "Add comment",
            "target": "https://hooks.zapier.com/hook….",
            "bodyContentType": "application/json"
        }]
    }, {
        "@type": "ActionCard",
        "name": "Set due date",
        "inputs": [{
            "@type": "DateInput",
           "id": "dueDate",
            "title": "Enter a due date for this task"
        }],
        "actions": [{
            "@type": "HttpPOST",
            "name": "Save",
            "target": "https://hooks.zapier.com/…."
        }]
    }, {
        "@type": "ActionCard",
        "name": "Change status",
        "inputs": [{
            "@type": "MultichoiceInput",
            "id": "List",
            "name": "Save",
            "title": "Select a status",
            "isMultiSelect": "false",
            "choices": [{
                 "display": "In Progress",
                "Value": "1"
            }, {
                "display": "Active",
                "Value": "2"
            }, {
                "display": "Closed",
                "Value": "3"
            }]
        }],
         "actions": [{
            "@type": "HttpPOST",
            "name": "Save",
            "target": "https://webhook.site/326bbd02-f4a5-4308-964e-faed81b0c99d",
             "body": "{ \"List\": \"{}\" } }",
             "bodyContentType": "application/json"
        }]
    }]
}

 

 is there a way to stop this from happening?

 

here is what i receive in webhook

 

 


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

Userlevel 4
Badge +4

@Sam_123 Can you clarify:

  1. Is your first photo the output that a Zapier Webhook trigger is receiving, or
  2. The first photo is what a Zapier Webhook Action is sending out?