- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2019 12:19 PM
I'm trying to use the Email API to send and email. I've fired up a Personal Developer Instance, added email_api_send role to the admin account, turned on email send/receive in email properties, and am sending the following...
curl "http://devxxxx.service-now.com/api/now/email" \
--request POST \
--header "Accept:application/json" \
--header "Content-Type:application/json" \
--data "{
\"to\": [
\"gareth <gjones@ca.ibm.com>\"
],
\"subject\": \"Hello There\",
\"text\": \"Test Message\",
\"html\": \"<b>Test Message</b>\",
\"table_name\": \"incident\",
\"table_record_id\": \"xxxxxx\",
\"headers\": {
\"X-Custom\": \"header\"
}
}" \
--user 'admin':'xxxxx'
Where - obv - the xxx are replaced with valid numbers.
Get nothing back. Get no emails created. (looked in the email log)
New to this stuff - what am I missing...
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2019 08:18 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2019 03:27 PM
I think endpoint need to be http://devxxxx.service-now.com/api/now/v1/email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2019 08:12 AM
Tried that - it didn't help

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2019 08:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2019 09:21 AM
Well - at least now I'm seeing an error message. Doesn't help alot - but now I have an error message to paste.
"error": {
"detail": "Can not deserialize instance of java.util.ArrayList out of VALUE_STRING token\n at [Source: com.glide.size_aware.SizeAwareServletInputStream@1c4a827; line: 1, column: 2] (through reference chain: com.glide.email.service.Email[\"to\"]) Check logs for error trace or enable glide.rest.debug property to verify REST request processing",
"message": "org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of java.util.ArrayList out of VALUE_STRING token\n at [Source: com.glide.size_aware.SizeAwareServletInputStream@1c4a827; line: 1, column: 2] (through reference chain: com.glide.email.service.Email[\"to\"])"
},
"status": "failure"
}