Skip to content

Instantly share code, notes, and snippets.

@rtekie
Created August 26, 2012 03:29
Show Gist options
  • Save rtekie/3473576 to your computer and use it in GitHub Desktop.
Save rtekie/3473576 to your computer and use it in GitHub Desktop.
Python example of using API to notify CronSentry upon a job completion
# Python example of using API to notify CronSentry upon a job completion
# For API documentation please go to http://www.cronsentry.com/help#api
import urllib
import requests
# set POST variables
url = 'http://api.cronsentry.com/api/v1/notifications'
parameters = {
'api_key' : 'YOUR_API_KEY',
'job_name' : urllib.quote_plus('Your job name'),
'status' : 1,
'message' : urllib.quote_plus('Please change me')
}
# do POST
response = requests.post(url, data = parameters)
# check response
print response.status_code
print response.text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment