NodePing.Contacts (NodePing Elixir v1.7.1) View Source

Manage contacts on your NodePing account and subaccount.

Link to this section Summary

Functions

Create a new contact for your account or subaccount. You can reference the fields by using the NodePing.Contacts.Contact struct

Create a new contact for your account or subaccount. You can reference the fields by using the NodePing.Contacts.Contact struct

Delete an existing contact from your account or subaccount.

Delete an existing contact from your account or subaccount.

Get all contacts on your NodePing account or subaccount

Get all contacts on your NodePing account or subaccount

Get a contact on your NodePing account or subaccount

Get contacts on your NodePing account or subaccount. Supply an optional id to get info for a single contact

Mute an entire contact for a specified duration in seconds. Note that the contact has to be the ID (or _id) of the contact.

Mute an entire contact for a specified duration in seconds. Note that the contact has to be the ID (or _id) of the contact.

Mute a contact method for a specified durtion in seconds. Note that the contact has to be the ID in the "addresses" portion of a contact.

Mute a contact method for a specified durtion in seconds. Note that the contact has to be the ID in the "addresses" portion of a contact.

Reset the password for a contact. The password will be emailed to the contact's email address.

Reset the password for a contact. The password will be emailed to the contact's email address.

Update an existing contact for your account or subaccount.

Update an existing contact for your account or subaccount.

Link to this section Functions

Link to this function

create_contact(token, args, customerid \\ nil)

View Source

Create a new contact for your account or subaccount. You can reference the fields by using the NodePing.Contacts.Contact struct

View the documentation to see the structure for creating contacts: https://nodeping.com/docs-api-contacts.html#post-put

Parameters

  • token - NodePing API token that was provided with account
  • args - Arguments for creating a NodePing contact
  • customerid - optional ID to access a subaccount
Link to this function

create_contact!(token, args, customerid \\ nil)

View Source

Create a new contact for your account or subaccount. You can reference the fields by using the NodePing.Contacts.Contact struct

View the documentation to see the structure for creating contacts: https://nodeping.com/docs-api-contacts.html#post-put

Parameters

  • token - NodePing API token that was provided with account
  • args - Arguments for creating a NodePing contact
  • customerid - optional ID to access a subaccount
Link to this function

delete_contact(token, id, customerid \\ nil)

View Source

Delete an existing contact from your account or subaccount.

Specify the ID of the contact to be deleted.

Parameters

  • token - NodePing API token that was provided with account
  • id - ID for contact that will be deleted
  • customerid - optional ID to access a subaccount
Link to this function

delete_contact!(token, id, customerid \\ nil)

View Source

Delete an existing contact from your account or subaccount.

Specify the ID of the contact to be deleted.

Parameters

  • token - NodePing API token that was provided with account
  • id - ID for contact that will be deleted
  • customerid - optional ID to access a subaccount
Link to this function

get_all(token, customerid \\ nil)

View Source

Get all contacts on your NodePing account or subaccount

Parameters

  • token - NodePing API token that was provided with account
  • customerid - optional ID to access a subaccount

Examples

iex> token = System.fetch_env!("TOKEN")
iex> {:ok, result} = NodePing.Contacts.get_all(token)
Link to this function

get_all!(token, customerid \\ nil)

View Source

Get all contacts on your NodePing account or subaccount

Parameters

  • token - NodePing API token that was provided with account
  • customerid - optional ID to access a subaccount

Examples

iex> token = System.fetch_env!("TOKEN")
iex> result = NodePing.Contacts.get_all!(token)
Link to this function

get_by_id(token, id, customerid \\ nil)

View Source

Get a contact on your NodePing account or subaccount

Parameters

  • token - NodePing API token that was provided with account
  • id - contact ID for getting a single contact
  • customerid - optional ID to access a subaccount

Examples

iex> token = System.fetch_env!("TOKEN")
iex> id = "201205050153W2Q4C-BKPGH"
iex> {:ok, result} = NodePing.Contacts.get_by_id(token, id)
Link to this function

get_by_id!(token, id, customerid \\ nil)

View Source

Get contacts on your NodePing account or subaccount. Supply an optional id to get info for a single contact

Parameters

  • token - NodePing API token that was provided with account
  • id - contact ID for getting a single contact
  • customerid - optional ID to access a subaccount

Examples

iex> token = System.fetch_env!("TOKEN")
iex> id = "201205050153W2Q4C-BKPGH"
iex> result = NodePing.Contacts.get_by_id!(token, id)
Link to this function

mute_contact(token, id, duration, customerid \\ nil)

View Source

Mute an entire contact for a specified duration in seconds. Note that the contact has to be the ID (or _id) of the contact.

NOTE: This makes a GET request to the API before doing a PUT

Parameters

  • token - NodePing API token that was provided with account
  • id - the ID for the contact you want to mute
  • duration - time to mute the contact method in seconds
  • customerid - optional ID to access a subaccount
Link to this function

mute_contact!(token, id, duration, customerid \\ nil)

View Source

Mute an entire contact for a specified duration in seconds. Note that the contact has to be the ID (or _id) of the contact.

NOTE: This makes a GET request to the API before doing a PUT

Parameters

  • token - NodePing API token that was provided with account
  • id - the ID for the contact you want to mute
  • duration - time to mute the contact method in seconds
  • customerid - optional ID to access a subaccount
Link to this function

mute_contact_method(token, id, duration, customerid \\ nil)

View Source

Mute a contact method for a specified durtion in seconds. Note that the contact has to be the ID in the "addresses" portion of a contact.

NOTE: This makes a GET request to the API before doing a PUT

Parameters

  • token - NodePing API token that was provided with account
  • id - the ID for the contact method you want to mute
  • duration - time to mute the contact method in seconds
  • customerid - optional ID to access a subaccount
Link to this function

mute_contact_method!(token, id, duration, customerid \\ nil)

View Source

Mute a contact method for a specified durtion in seconds. Note that the contact has to be the ID in the "addresses" portion of a contact.

NOTE: This makes a GET request to the API before doing a PUT

Parameters

  • token - NodePing API token that was provided with account
  • id - the ID for the contact method you want to mute
  • duration - time to mute the contact method in seconds
  • customerid - optional ID to access a subaccount
Link to this function

reset_password(token, id, customerid \\ nil)

View Source

Reset the password for a contact. The password will be emailed to the contact's email address.

Link to this function

reset_password!(token, id, customerid \\ nil)

View Source

Reset the password for a contact. The password will be emailed to the contact's email address.

Link to this function

update_contact(token, id, args, customerid \\ nil)

View Source

Update an existing contact for your account or subaccount.

NOTE When updating a contact's addresses, you must provide the current list of addresses. Any missing addresses will be removed.

You can reference the fields by using the NodePing.Contacts.Contact struct

View the documentation to see the structure for creating contacts: https://nodeping.com/docs-api-contacts.html#post-put

Parameters

  • token - NodePing API token that was provided with account
  • id - The contact id
  • args - Arguments for creating a NodePing contact
  • customerid - optional ID to access a subaccount

Examples

iex> updated_contact =
     %{
       "A775GC26" => %{
         address: "me@example.com",
         supressup: true,
         type: "email"
       }
     }
iex> {:ok, updated} = NodePing.Contacts.update_contact(token, id, %{addresses: updated_contact})
Link to this function

update_contact!(token, id, args, customerid \\ nil)

View Source

Update an existing contact for your account or subaccount.

NOTE When updating a contact's addresses, you must provide the current list of addresses. Any missing addresses will be removed.

You can reference the fields by using the NodePing.Contacts.Contact struct

View the documentation to see the structure for creating contacts: https://nodeping.com/docs-api-contacts.html#post-put

Parameters

  • token - NodePing API token that was provided with account
  • id - The contact id
  • args - Arguments for creating a NodePing contact
  • customerid - optional ID to access a subaccount

Examples

iex> existing_contacts =
     %{
       "A775GC26" => %{
         address: "me@example.com",
         supressup: true,
         type: "email"
       }
     }
iex> updated = NodePing.Contacts.update_contact!(token, id, %{addresses: updated_contact})