@unlimited-messaging/sdk 0.1.25 → 0.1.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/api/resources/accounts/client/Client.d.ts +182 -1
- package/src/api/resources/accounts/client/Client.js +437 -1
- package/src/api/resources/accounts/client/requests/AccountConnectEmailRequest.d.ts +39 -0
- package/src/api/resources/accounts/client/requests/AccountConnectEmailRequest.js +5 -0
- package/src/api/resources/accounts/client/requests/AccountEmailAutoconfigRequest.d.ts +12 -0
- package/src/api/resources/accounts/client/requests/AccountEmailAutoconfigRequest.js +5 -0
- package/src/api/resources/accounts/client/requests/AccountReconnectEmailRequest.d.ts +22 -0
- package/src/api/resources/accounts/client/requests/AccountReconnectEmailRequest.js +5 -0
- package/src/api/resources/accounts/client/requests/AccountTestEmailRequest.d.ts +35 -0
- package/src/api/resources/accounts/client/requests/AccountTestEmailRequest.js +5 -0
- package/src/api/resources/accounts/client/requests/index.d.ts +4 -0
- package/src/api/resources/accounts/types/AccountConnectEmailRequestImap.d.ts +15 -0
- package/src/api/resources/accounts/types/AccountConnectEmailRequestImap.js +5 -0
- package/src/api/resources/accounts/types/AccountConnectEmailRequestImapSecurity.d.ts +11 -0
- package/src/api/resources/accounts/types/AccountConnectEmailRequestImapSecurity.js +10 -0
- package/src/api/resources/accounts/types/AccountConnectEmailRequestSmtp.d.ts +15 -0
- package/src/api/resources/accounts/types/AccountConnectEmailRequestSmtp.js +5 -0
- package/src/api/resources/accounts/types/AccountConnectEmailRequestSmtpSecurity.d.ts +11 -0
- package/src/api/resources/accounts/types/AccountConnectEmailRequestSmtpSecurity.js +10 -0
- package/src/api/resources/accounts/types/AccountConnectEmailResponse.d.ts +26 -0
- package/src/api/resources/accounts/types/AccountConnectEmailResponse.js +5 -0
- package/src/api/resources/accounts/types/AccountConnectEmailResponseChannel.d.ts +10 -0
- package/src/api/resources/accounts/types/AccountConnectEmailResponseChannel.js +12 -0
- package/src/api/resources/accounts/types/AccountConnectEmailResponseOwner.d.ts +11 -0
- package/src/api/resources/accounts/types/AccountConnectEmailResponseOwner.js +10 -0
- package/src/api/resources/accounts/types/AccountConnectEmailResponseStatus.d.ts +12 -0
- package/src/api/resources/accounts/types/AccountConnectEmailResponseStatus.js +14 -0
- package/src/api/resources/accounts/types/AccountEmailAutoconfigResponse.d.ts +16 -0
- package/src/api/resources/accounts/types/AccountEmailAutoconfigResponse.js +5 -0
- package/src/api/resources/accounts/types/AccountEmailAutoconfigResponseImap.d.ts +12 -0
- package/src/api/resources/accounts/types/AccountEmailAutoconfigResponseImap.js +5 -0
- package/src/api/resources/accounts/types/AccountEmailAutoconfigResponseImapSecurity.d.ts +11 -0
- package/src/api/resources/accounts/types/AccountEmailAutoconfigResponseImapSecurity.js +10 -0
- package/src/api/resources/accounts/types/AccountEmailAutoconfigResponseSmtp.d.ts +12 -0
- package/src/api/resources/accounts/types/AccountEmailAutoconfigResponseSmtp.js +5 -0
- package/src/api/resources/accounts/types/AccountEmailAutoconfigResponseSmtpSecurity.d.ts +11 -0
- package/src/api/resources/accounts/types/AccountEmailAutoconfigResponseSmtpSecurity.js +10 -0
- package/src/api/resources/accounts/types/AccountReconnectEmailRequestImap.d.ts +15 -0
- package/src/api/resources/accounts/types/AccountReconnectEmailRequestImap.js +5 -0
- package/src/api/resources/accounts/types/AccountReconnectEmailRequestImapSecurity.d.ts +11 -0
- package/src/api/resources/accounts/types/AccountReconnectEmailRequestImapSecurity.js +10 -0
- package/src/api/resources/accounts/types/AccountReconnectEmailRequestSmtp.d.ts +15 -0
- package/src/api/resources/accounts/types/AccountReconnectEmailRequestSmtp.js +5 -0
- package/src/api/resources/accounts/types/AccountReconnectEmailRequestSmtpSecurity.d.ts +11 -0
- package/src/api/resources/accounts/types/AccountReconnectEmailRequestSmtpSecurity.js +10 -0
- package/src/api/resources/accounts/types/AccountReconnectEmailResponse.d.ts +26 -0
- package/src/api/resources/accounts/types/AccountReconnectEmailResponse.js +5 -0
- package/src/api/resources/accounts/types/AccountReconnectEmailResponseChannel.d.ts +10 -0
- package/src/api/resources/accounts/types/AccountReconnectEmailResponseChannel.js +12 -0
- package/src/api/resources/accounts/types/AccountReconnectEmailResponseOwner.d.ts +11 -0
- package/src/api/resources/accounts/types/AccountReconnectEmailResponseOwner.js +10 -0
- package/src/api/resources/accounts/types/AccountReconnectEmailResponseStatus.d.ts +12 -0
- package/src/api/resources/accounts/types/AccountReconnectEmailResponseStatus.js +14 -0
- package/src/api/resources/accounts/types/AccountTestEmailRequestImap.d.ts +15 -0
- package/src/api/resources/accounts/types/AccountTestEmailRequestImap.js +5 -0
- package/src/api/resources/accounts/types/AccountTestEmailRequestImapSecurity.d.ts +11 -0
- package/src/api/resources/accounts/types/AccountTestEmailRequestImapSecurity.js +10 -0
- package/src/api/resources/accounts/types/AccountTestEmailRequestSmtp.d.ts +15 -0
- package/src/api/resources/accounts/types/AccountTestEmailRequestSmtp.js +5 -0
- package/src/api/resources/accounts/types/AccountTestEmailRequestSmtpSecurity.d.ts +11 -0
- package/src/api/resources/accounts/types/AccountTestEmailRequestSmtpSecurity.js +10 -0
- package/src/api/resources/accounts/types/AccountTestEmailResponse.d.ts +8 -0
- package/src/api/resources/accounts/types/AccountTestEmailResponse.js +5 -0
- package/src/api/resources/accounts/types/index.d.ts +26 -0
- package/src/api/resources/accounts/types/index.js +26 -0
- package/src/api/resources/messages/client/Client.d.ts +1 -1
- package/src/api/resources/messages/client/Client.js +1 -1
- package/src/api/resources/messages/types/MessageSendRequestChannelsItemChannel.d.ts +2 -1
- package/src/api/resources/messages/types/MessageSendRequestChannelsItemChannel.js +1 -0
- package/src/serialization/resources/accounts/client/requests/AccountConnectEmailRequest.d.ts +21 -0
- package/src/serialization/resources/accounts/client/requests/AccountConnectEmailRequest.js +52 -0
- package/src/serialization/resources/accounts/client/requests/AccountReconnectEmailRequest.d.ts +18 -0
- package/src/serialization/resources/accounts/client/requests/AccountReconnectEmailRequest.js +49 -0
- package/src/serialization/resources/accounts/client/requests/AccountTestEmailRequest.d.ts +19 -0
- package/src/serialization/resources/accounts/client/requests/AccountTestEmailRequest.js +50 -0
- package/src/serialization/resources/accounts/client/requests/index.d.ts +3 -0
- package/src/serialization/resources/accounts/client/requests/index.js +7 -1
- package/src/serialization/resources/accounts/types/AccountConnectEmailRequestImap.d.ts +15 -0
- package/src/serialization/resources/accounts/types/AccountConnectEmailRequestImap.js +46 -0
- package/src/serialization/resources/accounts/types/AccountConnectEmailRequestImapSecurity.d.ts +10 -0
- package/src/serialization/resources/accounts/types/AccountConnectEmailRequestImapSecurity.js +41 -0
- package/src/serialization/resources/accounts/types/AccountConnectEmailRequestSmtp.d.ts +15 -0
- package/src/serialization/resources/accounts/types/AccountConnectEmailRequestSmtp.js +46 -0
- package/src/serialization/resources/accounts/types/AccountConnectEmailRequestSmtpSecurity.d.ts +10 -0
- package/src/serialization/resources/accounts/types/AccountConnectEmailRequestSmtpSecurity.js +41 -0
- package/src/serialization/resources/accounts/types/AccountConnectEmailResponse.d.ts +28 -0
- package/src/serialization/resources/accounts/types/AccountConnectEmailResponse.js +59 -0
- package/src/serialization/resources/accounts/types/AccountConnectEmailResponseChannel.d.ts +10 -0
- package/src/serialization/resources/accounts/types/AccountConnectEmailResponseChannel.js +41 -0
- package/src/serialization/resources/accounts/types/AccountConnectEmailResponseOwner.d.ts +10 -0
- package/src/serialization/resources/accounts/types/AccountConnectEmailResponseOwner.js +41 -0
- package/src/serialization/resources/accounts/types/AccountConnectEmailResponseStatus.d.ts +10 -0
- package/src/serialization/resources/accounts/types/AccountConnectEmailResponseStatus.js +41 -0
- package/src/serialization/resources/accounts/types/AccountEmailAutoconfigResponse.d.ts +19 -0
- package/src/serialization/resources/accounts/types/AccountEmailAutoconfigResponse.js +50 -0
- package/src/serialization/resources/accounts/types/AccountEmailAutoconfigResponseImap.d.ts +15 -0
- package/src/serialization/resources/accounts/types/AccountEmailAutoconfigResponseImap.js +46 -0
- package/src/serialization/resources/accounts/types/AccountEmailAutoconfigResponseImapSecurity.d.ts +10 -0
- package/src/serialization/resources/accounts/types/AccountEmailAutoconfigResponseImapSecurity.js +41 -0
- package/src/serialization/resources/accounts/types/AccountEmailAutoconfigResponseSmtp.d.ts +15 -0
- package/src/serialization/resources/accounts/types/AccountEmailAutoconfigResponseSmtp.js +46 -0
- package/src/serialization/resources/accounts/types/AccountEmailAutoconfigResponseSmtpSecurity.d.ts +10 -0
- package/src/serialization/resources/accounts/types/AccountEmailAutoconfigResponseSmtpSecurity.js +41 -0
- package/src/serialization/resources/accounts/types/AccountReconnectEmailRequestImap.d.ts +15 -0
- package/src/serialization/resources/accounts/types/AccountReconnectEmailRequestImap.js +46 -0
- package/src/serialization/resources/accounts/types/AccountReconnectEmailRequestImapSecurity.d.ts +10 -0
- package/src/serialization/resources/accounts/types/AccountReconnectEmailRequestImapSecurity.js +41 -0
- package/src/serialization/resources/accounts/types/AccountReconnectEmailRequestSmtp.d.ts +15 -0
- package/src/serialization/resources/accounts/types/AccountReconnectEmailRequestSmtp.js +46 -0
- package/src/serialization/resources/accounts/types/AccountReconnectEmailRequestSmtpSecurity.d.ts +10 -0
- package/src/serialization/resources/accounts/types/AccountReconnectEmailRequestSmtpSecurity.js +41 -0
- package/src/serialization/resources/accounts/types/AccountReconnectEmailResponse.d.ts +28 -0
- package/src/serialization/resources/accounts/types/AccountReconnectEmailResponse.js +59 -0
- package/src/serialization/resources/accounts/types/AccountReconnectEmailResponseChannel.d.ts +10 -0
- package/src/serialization/resources/accounts/types/AccountReconnectEmailResponseChannel.js +41 -0
- package/src/serialization/resources/accounts/types/AccountReconnectEmailResponseOwner.d.ts +10 -0
- package/src/serialization/resources/accounts/types/AccountReconnectEmailResponseOwner.js +41 -0
- package/src/serialization/resources/accounts/types/AccountReconnectEmailResponseStatus.d.ts +10 -0
- package/src/serialization/resources/accounts/types/AccountReconnectEmailResponseStatus.js +41 -0
- package/src/serialization/resources/accounts/types/AccountTestEmailRequestImap.d.ts +15 -0
- package/src/serialization/resources/accounts/types/AccountTestEmailRequestImap.js +46 -0
- package/src/serialization/resources/accounts/types/AccountTestEmailRequestImapSecurity.d.ts +10 -0
- package/src/serialization/resources/accounts/types/AccountTestEmailRequestImapSecurity.js +41 -0
- package/src/serialization/resources/accounts/types/AccountTestEmailRequestSmtp.d.ts +15 -0
- package/src/serialization/resources/accounts/types/AccountTestEmailRequestSmtp.js +46 -0
- package/src/serialization/resources/accounts/types/AccountTestEmailRequestSmtpSecurity.d.ts +10 -0
- package/src/serialization/resources/accounts/types/AccountTestEmailRequestSmtpSecurity.js +41 -0
- package/src/serialization/resources/accounts/types/AccountTestEmailResponse.d.ts +13 -0
- package/src/serialization/resources/accounts/types/AccountTestEmailResponse.js +44 -0
- package/src/serialization/resources/accounts/types/index.d.ts +26 -0
- package/src/serialization/resources/accounts/types/index.js +26 -0
- package/src/serialization/resources/messages/types/MessageSendRequestChannelsItemChannel.d.ts +1 -1
- package/src/serialization/resources/messages/types/MessageSendRequestChannelsItemChannel.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unlimited-messaging/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.26",
|
|
4
4
|
"description": "TypeScript / Node.js SDK for the Unlimited Messaging API — send and receive WhatsApp messages programmatically",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -22,6 +22,82 @@ export declare namespace Accounts {
|
|
|
22
22
|
headers?: Record<string, string>;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* An account is one of your own messaging identities: a WhatsApp number, a mailbox, or an Android
|
|
28
|
+
* phone sending SMS. Every message is sent from and received on an account. Link as many as your
|
|
29
|
+
* plan allows, then send with `POST /message` (pass `accountId`, or omit it to let the API pick one
|
|
30
|
+
* for the channel).
|
|
31
|
+
*
|
|
32
|
+
* | Channel | How it is linked | Through the API |
|
|
33
|
+
* | ------- | ---------------- | --------------- |
|
|
34
|
+
* | `WHATSAPP_WHATSMEOW` | Scan a QR code with the phone | `GET /account/link`, then poll `GET /account/{accountId}/challenge` |
|
|
35
|
+
* | `EMAIL` | IMAP/SMTP credentials of the mailbox | `POST /account/email` |
|
|
36
|
+
* | `SMS` | The free Android app, signed in to your account | Not linkable through the API |
|
|
37
|
+
*
|
|
38
|
+
* All of these work with an API key (`Authorization: Bearer <key>`). Status changes of every account
|
|
39
|
+
* (linked, disconnected, credentials refused...) are also sent as `account.status_changed` webhooks.
|
|
40
|
+
*
|
|
41
|
+
* ### Linking a WhatsApp number
|
|
42
|
+
*
|
|
43
|
+
* 1. `GET /account/link` creates the account in status `LINKING` and returns its `accountId`.
|
|
44
|
+
* 2. Poll `GET /account/{accountId}/challenge` every second. It returns
|
|
45
|
+
* `{ "challenge": { "kind": "qr", "data": "2@..." } }`: render `data` as a QR code (any QR library).
|
|
46
|
+
* It rotates about every 20 seconds, so keep polling and re-rendering.
|
|
47
|
+
* 3. The user scans it in WhatsApp: **Settings > Linked devices > Link a device**.
|
|
48
|
+
* 4. Once scanned, `challenge` becomes `null` and `GET /account/{accountId}` shows status `ACTIVE`.
|
|
49
|
+
*
|
|
50
|
+
* If the attempt expires, call `GET /account/link` again: the pending account is resumed, not
|
|
51
|
+
* duplicated. Linking numbers for several of your customers? Pass `externalRef` (your id for the
|
|
52
|
+
* customer) so each one resumes only their own attempt.
|
|
53
|
+
*
|
|
54
|
+
* ```bash
|
|
55
|
+
* curl -H "Authorization: Bearer $UM_API_KEY" https://api.unlimitedmessaging.app/account/link
|
|
56
|
+
* # { "accountId": "6f1c..." }
|
|
57
|
+
* curl -H "Authorization: Bearer $UM_API_KEY" https://api.unlimitedmessaging.app/account/6f1c.../challenge
|
|
58
|
+
* # { "challenge": { "kind": "qr", "data": "2@AbC..." } }
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
* ### Connecting a mailbox
|
|
62
|
+
*
|
|
63
|
+
* No QR code: a mailbox connects from its credentials alone and is `ACTIVE` as soon as the call returns.
|
|
64
|
+
*
|
|
65
|
+
* 1. `GET /account/email/autoconfig?email=jane@example.com` suggests the IMAP and SMTP servers.
|
|
66
|
+
* If `oauthRequired` is true (Outlook.com, Hotmail, Microsoft 365), the mailbox cannot be connected yet.
|
|
67
|
+
* 2. Optional: `POST /account/email/test` checks the credentials without saving anything.
|
|
68
|
+
* 3. `POST /account/email` with the address, the password and the servers connects it and returns the account.
|
|
69
|
+
*
|
|
70
|
+
* Gmail, iCloud and Yahoo refuse the normal account password over IMAP: create an **app password**
|
|
71
|
+
* in the provider's security settings and send that instead. The password is stored encrypted by the
|
|
72
|
+
* mail service and never returned by the API.
|
|
73
|
+
*
|
|
74
|
+
* ```bash
|
|
75
|
+
* curl -X POST https://api.unlimitedmessaging.app/account/email \
|
|
76
|
+
* -H "Authorization: Bearer $UM_API_KEY" -H "Content-Type: application/json" \
|
|
77
|
+
* -d '{
|
|
78
|
+
* "address": "jane@example.com",
|
|
79
|
+
* "password": "app-password",
|
|
80
|
+
* "imap": { "host": "imap.gmail.com", "port": 993, "security": "tls" },
|
|
81
|
+
* "smtp": { "host": "smtp.gmail.com", "port": 465, "security": "tls" }
|
|
82
|
+
* }'
|
|
83
|
+
* ```
|
|
84
|
+
*
|
|
85
|
+
* Failures answer `422` with `context.code`: `AUTH_FAILED` (wrong password, or an app password is
|
|
86
|
+
* required), `OAUTH_REQUIRED`, `HOST_UNREACHABLE`, `TLS_ERROR`; and `409` `EMAIL_ALREADY_CONNECTED`.
|
|
87
|
+
* When the password changes, or the server starts refusing it (status `INACTIVE`), send the new one
|
|
88
|
+
* with `PUT /account/{accountId}/email`.
|
|
89
|
+
*
|
|
90
|
+
* ### Through the MCP server
|
|
91
|
+
*
|
|
92
|
+
* An AI assistant connected to the MCP server (`https://api.unlimitedmessaging.app/mcp`) links
|
|
93
|
+
* both channels too:
|
|
94
|
+
*
|
|
95
|
+
* - **WhatsApp**: the `add-account` tool shows the QR code in the chat, to scan like above.
|
|
96
|
+
* - **Email**: `add-email-account` first recommends the dashboard, where the user types the password
|
|
97
|
+
* themselves and it never goes through the conversation. If the user prefers, they can give their
|
|
98
|
+
* address and password (or app password) in the chat instead: the tool finds the servers and
|
|
99
|
+
* connects the mailbox directly.
|
|
100
|
+
*/
|
|
25
101
|
export declare class Accounts {
|
|
26
102
|
protected readonly _options: Accounts.Options;
|
|
27
103
|
constructor(_options: Accounts.Options);
|
|
@@ -43,7 +119,7 @@ export declare class Accounts {
|
|
|
43
119
|
/**
|
|
44
120
|
* **Protection**: Protected endpoint. Allowed roles: USER, ADMIN. Required scopes: OTHER:READ, OTHER:WRITE
|
|
45
121
|
*
|
|
46
|
-
* Creates a new account in
|
|
122
|
+
* Creates a new WHATSAPP account in LINKING status and starts a WhatsApp session. Poll GET /account/{accountId}/challenge every second: it returns `{ kind: "qr", data }`, the string to render as a QR code. The user scans it in WhatsApp > Settings > Linked devices > Link a device. The QR rotates about every 20 seconds, keep polling and re-rendering it. Once scanned the challenge becomes null and GET /account/{accountId} shows status ACTIVE (an `account.status_changed` webhook is also sent). If the attempt expires before it is scanned, call this endpoint again: the pending attempt is resumed. `mode` is kept for backwards compatibility, `stable` and `beta` now use the same connection. A pending attempt is resumed rather than duplicated. When you link numbers on behalf of several customers, pass `externalRef` (your own id for the customer, stored on the account and returned with it) so only that customer's pending attempt is resumed, or `new=true` to always start a fresh one.
|
|
47
123
|
*
|
|
48
124
|
* @param {UnlimitedMessagingApi.AccountLinkAccountRequest} request
|
|
49
125
|
* @param {Accounts.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -57,6 +133,111 @@ export declare class Accounts {
|
|
|
57
133
|
*/
|
|
58
134
|
accountLinkAccount(request?: UnlimitedMessagingApi.AccountLinkAccountRequest, requestOptions?: Accounts.RequestOptions): core.HttpResponsePromise<UnlimitedMessagingApi.AccountLinkAccountResponse>;
|
|
59
135
|
private __accountLinkAccount;
|
|
136
|
+
/**
|
|
137
|
+
* **Protection**: Protected endpoint. Allowed roles: USER, ADMIN. Required scopes: OTHER:READ, OTHER:WRITE
|
|
138
|
+
*
|
|
139
|
+
* First step of connecting a mailbox: looks up the IMAP and SMTP servers for an address (provider autoconfig, Mozilla ISP database, DNS, probing). Pass the result to POST /account/email/test or POST /account/email along with the password. When `oauthRequired` is true (Outlook.com, Hotmail, Microsoft 365) the mailbox cannot be connected yet.
|
|
140
|
+
*
|
|
141
|
+
* @param {UnlimitedMessagingApi.AccountEmailAutoconfigRequest} request
|
|
142
|
+
* @param {Accounts.RequestOptions} requestOptions - Request-specific configuration.
|
|
143
|
+
*
|
|
144
|
+
* @throws {@link UnlimitedMessagingApi.BadRequestError}
|
|
145
|
+
* @throws {@link UnlimitedMessagingApi.UnauthorizedError}
|
|
146
|
+
* @throws {@link UnlimitedMessagingApi.ForbiddenError}
|
|
147
|
+
* @throws {@link UnlimitedMessagingApi.ServiceUnavailableError}
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* await client.accounts.accountEmailAutoconfig({
|
|
151
|
+
* email: "email"
|
|
152
|
+
* })
|
|
153
|
+
*/
|
|
154
|
+
accountEmailAutoconfig(request: UnlimitedMessagingApi.AccountEmailAutoconfigRequest, requestOptions?: Accounts.RequestOptions): core.HttpResponsePromise<UnlimitedMessagingApi.AccountEmailAutoconfigResponse>;
|
|
155
|
+
private __accountEmailAutoconfig;
|
|
156
|
+
/**
|
|
157
|
+
* **Protection**: Protected endpoint. Allowed roles: USER, ADMIN. Required scopes: OTHER:READ, OTHER:WRITE
|
|
158
|
+
*
|
|
159
|
+
* Logs in to the IMAP and SMTP servers and saves nothing. Optional: POST /account/email runs the same test before connecting. Errors (422) carry `context.code`: AUTH_FAILED (wrong password, or an app password is required), OAUTH_REQUIRED (Microsoft 365 / Outlook.com), HOST_UNREACHABLE, TLS_ERROR.
|
|
160
|
+
*
|
|
161
|
+
* @param {UnlimitedMessagingApi.AccountTestEmailRequest} request
|
|
162
|
+
* @param {Accounts.RequestOptions} requestOptions - Request-specific configuration.
|
|
163
|
+
*
|
|
164
|
+
* @throws {@link UnlimitedMessagingApi.UnauthorizedError}
|
|
165
|
+
* @throws {@link UnlimitedMessagingApi.ForbiddenError}
|
|
166
|
+
* @throws {@link UnlimitedMessagingApi.UnprocessableEntityError}
|
|
167
|
+
* @throws {@link UnlimitedMessagingApi.ServiceUnavailableError}
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
* await client.accounts.accountTestEmail({
|
|
171
|
+
* address: "address",
|
|
172
|
+
* password: "password",
|
|
173
|
+
* imap: {
|
|
174
|
+
* host: "host",
|
|
175
|
+
* port: 1,
|
|
176
|
+
* security: "tls"
|
|
177
|
+
* },
|
|
178
|
+
* smtp: {
|
|
179
|
+
* host: "host",
|
|
180
|
+
* port: 1,
|
|
181
|
+
* security: "tls"
|
|
182
|
+
* }
|
|
183
|
+
* })
|
|
184
|
+
*/
|
|
185
|
+
accountTestEmail(request: UnlimitedMessagingApi.AccountTestEmailRequest, requestOptions?: Accounts.RequestOptions): core.HttpResponsePromise<UnlimitedMessagingApi.AccountTestEmailResponse>;
|
|
186
|
+
private __accountTestEmail;
|
|
187
|
+
/**
|
|
188
|
+
* **Protection**: Protected endpoint. Allowed roles: USER, ADMIN. Required scopes: OTHER:READ, OTHER:WRITE
|
|
189
|
+
*
|
|
190
|
+
* Tests the credentials and connects the mailbox as an EMAIL account. There is no QR code or challenge: the account is ACTIVE as soon as this returns. Its id is then the `accountId` to send email from with POST /message, and incoming email arrives as `message.received` webhooks. Gmail, iCloud and Yahoo require an app password. Same error codes as POST /account/email/test, plus EMAIL_ALREADY_CONNECTED (409, with `context.accountId` when the mailbox is already yours: update its password with PUT /account/{accountId}/email instead).
|
|
191
|
+
*
|
|
192
|
+
* @param {UnlimitedMessagingApi.AccountConnectEmailRequest} request
|
|
193
|
+
* @param {Accounts.RequestOptions} requestOptions - Request-specific configuration.
|
|
194
|
+
*
|
|
195
|
+
* @throws {@link UnlimitedMessagingApi.UnauthorizedError}
|
|
196
|
+
* @throws {@link UnlimitedMessagingApi.ForbiddenError}
|
|
197
|
+
* @throws {@link UnlimitedMessagingApi.ConflictError}
|
|
198
|
+
* @throws {@link UnlimitedMessagingApi.UnprocessableEntityError}
|
|
199
|
+
* @throws {@link UnlimitedMessagingApi.ServiceUnavailableError}
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* await client.accounts.accountConnectEmail({
|
|
203
|
+
* address: "address",
|
|
204
|
+
* password: "password",
|
|
205
|
+
* imap: {
|
|
206
|
+
* host: "host",
|
|
207
|
+
* port: 1,
|
|
208
|
+
* security: "tls"
|
|
209
|
+
* },
|
|
210
|
+
* smtp: {
|
|
211
|
+
* host: "host",
|
|
212
|
+
* port: 1,
|
|
213
|
+
* security: "tls"
|
|
214
|
+
* }
|
|
215
|
+
* })
|
|
216
|
+
*/
|
|
217
|
+
accountConnectEmail(request: UnlimitedMessagingApi.AccountConnectEmailRequest, requestOptions?: Accounts.RequestOptions): core.HttpResponsePromise<UnlimitedMessagingApi.AccountConnectEmailResponse>;
|
|
218
|
+
private __accountConnectEmail;
|
|
219
|
+
/**
|
|
220
|
+
* **Protection**: Protected endpoint. Allowed roles: USER, ADMIN. Required scopes: OTHER:READ, OTHER:WRITE
|
|
221
|
+
*
|
|
222
|
+
* For a changed password, or an account whose credentials the mail server refused (status INACTIVE, see the `account.status_changed` webhook). Servers default to the stored ones. The address cannot change: connect a new mailbox instead.
|
|
223
|
+
*
|
|
224
|
+
* @param {string} accountId
|
|
225
|
+
* @param {UnlimitedMessagingApi.AccountReconnectEmailRequest} request
|
|
226
|
+
* @param {Accounts.RequestOptions} requestOptions - Request-specific configuration.
|
|
227
|
+
*
|
|
228
|
+
* @throws {@link UnlimitedMessagingApi.UnauthorizedError}
|
|
229
|
+
* @throws {@link UnlimitedMessagingApi.ForbiddenError}
|
|
230
|
+
* @throws {@link UnlimitedMessagingApi.NotFoundError}
|
|
231
|
+
* @throws {@link UnlimitedMessagingApi.UnprocessableEntityError}
|
|
232
|
+
* @throws {@link UnlimitedMessagingApi.ServiceUnavailableError}
|
|
233
|
+
*
|
|
234
|
+
* @example
|
|
235
|
+
* await client.accounts.accountReconnectEmail("accountId", {
|
|
236
|
+
* password: "password"
|
|
237
|
+
* })
|
|
238
|
+
*/
|
|
239
|
+
accountReconnectEmail(accountId: string, request: UnlimitedMessagingApi.AccountReconnectEmailRequest, requestOptions?: Accounts.RequestOptions): core.HttpResponsePromise<UnlimitedMessagingApi.AccountReconnectEmailResponse>;
|
|
240
|
+
private __accountReconnectEmail;
|
|
60
241
|
/**
|
|
61
242
|
* **Protection**: Protected endpoint. Allowed roles: USER, ADMIN. Required scopes: OTHER:READ, OTHER:WRITE
|
|
62
243
|
*
|