Solved

Cc recipients limit at 21 when cerating draft with Front API

  • 4 April 2024
  • 3 replies
  • 26 views

When using the API to POST a new email draft, I receive the following error if the recipient list is longer than 21 addresses:

{
    "_error": {
        "status": 400,
        "title": "Bad request",
        "message": "Body did not satisfy requirements",
        "details": [
            "body.cc: should be an array"
        ]
    }
}

 

Does anyone know why this is the case?

Thank you.

icon

Best answer by jason 4 April 2024, 00:51

View original

3 replies

Userlevel 4
Badge +7

I believe this has come up in the past when sending using multipart/form-data encoding, and submitting the recipients as a numbered array;

--form 'cc[0]=email0@example.com' \
--form 'cc[1]=email1@example.com' \
--form 'cc[2]=email2@example.com' \
...

If you remove the number from the array, does that fix this issue? Or are you sending a JSON payload?

We are indeed using that encoding. So do you mean:

--form 'cc[]=email0@example.com' \
--form 'cc[]=email1@example.com' \
--form 'cc[]=email2@example.com' \
...
Userlevel 4
Badge +7

Yes - that should do the trick 🤞

I’ll ensure a bug report is raised with our engineers to get this addressed in the future

Reply