Created
August 26, 2012 03:30
-
-
Save rtekie/3473586 to your computer and use it in GitHub Desktop.
C# example of using API to notify CronSentry upon a job completion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // C# example of using API to notify CronSentry upon a job completion | |
| // For API documentation please go to http://www.cronsentry.com/help#api | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using RestSharp; | |
| class CronsentryNotifyApp | |
| { | |
| static void Main(string[] args) | |
| { | |
| // set POST variables | |
| var client = new RestClient("http://api.cronsentry.com/api/v1"); | |
| var request = new RestRequest("notifications", Method.POST); | |
| request.AddParameter("api_key", "YOUR_API_KEY"); | |
| request.AddParameter("job_name", "Your job name"); | |
| request.AddParameter("status", "1"); | |
| request.AddParameter("message", "Please change me"); | |
| // do POST | |
| IRestResponse response = client.Execute(request); | |
| // check response | |
| var content = response.Content; | |
| System.Console.WriteLine(content); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment