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
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 accountargs
- Arguments for creating a NodePing contactcustomerid
- optional ID to access a subaccount
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 accountargs
- Arguments for creating a NodePing contactcustomerid
- optional ID to access a subaccount
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 accountid
- ID for contact that will be deletedcustomerid
- optional ID to access a subaccount
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 accountid
- ID for contact that will be deletedcustomerid
- optional ID to access a subaccount
Get all contacts on your NodePing account or subaccount
Parameters
token
- NodePing API token that was provided with accountcustomerid
- optional ID to access a subaccount
Examples
iex> token = System.fetch_env!("TOKEN")
iex> {:ok, result} = NodePing.Contacts.get_all(token)
Get all contacts on your NodePing account or subaccount
Parameters
token
- NodePing API token that was provided with accountcustomerid
- optional ID to access a subaccount
Examples
iex> token = System.fetch_env!("TOKEN")
iex> result = NodePing.Contacts.get_all!(token)
Get a contact on your NodePing account or subaccount
Parameters
token
- NodePing API token that was provided with accountid
- contact ID for getting a single contactcustomerid
- 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)
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 accountid
- contact ID for getting a single contactcustomerid
- 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)
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 accountid
- the ID for the contact you want to muteduration
- time to mute the contact method in secondscustomerid
- optional ID to access a subaccount
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 accountid
- the ID for the contact you want to muteduration
- time to mute the contact method in secondscustomerid
- optional ID to access a subaccount
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 accountid
- the ID for the contact method you want to muteduration
- time to mute the contact method in secondscustomerid
- optional ID to access a subaccount
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 accountid
- the ID for the contact method you want to muteduration
- time to mute the contact method in secondscustomerid
- optional ID to access a subaccount
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.
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 accountid
- The contact idargs
- Arguments for creating a NodePing contactcustomerid
- 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})
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 accountid
- The contact idargs
- Arguments for creating a NodePing contactcustomerid
- 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})