Learn R Programming

uptimeRobot (version 1.0.0)

uptimerobot.contact.new: Add a new alert contact

Description

uptimerobot.contact.new creates a new alert contact with the given properties.

Usage

uptimerobot.contact.new(api.key, type, value, friendly.name)

Arguments

api.key
string with a valid key for connecting to Uptimerobot API.
type
string or numeric with the type of the contact. You can use both the value (string) or the index (numeric) here.
value
string with the value of the contact (ie. the email address).
friendly.name
string the friendly (screen) name of the contact.

Value

The function returns the ID of the newly created contact in case success. An error is thrown otherwise.

Details

The alert contacts are whom to be notified when the monitor goes up/down.

The index lookup keys and values are available on the Uptimerobot API page on https://uptimerobot.com/api

See Also

uptimerobot.contacts, uptimerobot.contact.delete

Examples

Run this code
## Not run: 
#  # Let's assume the api.key is available into the environment variable KEY
#  api.key <- Sys.getenv("KEY", "")
#  # Create a new contact and get the ID
#  contact.new <- uptimerobot.contact.new(api.key, type = "email", value = "foo@bar.com", "John Doe")
# 
#  # Get informations about this new contact
#  contact.detail <- uptimerobot.contacts(api.key, contacts = contact.new)
# ## End(Not run)

Run the code above in your browser using DataLab