Contact methods: subscribe, suppress, unsubscribe
The Contact Verbs subscribe, suppress, unsubscribe as typed SDK methods, with inputs, result, refusals and an example.
Reference for Contact, one group of Contact methods.
Contact.subscribe
Subscribe records a Contact’s chosen topics and frequency from the hosted preference page, with Consent for each topic. Verb page.
interface ContactVerbs {
subscribe(input: ContactSubscribeInput, options?: SB.CallOptions): SB.Call<Contact>
}Emits Contact.subscribed.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
contact | Contact | required | The Contact. |
topics | string[] | required | The topics the Contact chose. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
contact | Contact | required | The Contact, with their topics. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
import { $ } from 'startup-builder'
const contact = await $.Contact.subscribe({ contact: 'contact_WsrosCQi6J', topics: ['Example topics'] })Contact.suppress
Suppress records a Suppression for a Contact’s address, which every Startup honors forever. Verb page.
interface ContactVerbs {
suppress(input: ContactSuppressInput, options?: SB.CallOptions): SB.Call<Contact>
}Emits Contact.suppressed.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
contact | Contact | required | The Contact who opts out. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
contact | Contact | required | The suppressed Contact. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
import { $ } from 'startup-builder'
const contact = await $.Contact.suppress({ contact: 'contact_WsrosCQi6J' })Contact.unsubscribe
Unsubscribe stops commercial Messages to a Contact in one click, for one topic or all, honored at once. Verb page.
interface ContactVerbs {
unsubscribe(input: ContactUnsubscribeInput, options?: SB.CallOptions): SB.Call<Contact>
}Emits Contact.unsubscribed.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
contact | Contact | required | The Contact. |
topic | string | One topic; omitted, every commercial topic. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
contact | Contact | required | The Contact, unsubscribed. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
import { $ } from 'startup-builder'
const contact = await $.Contact.unsubscribe({ contact: 'contact_WsrosCQi6J' })