cron.contact.bind

Binds a contact to a cron. Contacts can receive a notification when a cron is executed or when it produces an error.

Authentication & Action

This method needs authentication. It can be accessed by http and https.

Action type: HTTP POST.

Arguments

cron_id (see note 1)

The id of the cron.

cron_name (see note 1)

The name of the cron. Allowed values: string (255)

contact_id(see note 2)

The id of a contact.

contact_name (see note 2)

The name of a contact. Allowed values: string (128)

alert_type (optional)

There are 2 types of alerts. 'a' = send notification on every execution, 'e' = send notification only on error.  Allowed values: a = always / e = on error only. Default: e.

max_sms (optional)

Send 1 sms notification per # minutes. Will be ignored if contact is other then cellphone number. Allowed value: integer (representing minutes). Default: 0.

 

NOTE 1: For ease of use, it is possible to use both cron_id and cron_name as a key. If both are present, the cron_id is taken as the key.

 

NOTE 2: For ease of use, it is possible to use both contact_id and contact_name as a key. If both are present, the contact_id is taken as the key.

Example Request

http://api.webcron.org/cron.contact.bind
POST data:
cron_id=154375&contact_name=webmaster&alert_type=e&max_sms=60

Example Response

<rsp status="ok">
   <bind contact_id="539" cron_id="154375" />
</rsp>