Sendgrid Errors

Anyone here have a deeper understanding of the API request that’s being formed to send to sendgrid API and why we might be getting this error back?

{“errors”:[{“message”:“The content value must be a string at least one character in length.”,“field”:“content.0.value”,“help”:“SendGrid v3 API reference | SendGrid Docs | Twilio”}]}

People are scheduling reports to run with the email action and some go, but some fail with that error. This is not APR, it’s just the base “email” action when submitting a report.

Any help or tips or breadcrumbs that lead to something are greatly appreciated!

1 Like

and yes I already found this from sendgrid help:

The error message you’re seeing:

{"errors":[{"message":"The content value must be a string at least one character in length.","field":"content.0.value","help":"http://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/errors.html#message.content.value"}]}

means that when you’re sending an email via the SendGrid API, the “content” field in your JSON payload is either empty or missing. The “value” for your content must be a non-empty string.

How to Fix

Check your API request body, especially the “content” array. It should look something like this:

"content": [
  {
    "type": "text/plain",
    "value": "This is the body of your email."
  }
]
  • Make sure "value" is present and contains at least one character (not just spaces).
  • If you’re dynamically generating the content, ensure your code is not passing an empty string or null.

Example of a valid payload:

{
  "personalizations": [
    {
      "to": [
        { "email": "recipient@example.com" }
      ]
    }
  ],
  "from": { "email": "sender@example.com" },
  "subject": "Test subject",
  "content": [
    {
      "type": "text/plain",
      "value": "This is a test email sent via SendGrid API."
    }
  ]
}

If you update your request to include a non-empty string for the content value, the error should be resolved.

If you need help reviewing your specific payload or code, feel free to share the relevant (non-sensitive) part, and I can help you troubleshoot further!

1 Like

@Mark_Wonsil or @spaceage or @kve using ice.MailLog, do I turn that on at the app server side and would that log the payload? Any downsides to turning this on? performance hits, etc?

Or?

I am trying to understand how the task is going from this (see screenshot below), to the payload that sendgrid is expecting:

Sorry, @utaylor, our IT uses a local SMTP server that forwards to 365. My SendGrid experience is with an “eCommerce” site and not Kinetic.

1 Like

Thanks Mark, we had that for a while too and I like that because you have control of it and logging and what not.

2 Likes

Sorry @utaylor , we’re cloud so it’s provisioned for us.

1 Like

Sorry, we setup ours when we went cloud.

1 Like

Thanks everyone, I believe that because the “body” was left blank I think the content property is blank.

3 Likes

Also cloud here. And either way, I mostly set up my own mailers using a function and a BPM Data Form, since that SSRS one doesn’t allow HTML and is difficult to pre-populate.

3 Likes

Thanks Kev

Thanks Chris

1 Like

Thanks Randy

1 Like

MailLog only logs the addresses, not Body. And you must be right, empty body should cause this, attachments are separate fields probably.

2 Likes

Thanks Olga, would be nice to log the API requests at some point if possible, I should send in an idea or something.

1 Like

well, complete request could be huge, and we don’t use it directly, we use SendGrid’s Nuget that hides the request itself.

1 Like

Thanks for the info Olga, I’ll see if they (sendgrid) can provide the payloads for us.

1 Like