in reply to Problem parsing json

The error message (which is not from perl, its from the server you're talking to) sounds like the server didn't like your 'from' field.

In your curl command, you wrote "from": {"address": "noreply@<DOMAIN>"}

but in your perl, you wrote from => 'noreply@email.com'

If curl works and the perl doesn't, I'd suggest sending the same structure as you did with curl.

Replies are listed 'Best First'.
Re^2: Problem parsing json
by frank1 (Monk) on Apr 11, 2023 at 11:13 UTC

    i have tried to combine the original curl and the constructed format to post via perl

    this is the original "from": {"address": "noreply@<DOMAIN>"}
    when constructed. from => 'noreply@email.com'

    the point should be how to write well constructed message to post

    because the curl message is not valid as shown

    "code":"GE_122","message":"Invalid value found","target":"from"}],"mes +sage":"Unprocessable Entity",
      If you go look at the API doc on https://www.zoho.com/zeptomail/help/api/email-sending.html (which was the first result from googling "zeptomail api") it says "From", "JSON Object", "Allowed value - A valid sender email address with "address" and "name" key-value pairs."

      So, try perl like:

      from => { address => "noreply@email.com", name => "No Reply" },