contact_methods
Creates, updates, deletes, gets or lists a contact_methods resource.
Overview
| Name | contact_methods |
| Type | Resource |
| Id | pagerduty.users.contact_methods |
Fields
The following fields are returned by SELECT queries:
- get
- list
The user's contact method requested.
| Name | Datatype | Description |
|---|---|---|
id | string | |
address | string | The "address" to deliver to: email, phone number, etc., depending on the type. |
blacklisted | boolean | If true, this phone has been blacklisted by PagerDuty and no messages will be sent to it. |
country_code | integer | The 1-to-3 digit country calling code. |
created_at | string (date-time) | Time at which the contact method was created. |
device_type | string | The type of device. (android, ios) |
enabled | boolean | If true, this phone is capable of receiving notifications. |
html_url | string (url) | a URL at which the entity is uniquely displayed in the Web app |
label | string | The label (e.g., "Work", "Mobile", etc.). |
self | string (url) | the API show URL at which the object is accessible |
send_short_email | boolean | Send an abbreviated email message instead of the standard email output. Useful for email-to-SMS gateways and email based pagers. |
sounds | array | |
summary | string | A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to name, though it is not intended to be an identifier. |
type | string | A string that determines the schema of the object. This must be the standard name for the entity, suffixed by _reference if the object is a reference. |
A list of contact methods.
| Name | Datatype | Description |
|---|
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id, contact_method_id | Get details about a User's contact method.<br /><br />Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.<br /><br />For more information see the [API Concepts Document](https://developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#users)<br /><br />Scoped OAuth requires: users:contact_methods.read<br /> | |
list | select | id | List contact methods of your PagerDuty user.<br /><br />Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.<br /><br />For more information see the [API Concepts Document](https://developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#users)<br /><br />Scoped OAuth requires: users:contact_methods.read<br /> | |
create | insert | id, contact_method | Create a new contact method for the User.<br /><br />Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.<br /><br />For more information see the [API Concepts Document](https://developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#users)<br /><br />Scoped OAuth requires: users:contact_methods.write<br /> | |
update | update | id, contact_method_id, contact_method | Update a User's contact method.<br /><br />Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.<br /><br />For more information see the [API Concepts Document](https://developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#users)<br /><br />Scoped OAuth requires: users:contact_methods.write<br /> | |
delete | delete | id, contact_method_id | Remove a user's contact method.<br /><br />Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.<br /><br />For more information see the [API Concepts Document](https://developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#users)<br /><br />Scoped OAuth requires: users:contact_methods.write<br /> |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
contact_method_id | string | The contact method ID on the user. |
id | string | The ID of the resource. |
SELECT examples
- get
- list
Get details about a User's contact method.<br /><br />Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.<br /><br />For more information see the [API Concepts Document](https://developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#users)<br /><br />Scoped OAuth requires: users:contact_methods.read<br />
SELECT
id,
address,
blacklisted,
country_code,
created_at,
device_type,
enabled,
html_url,
label,
self,
send_short_email,
sounds,
summary,
type
FROM pagerduty.users.contact_methods
WHERE id = '{{ id }}' -- required
AND contact_method_id = '{{ contact_method_id }}' -- required
;
List contact methods of your PagerDuty user.<br /><br />Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.<br /><br />For more information see the [API Concepts Document](https://developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#users)<br /><br />Scoped OAuth requires: users:contact_methods.read<br />
SELECT
*
FROM pagerduty.users.contact_methods
WHERE id = '{{ id }}' -- required
;
INSERT examples
- create
- Manifest
Create a new contact method for the User.<br /><br />Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.<br /><br />For more information see the [API Concepts Document](https://developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#users)<br /><br />Scoped OAuth requires: users:contact_methods.write<br />
INSERT INTO pagerduty.users.contact_methods (
contact_method,
id
)
SELECT
'{{ contact_method }}' /* required */,
'{{ id }}'
RETURNING
contact_method
;
# Description fields are for documentation purposes
- name: contact_methods
props:
- name: id
value: "{{ id }}"
description: Required parameter for the contact_methods resource.
- name: contact_method
description: |
The Phone Contact Method of the User, used for Voice or SMS.
value:
id: "{{ id }}"
summary: "{{ summary }}"
type: "{{ type }}"
self: "{{ self }}"
html_url: "{{ html_url }}"
label: "{{ label }}"
address: "{{ address }}"
country_code: {{ country_code }}
enabled: {{ enabled }}
blacklisted: {{ blacklisted }}
device_type: "{{ device_type }}"
sounds:
- type: "{{ type }}"
file: "{{ file }}"
created_at: "{{ created_at }}"
send_short_email: {{ send_short_email }}
UPDATE examples
- update
Update a User's contact method.<br /><br />Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.<br /><br />For more information see the [API Concepts Document](https://developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#users)<br /><br />Scoped OAuth requires: users:contact_methods.write<br />
UPDATE pagerduty.users.contact_methods
SET
contact_method = '{{ contact_method }}'
WHERE
id = '{{ id }}' --required
AND contact_method_id = '{{ contact_method_id }}' --required
AND contact_method = '{{ contact_method }}' --required
RETURNING
contact_method;
DELETE examples
- delete
Remove a user's contact method.<br /><br />Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.<br /><br />For more information see the [API Concepts Document](https://developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#users)<br /><br />Scoped OAuth requires: users:contact_methods.write<br />
DELETE FROM pagerduty.users.contact_methods
WHERE id = '{{ id }}' --required
AND contact_method_id = '{{ contact_method_id }}' --required
;