- 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-27-2019 09:33 AM
Never Mind - sent it as raw - as per the documentation - and it worked...now - to figure out what is different
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2019 09:44 AM
Thanks for the help with this!
Turns out - difference between https and http - working curl script...
curl "https://devxxxx.service-now.com/api/now/v1/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>\", \"headers\": { \"X-Custom\": \"header\" } }" \ --user 'admin':'admin'
with xxx replaced and password added.
thanks!