addressBooks.mailingLists API
The mailingLists API allows to access and manage the user’s mailing lists.
Permissions
Read and modify your address books and contacts
Transfer sensitive user data (if access has been granted) to a remote server for further processing
Functions
addMember(id, contactId)
Adds a contact to the mailing list with id id. If the contact and mailing list are in different address books, the contact will also be copied to the list’s address book.
Parameters
id
(string)
contactId
(string)
Required permissions
create(parentId, properties)
Creates a new mailing list in the address book with id parentId.
Parameters
parentId
(string)
properties
(object)
name
(string)
[description
]
(string, optional)
[nickName
]
(string, optional)
Return type (Promise)
string
The ID of the new mailing list.
Required permissions
delete(id)
Removes the mailing list.
Parameters
id
(string)
Required permissions
get(id)
Gets a single mailing list.
Parameters
id
(string)
Return type (Promise)
Required permissions
list(parentId)
Gets all the mailing lists in the address book with id parentId.
Parameters
parentId
(string)
Return type (Promise)
array of MailingListNode
Required permissions
listMembers(id)
Gets all contacts that are members of the mailing list with id id.
Parameters
id
(string)
Return type (Promise)
array of contacts.ContactNode
Required permissions
removeMember(id, contactId)
Removes a contact from the mailing list with id id. This does not delete the contact from the address book.
Parameters
id
(string)
contactId
(string)
Required permissions
update(id, properties)
Edits the properties of a mailing list.
Parameters
id
(string)
properties
(object)
name
(string)
[description
]
(string, optional)
[nickName
]
(string, optional)
Required permissions
Events
onCreated
Fired when a mailing list is created.
Parameters for onCreated.addListener(listener)
listener(node)
A function that will be called when this event occurs.
Parameters passed to the listener function
Required permissions
onDeleted
Fired when a mailing list is deleted.
Parameters for onDeleted.addListener(listener)
listener(parentId, id)
A function that will be called when this event occurs.
Parameters passed to the listener function
parentId
(string)
id
(string)
Required permissions
onMemberAdded
Fired when a contact is added to the mailing list.
Parameters for onMemberAdded.addListener(listener)
listener(node)
A function that will be called when this event occurs.
Parameters passed to the listener function
node
(contacts.ContactNode)
Required permissions
onMemberRemoved
Fired when a contact is removed from the mailing list.
Parameters for onMemberRemoved.addListener(listener)
listener(parentId, id)
A function that will be called when this event occurs.
Parameters passed to the listener function
parentId
(string)
id
(string)
Required permissions
onUpdated
Fired when a mailing list is changed.
Parameters for onUpdated.addListener(listener)
listener(node)
A function that will be called when this event occurs.
Parameters passed to the listener function
Required permissions
Types
MailingListNode
A node representing a mailing list.
object
description
(string)
id
(string)
The unique identifier for the node. IDs are unique within the current profile, and they remain valid even after the program is restarted.
name
(string)
nickName
(string)
Always set to mailingList.
[contacts
]
(array of contacts.ContactNode, optional)
A list of contacts held by this node’s address book or mailing list.
[parentId
]
(string, optional)
The id of the parent object.
[readOnly
]
(boolean, optional)
Indicates if the object is read-only.
[remote
]
(boolean, optional)
Indicates if the object came from a remote address book.