admin管理员组

文章数量:1296288

The API is documented as accepting a string for custom_args, but when provided with a string, it responds with an error suggesting it expects an object.

For example:

curl  -X POST -H 'Authorization: Bearer [redacted]' \
-H 'content-type: application/json' \
-d '{
  "personalizations": [ { "to": [ { "email": "[email protected]" } ] } ],
  "from": { "email": "[email protected]" },
  "content": [{ "type": "text/plain", "value": "sample payload" }],
  "subject": "test subj",
  "custom_args": "this is a string"
}'

Returns:

{"errors":[{"message":"Invalid type. Expected: object, given: string.","field":"custom_args","help":".html#message.custom_args"}]}%

Obviously it seems the documentation is broken. My question is: are there any constraints on the object that can be passed for this field?

本文标签: What values are supported by the customargs field in SendGrid39s apiv3mailsend API requestStack Overflow