Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"entire-payload" unmarshal array #615

Open
alesysadmin75 opened this issue Dec 18, 2022 · 1 comment
Open

"entire-payload" unmarshal array #615

alesysadmin75 opened this issue Dec 18, 2022 · 1 comment

Comments

@alesysadmin75
Copy link

alesysadmin75 commented Dec 18, 2022

Hello everyone,

After further investigation I changed my question.
I'm using "entire-payload" in my webhook.conf in order to save any incoming request from SendGrid.

[
        {
        "id": "sendgrid",
        "execute-command": "echo",
        "pass-arguments-to-command":
[
        {
        "source": "entire-headers"
        },
        {
        "source": "entire-payload"
        }
]
        }
]

But I receive 'error parsing JSON payload json: cannot unmarshal array into Go value of type map[string]interface {}' so the result is null.

What am I doing wrong?

Raw content which I should see is something like this:

[
  {
    "email": "[email protected]",
    "event": "delivered",
    "ip": "208.117.55.133",
    "response": "250 2.0.0 Ok: queued as 02E07303458",
    "sg_event_id": "ZGVsaXZlcmVdAtMTk0NzA4MTEtT1d0eFQ0dG9SWnFwX1EybGV1WXJTUS0w",
    "sg_message_id": "OWtxT4toRZqp_Q2leuYrSQ.filterdrecv-8569859b9-kd4gr-1-63A17998-5F.0",
    "smtp-id": "<OWtxT4toRZqp_Q2leuYrSQ@geopod-ismtpd-4-0>",
    "timestamp": 1671526816,
    "tls": 1
  }
]
@alesysadmin75 alesysadmin75 changed the title How to get entire webhook 'Raw Content' "entire-payload" directive does not work from SendGrid Dec 19, 2022
@alesysadmin75 alesysadmin75 changed the title "entire-payload" directive does not work from SendGrid "entire-payload" is null due to error parsing JSON Dec 20, 2022
@alesysadmin75 alesysadmin75 changed the title "entire-payload" is null due to error parsing JSON "entire-payload" unmarshal array Dec 20, 2022
@Peter2121
Copy link

I hit the same problem. The version of webhook installed is 2.8.1.
It seems that json payload decoding does not work in case of top-level json array (the common case for this ticket, #640 and my case).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants