late-sdk 0.0.47 → 0.0.48
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.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/docs/ConnectApi.md +70 -0
- data/docs/ConnectWhatsAppCredentials200Response.md +20 -0
- data/docs/ConnectWhatsAppCredentials200ResponseAccount.md +32 -0
- data/docs/ConnectWhatsAppCredentialsRequest.md +24 -0
- data/docs/CreateWhatsAppTemplate200ResponseTemplate.md +1 -1
- data/docs/CreateWhatsAppTemplateRequest.md +8 -2
- data/docs/CreateWhatsAppTemplateRequestLibraryTemplateButtonInputsInner.md +22 -0
- data/docs/CreateWhatsAppTemplateRequestLibraryTemplateButtonInputsInnerUrl.md +18 -0
- data/docs/WhatsAppApi.md +2 -2
- data/lib/late-sdk/api/connect_api.rb +68 -0
- data/lib/late-sdk/api/whats_app_api.rb +2 -2
- data/lib/late-sdk/models/connect_whats_app_credentials200_response.rb +156 -0
- data/lib/late-sdk/models/connect_whats_app_credentials200_response_account.rb +247 -0
- data/lib/late-sdk/models/connect_whats_app_credentials_request.rb +246 -0
- data/lib/late-sdk/models/create_whats_app_template200_response_template.rb +1 -0
- data/lib/late-sdk/models/create_whats_app_template_request.rb +37 -22
- data/lib/late-sdk/models/create_whats_app_template_request_library_template_button_inputs_inner.rb +199 -0
- data/lib/late-sdk/models/create_whats_app_template_request_library_template_button_inputs_inner_url.rb +147 -0
- data/lib/late-sdk/version.rb +1 -1
- data/lib/late-sdk.rb +5 -0
- data/openapi.yaml +149 -14
- data/spec/api/connect_api_spec.rb +12 -0
- data/spec/api/whats_app_api_spec.rb +1 -1
- data/spec/models/connect_whats_app_credentials200_response_account_spec.rb +82 -0
- data/spec/models/connect_whats_app_credentials200_response_spec.rb +42 -0
- data/spec/models/connect_whats_app_credentials_request_spec.rb +54 -0
- data/spec/models/create_whats_app_template_request_library_template_button_inputs_inner_spec.rb +52 -0
- data/spec/models/create_whats_app_template_request_library_template_button_inputs_inner_url_spec.rb +36 -0
- data/spec/models/create_whats_app_template_request_spec.rb +18 -0
- metadata +22 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9ab47b8601bb3dd05eeadad4f05b29dd018eef4ec584d29cafd68351c1c198bb
|
|
4
|
+
data.tar.gz: ac160f734233db8ebabe498f74ef41a8d071dc40362470d847918ada808a4b4a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 12fab50f5f4638d1e14d3478756dde98a049c2ae6750f9d337eb33be03eb2738150e8976712df19bbd0f6ce01dc30669528d242841aa9832b5f849f4d4f23f5e
|
|
7
|
+
data.tar.gz: ce4cb75bc0fd6619d63b1152ed82031b2de4a19935cc4a8fbca613847dffd055ad39b47e3586aa7ccd5bad15a75ab5c924b05ec159367289ec1ed8eacd6649d7
|
data/README.md
CHANGED
|
@@ -108,6 +108,7 @@ Class | Method | HTTP request | Description
|
|
|
108
108
|
*Late::CommentsApi* | [**unlike_inbox_comment**](docs/CommentsApi.md#unlike_inbox_comment) | **DELETE** /v1/inbox/comments/{postId}/{commentId}/like | Unlike comment
|
|
109
109
|
*Late::ConnectApi* | [**complete_telegram_connect**](docs/ConnectApi.md#complete_telegram_connect) | **PATCH** /v1/connect/telegram | Check Telegram status
|
|
110
110
|
*Late::ConnectApi* | [**connect_bluesky_credentials**](docs/ConnectApi.md#connect_bluesky_credentials) | **POST** /v1/connect/bluesky/credentials | Connect Bluesky account
|
|
111
|
+
*Late::ConnectApi* | [**connect_whats_app_credentials**](docs/ConnectApi.md#connect_whats_app_credentials) | **POST** /v1/connect/whatsapp/credentials | Connect WhatsApp via credentials
|
|
111
112
|
*Late::ConnectApi* | [**get_connect_url**](docs/ConnectApi.md#get_connect_url) | **GET** /v1/connect/{platform} | Get OAuth connect URL
|
|
112
113
|
*Late::ConnectApi* | [**get_facebook_pages**](docs/ConnectApi.md#get_facebook_pages) | **GET** /v1/accounts/{accountId}/facebook-page | List Facebook pages
|
|
113
114
|
*Late::ConnectApi* | [**get_gmb_locations**](docs/ConnectApi.md#get_gmb_locations) | **GET** /v1/accounts/{accountId}/gmb-locations | List GBP locations
|
|
@@ -272,6 +273,9 @@ Class | Method | HTTP request | Description
|
|
|
272
273
|
- [Late::CompleteTelegramConnect200Response](docs/CompleteTelegramConnect200Response.md)
|
|
273
274
|
- [Late::ConnectBlueskyCredentials200Response](docs/ConnectBlueskyCredentials200Response.md)
|
|
274
275
|
- [Late::ConnectBlueskyCredentialsRequest](docs/ConnectBlueskyCredentialsRequest.md)
|
|
276
|
+
- [Late::ConnectWhatsAppCredentials200Response](docs/ConnectWhatsAppCredentials200Response.md)
|
|
277
|
+
- [Late::ConnectWhatsAppCredentials200ResponseAccount](docs/ConnectWhatsAppCredentials200ResponseAccount.md)
|
|
278
|
+
- [Late::ConnectWhatsAppCredentialsRequest](docs/ConnectWhatsAppCredentialsRequest.md)
|
|
275
279
|
- [Late::Connected](docs/Connected.md)
|
|
276
280
|
- [Late::ConnectedAccount](docs/ConnectedAccount.md)
|
|
277
281
|
- [Late::ConnectionLog](docs/ConnectionLog.md)
|
|
@@ -309,6 +313,8 @@ Class | Method | HTTP request | Description
|
|
|
309
313
|
- [Late::CreateWhatsAppTemplate200Response](docs/CreateWhatsAppTemplate200Response.md)
|
|
310
314
|
- [Late::CreateWhatsAppTemplate200ResponseTemplate](docs/CreateWhatsAppTemplate200ResponseTemplate.md)
|
|
311
315
|
- [Late::CreateWhatsAppTemplateRequest](docs/CreateWhatsAppTemplateRequest.md)
|
|
316
|
+
- [Late::CreateWhatsAppTemplateRequestLibraryTemplateButtonInputsInner](docs/CreateWhatsAppTemplateRequestLibraryTemplateButtonInputsInner.md)
|
|
317
|
+
- [Late::CreateWhatsAppTemplateRequestLibraryTemplateButtonInputsInnerUrl](docs/CreateWhatsAppTemplateRequestLibraryTemplateButtonInputsInnerUrl.md)
|
|
312
318
|
- [Late::DeleteAccountGroup200Response](docs/DeleteAccountGroup200Response.md)
|
|
313
319
|
- [Late::DeleteGoogleBusinessMedia200Response](docs/DeleteGoogleBusinessMedia200Response.md)
|
|
314
320
|
- [Late::DeleteGoogleBusinessPlaceAction200Response](docs/DeleteGoogleBusinessPlaceAction200Response.md)
|
data/docs/ConnectApi.md
CHANGED
|
@@ -6,6 +6,7 @@ All URIs are relative to *https://getlate.dev/api*
|
|
|
6
6
|
| ------ | ------------ | ----------- |
|
|
7
7
|
| [**complete_telegram_connect**](ConnectApi.md#complete_telegram_connect) | **PATCH** /v1/connect/telegram | Check Telegram status |
|
|
8
8
|
| [**connect_bluesky_credentials**](ConnectApi.md#connect_bluesky_credentials) | **POST** /v1/connect/bluesky/credentials | Connect Bluesky account |
|
|
9
|
+
| [**connect_whats_app_credentials**](ConnectApi.md#connect_whats_app_credentials) | **POST** /v1/connect/whatsapp/credentials | Connect WhatsApp via credentials |
|
|
9
10
|
| [**get_connect_url**](ConnectApi.md#get_connect_url) | **GET** /v1/connect/{platform} | Get OAuth connect URL |
|
|
10
11
|
| [**get_facebook_pages**](ConnectApi.md#get_facebook_pages) | **GET** /v1/accounts/{accountId}/facebook-page | List Facebook pages |
|
|
11
12
|
| [**get_gmb_locations**](ConnectApi.md#get_gmb_locations) | **GET** /v1/accounts/{accountId}/gmb-locations | List GBP locations |
|
|
@@ -172,6 +173,75 @@ end
|
|
|
172
173
|
- **Accept**: application/json
|
|
173
174
|
|
|
174
175
|
|
|
176
|
+
## connect_whats_app_credentials
|
|
177
|
+
|
|
178
|
+
> <ConnectWhatsAppCredentials200Response> connect_whats_app_credentials(connect_whats_app_credentials_request)
|
|
179
|
+
|
|
180
|
+
Connect WhatsApp via credentials
|
|
181
|
+
|
|
182
|
+
Connect a WhatsApp Business Account by providing Meta credentials directly. This is the headless alternative to the Embedded Signup browser flow. To get the required credentials: 1. Go to Meta Business Suite (business.facebook.com) 2. Create or select a WhatsApp Business Account 3. In Business Settings > System Users, create a System User 4. Assign it the `whatsapp_business_management` and `whatsapp_business_messaging` permissions 5. Generate a permanent access token 6. Get the WABA ID from WhatsApp Manager > Account Tools > Phone Numbers 7. Get the Phone Number ID from the same page (click on the number)
|
|
183
|
+
|
|
184
|
+
### Examples
|
|
185
|
+
|
|
186
|
+
```ruby
|
|
187
|
+
require 'time'
|
|
188
|
+
require 'late-sdk'
|
|
189
|
+
# setup authorization
|
|
190
|
+
Late.configure do |config|
|
|
191
|
+
# Configure Bearer authorization (JWT): bearerAuth
|
|
192
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
api_instance = Late::ConnectApi.new
|
|
196
|
+
connect_whats_app_credentials_request = Late::ConnectWhatsAppCredentialsRequest.new({profile_id: 'profile_id_example', access_token: 'access_token_example', waba_id: 'waba_id_example', phone_number_id: 'phone_number_id_example'}) # ConnectWhatsAppCredentialsRequest |
|
|
197
|
+
|
|
198
|
+
begin
|
|
199
|
+
# Connect WhatsApp via credentials
|
|
200
|
+
result = api_instance.connect_whats_app_credentials(connect_whats_app_credentials_request)
|
|
201
|
+
p result
|
|
202
|
+
rescue Late::ApiError => e
|
|
203
|
+
puts "Error when calling ConnectApi->connect_whats_app_credentials: #{e}"
|
|
204
|
+
end
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
#### Using the connect_whats_app_credentials_with_http_info variant
|
|
208
|
+
|
|
209
|
+
This returns an Array which contains the response data, status code and headers.
|
|
210
|
+
|
|
211
|
+
> <Array(<ConnectWhatsAppCredentials200Response>, Integer, Hash)> connect_whats_app_credentials_with_http_info(connect_whats_app_credentials_request)
|
|
212
|
+
|
|
213
|
+
```ruby
|
|
214
|
+
begin
|
|
215
|
+
# Connect WhatsApp via credentials
|
|
216
|
+
data, status_code, headers = api_instance.connect_whats_app_credentials_with_http_info(connect_whats_app_credentials_request)
|
|
217
|
+
p status_code # => 2xx
|
|
218
|
+
p headers # => { ... }
|
|
219
|
+
p data # => <ConnectWhatsAppCredentials200Response>
|
|
220
|
+
rescue Late::ApiError => e
|
|
221
|
+
puts "Error when calling ConnectApi->connect_whats_app_credentials_with_http_info: #{e}"
|
|
222
|
+
end
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### Parameters
|
|
226
|
+
|
|
227
|
+
| Name | Type | Description | Notes |
|
|
228
|
+
| ---- | ---- | ----------- | ----- |
|
|
229
|
+
| **connect_whats_app_credentials_request** | [**ConnectWhatsAppCredentialsRequest**](ConnectWhatsAppCredentialsRequest.md) | | |
|
|
230
|
+
|
|
231
|
+
### Return type
|
|
232
|
+
|
|
233
|
+
[**ConnectWhatsAppCredentials200Response**](ConnectWhatsAppCredentials200Response.md)
|
|
234
|
+
|
|
235
|
+
### Authorization
|
|
236
|
+
|
|
237
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
238
|
+
|
|
239
|
+
### HTTP request headers
|
|
240
|
+
|
|
241
|
+
- **Content-Type**: application/json
|
|
242
|
+
- **Accept**: application/json
|
|
243
|
+
|
|
244
|
+
|
|
175
245
|
## get_connect_url
|
|
176
246
|
|
|
177
247
|
> <GetConnectUrl200Response> get_connect_url(platform, profile_id, opts)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Late::ConnectWhatsAppCredentials200Response
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **message** | **String** | | [optional] |
|
|
8
|
+
| **account** | [**ConnectWhatsAppCredentials200ResponseAccount**](ConnectWhatsAppCredentials200ResponseAccount.md) | | [optional] |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'late-sdk'
|
|
14
|
+
|
|
15
|
+
instance = Late::ConnectWhatsAppCredentials200Response.new(
|
|
16
|
+
message: null,
|
|
17
|
+
account: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Late::ConnectWhatsAppCredentials200ResponseAccount
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **account_id** | **String** | | [optional] |
|
|
8
|
+
| **platform** | **String** | | [optional] |
|
|
9
|
+
| **username** | **String** | Display phone number | [optional] |
|
|
10
|
+
| **display_name** | **String** | Meta-verified business name | [optional] |
|
|
11
|
+
| **is_active** | **Boolean** | | [optional] |
|
|
12
|
+
| **phone_number** | **String** | | [optional] |
|
|
13
|
+
| **verified_name** | **String** | | [optional] |
|
|
14
|
+
| **quality_rating** | **String** | GREEN, YELLOW, or RED | [optional] |
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
|
|
18
|
+
```ruby
|
|
19
|
+
require 'late-sdk'
|
|
20
|
+
|
|
21
|
+
instance = Late::ConnectWhatsAppCredentials200ResponseAccount.new(
|
|
22
|
+
account_id: null,
|
|
23
|
+
platform: null,
|
|
24
|
+
username: null,
|
|
25
|
+
display_name: null,
|
|
26
|
+
is_active: null,
|
|
27
|
+
phone_number: null,
|
|
28
|
+
verified_name: null,
|
|
29
|
+
quality_rating: null
|
|
30
|
+
)
|
|
31
|
+
```
|
|
32
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Late::ConnectWhatsAppCredentialsRequest
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **profile_id** | **String** | Your Late profile ID | |
|
|
8
|
+
| **access_token** | **String** | Permanent System User access token from Meta Business Suite | |
|
|
9
|
+
| **waba_id** | **String** | WhatsApp Business Account ID from Meta | |
|
|
10
|
+
| **phone_number_id** | **String** | Phone Number ID from Meta WhatsApp Manager | |
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
require 'late-sdk'
|
|
16
|
+
|
|
17
|
+
instance = Late::ConnectWhatsAppCredentialsRequest.new(
|
|
18
|
+
profile_id: null,
|
|
19
|
+
access_token: null,
|
|
20
|
+
waba_id: null,
|
|
21
|
+
phone_number_id: null
|
|
22
|
+
)
|
|
23
|
+
```
|
|
24
|
+
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **id** | **String** | | [optional] |
|
|
8
8
|
| **name** | **String** | | [optional] |
|
|
9
|
-
| **status** | **String** |
|
|
9
|
+
| **status** | **String** | APPROVED for library templates, PENDING for custom | [optional] |
|
|
10
10
|
| **category** | **String** | | [optional] |
|
|
11
11
|
| **language** | **String** | | [optional] |
|
|
12
12
|
|
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
| **name** | **String** | Template name (lowercase, letters/numbers/underscores, must start with a letter) | |
|
|
9
9
|
| **category** | **String** | Template category | |
|
|
10
10
|
| **language** | **String** | Template language code (e.g., en_US) | |
|
|
11
|
-
| **components** | **Array<Object>** | Template components (header, body, footer, buttons) |
|
|
11
|
+
| **components** | **Array<Object>** | Template components (header, body, footer, buttons). Required for custom templates, omit when using library_template_name. | [optional] |
|
|
12
|
+
| **library_template_name** | **String** | Name of a pre-built template from Meta's template library (e.g., \"appointment_reminder\", \"auto_pay_reminder_1\", \"address_update\"). When provided, the template is pre-approved by Meta with no review wait. Omit `components` when using this field. | [optional] |
|
|
13
|
+
| **library_template_body_inputs** | **Object** | Optional body customizations for library templates. Available options depend on the template (e.g., add_contact_number, add_learn_more_link, add_security_recommendation, add_track_package_link, code_expiration_minutes). | [optional] |
|
|
14
|
+
| **library_template_button_inputs** | [**Array<CreateWhatsAppTemplateRequestLibraryTemplateButtonInputsInner>**](CreateWhatsAppTemplateRequestLibraryTemplateButtonInputsInner.md) | Optional button customizations for library templates. Each item specifies button type and configuration (e.g., URL, phone number, quick reply). | [optional] |
|
|
12
15
|
|
|
13
16
|
## Example
|
|
14
17
|
|
|
@@ -20,7 +23,10 @@ instance = Late::CreateWhatsAppTemplateRequest.new(
|
|
|
20
23
|
name: null,
|
|
21
24
|
category: null,
|
|
22
25
|
language: null,
|
|
23
|
-
components: null
|
|
26
|
+
components: null,
|
|
27
|
+
library_template_name: null,
|
|
28
|
+
library_template_body_inputs: null,
|
|
29
|
+
library_template_button_inputs: null
|
|
24
30
|
)
|
|
25
31
|
```
|
|
26
32
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Late::CreateWhatsAppTemplateRequestLibraryTemplateButtonInputsInner
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **type** | **String** | | [optional] |
|
|
8
|
+
| **url** | [**CreateWhatsAppTemplateRequestLibraryTemplateButtonInputsInnerUrl**](CreateWhatsAppTemplateRequestLibraryTemplateButtonInputsInnerUrl.md) | | [optional] |
|
|
9
|
+
| **phone_number** | **String** | | [optional] |
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require 'late-sdk'
|
|
15
|
+
|
|
16
|
+
instance = Late::CreateWhatsAppTemplateRequestLibraryTemplateButtonInputsInner.new(
|
|
17
|
+
type: null,
|
|
18
|
+
url: null,
|
|
19
|
+
phone_number: null
|
|
20
|
+
)
|
|
21
|
+
```
|
|
22
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Late::CreateWhatsAppTemplateRequestLibraryTemplateButtonInputsInnerUrl
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **base_url** | **String** | | [optional] |
|
|
8
|
+
|
|
9
|
+
## Example
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
require 'late-sdk'
|
|
13
|
+
|
|
14
|
+
instance = Late::CreateWhatsAppTemplateRequestLibraryTemplateButtonInputsInnerUrl.new(
|
|
15
|
+
base_url: null
|
|
16
|
+
)
|
|
17
|
+
```
|
|
18
|
+
|
data/docs/WhatsAppApi.md
CHANGED
|
@@ -457,7 +457,7 @@ end
|
|
|
457
457
|
|
|
458
458
|
Create template
|
|
459
459
|
|
|
460
|
-
Create a new message template.
|
|
460
|
+
Create a new message template. Supports two modes: **Custom template:** Provide `components` with your own content. Submitted to Meta for review (can take up to 24h). **Library template:** Provide `library_template_name` instead of `components` to use a pre-built template from Meta's template library. Library templates are **pre-approved** (no review wait). You can optionally customize parameters and buttons via `library_template_body_inputs` and `library_template_button_inputs`. Browse available library templates at: https://business.facebook.com/wa/manage/message-templates/
|
|
461
461
|
|
|
462
462
|
### Examples
|
|
463
463
|
|
|
@@ -471,7 +471,7 @@ Late.configure do |config|
|
|
|
471
471
|
end
|
|
472
472
|
|
|
473
473
|
api_instance = Late::WhatsAppApi.new
|
|
474
|
-
create_whats_app_template_request = Late::CreateWhatsAppTemplateRequest.new({account_id: 'account_id_example', name: 'name_example', category: 'AUTHENTICATION', language: 'language_example'
|
|
474
|
+
create_whats_app_template_request = Late::CreateWhatsAppTemplateRequest.new({account_id: 'account_id_example', name: 'name_example', category: 'AUTHENTICATION', language: 'language_example'}) # CreateWhatsAppTemplateRequest |
|
|
475
475
|
|
|
476
476
|
begin
|
|
477
477
|
# Create template
|
|
@@ -151,6 +151,74 @@ module Late
|
|
|
151
151
|
return data, status_code, headers
|
|
152
152
|
end
|
|
153
153
|
|
|
154
|
+
# Connect WhatsApp via credentials
|
|
155
|
+
# Connect a WhatsApp Business Account by providing Meta credentials directly. This is the headless alternative to the Embedded Signup browser flow. To get the required credentials: 1. Go to Meta Business Suite (business.facebook.com) 2. Create or select a WhatsApp Business Account 3. In Business Settings > System Users, create a System User 4. Assign it the `whatsapp_business_management` and `whatsapp_business_messaging` permissions 5. Generate a permanent access token 6. Get the WABA ID from WhatsApp Manager > Account Tools > Phone Numbers 7. Get the Phone Number ID from the same page (click on the number)
|
|
156
|
+
# @param connect_whats_app_credentials_request [ConnectWhatsAppCredentialsRequest]
|
|
157
|
+
# @param [Hash] opts the optional parameters
|
|
158
|
+
# @return [ConnectWhatsAppCredentials200Response]
|
|
159
|
+
def connect_whats_app_credentials(connect_whats_app_credentials_request, opts = {})
|
|
160
|
+
data, _status_code, _headers = connect_whats_app_credentials_with_http_info(connect_whats_app_credentials_request, opts)
|
|
161
|
+
data
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Connect WhatsApp via credentials
|
|
165
|
+
# Connect a WhatsApp Business Account by providing Meta credentials directly. This is the headless alternative to the Embedded Signup browser flow. To get the required credentials: 1. Go to Meta Business Suite (business.facebook.com) 2. Create or select a WhatsApp Business Account 3. In Business Settings > System Users, create a System User 4. Assign it the `whatsapp_business_management` and `whatsapp_business_messaging` permissions 5. Generate a permanent access token 6. Get the WABA ID from WhatsApp Manager > Account Tools > Phone Numbers 7. Get the Phone Number ID from the same page (click on the number)
|
|
166
|
+
# @param connect_whats_app_credentials_request [ConnectWhatsAppCredentialsRequest]
|
|
167
|
+
# @param [Hash] opts the optional parameters
|
|
168
|
+
# @return [Array<(ConnectWhatsAppCredentials200Response, Integer, Hash)>] ConnectWhatsAppCredentials200Response data, response status code and response headers
|
|
169
|
+
def connect_whats_app_credentials_with_http_info(connect_whats_app_credentials_request, opts = {})
|
|
170
|
+
if @api_client.config.debugging
|
|
171
|
+
@api_client.config.logger.debug 'Calling API: ConnectApi.connect_whats_app_credentials ...'
|
|
172
|
+
end
|
|
173
|
+
# verify the required parameter 'connect_whats_app_credentials_request' is set
|
|
174
|
+
if @api_client.config.client_side_validation && connect_whats_app_credentials_request.nil?
|
|
175
|
+
fail ArgumentError, "Missing the required parameter 'connect_whats_app_credentials_request' when calling ConnectApi.connect_whats_app_credentials"
|
|
176
|
+
end
|
|
177
|
+
# resource path
|
|
178
|
+
local_var_path = '/v1/connect/whatsapp/credentials'
|
|
179
|
+
|
|
180
|
+
# query parameters
|
|
181
|
+
query_params = opts[:query_params] || {}
|
|
182
|
+
|
|
183
|
+
# header parameters
|
|
184
|
+
header_params = opts[:header_params] || {}
|
|
185
|
+
# HTTP header 'Accept' (if needed)
|
|
186
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
187
|
+
# HTTP header 'Content-Type'
|
|
188
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
189
|
+
if !content_type.nil?
|
|
190
|
+
header_params['Content-Type'] = content_type
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# form parameters
|
|
194
|
+
form_params = opts[:form_params] || {}
|
|
195
|
+
|
|
196
|
+
# http body (model)
|
|
197
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(connect_whats_app_credentials_request)
|
|
198
|
+
|
|
199
|
+
# return_type
|
|
200
|
+
return_type = opts[:debug_return_type] || 'ConnectWhatsAppCredentials200Response'
|
|
201
|
+
|
|
202
|
+
# auth_names
|
|
203
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
204
|
+
|
|
205
|
+
new_options = opts.merge(
|
|
206
|
+
:operation => :"ConnectApi.connect_whats_app_credentials",
|
|
207
|
+
:header_params => header_params,
|
|
208
|
+
:query_params => query_params,
|
|
209
|
+
:form_params => form_params,
|
|
210
|
+
:body => post_body,
|
|
211
|
+
:auth_names => auth_names,
|
|
212
|
+
:return_type => return_type
|
|
213
|
+
)
|
|
214
|
+
|
|
215
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
216
|
+
if @api_client.config.debugging
|
|
217
|
+
@api_client.config.logger.debug "API called: ConnectApi#connect_whats_app_credentials\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
218
|
+
end
|
|
219
|
+
return data, status_code, headers
|
|
220
|
+
end
|
|
221
|
+
|
|
154
222
|
# Get OAuth connect URL
|
|
155
223
|
# Initiate an OAuth connection flow. Returns an authUrl to redirect the user to. Standard flow: Late hosts the selection UI, then redirects to your redirect_url. Headless mode (headless=true): user is redirected to your redirect_url with OAuth data for custom UI. Use the platform-specific selection endpoints to complete.
|
|
156
224
|
# @param platform [String] Social media platform to connect
|
|
@@ -429,7 +429,7 @@ module Late
|
|
|
429
429
|
end
|
|
430
430
|
|
|
431
431
|
# Create template
|
|
432
|
-
# Create a new message template.
|
|
432
|
+
# Create a new message template. Supports two modes: **Custom template:** Provide `components` with your own content. Submitted to Meta for review (can take up to 24h). **Library template:** Provide `library_template_name` instead of `components` to use a pre-built template from Meta's template library. Library templates are **pre-approved** (no review wait). You can optionally customize parameters and buttons via `library_template_body_inputs` and `library_template_button_inputs`. Browse available library templates at: https://business.facebook.com/wa/manage/message-templates/
|
|
433
433
|
# @param create_whats_app_template_request [CreateWhatsAppTemplateRequest]
|
|
434
434
|
# @param [Hash] opts the optional parameters
|
|
435
435
|
# @return [CreateWhatsAppTemplate200Response]
|
|
@@ -439,7 +439,7 @@ module Late
|
|
|
439
439
|
end
|
|
440
440
|
|
|
441
441
|
# Create template
|
|
442
|
-
# Create a new message template.
|
|
442
|
+
# Create a new message template. Supports two modes: **Custom template:** Provide `components` with your own content. Submitted to Meta for review (can take up to 24h). **Library template:** Provide `library_template_name` instead of `components` to use a pre-built template from Meta's template library. Library templates are **pre-approved** (no review wait). You can optionally customize parameters and buttons via `library_template_body_inputs` and `library_template_button_inputs`. Browse available library templates at: https://business.facebook.com/wa/manage/message-templates/
|
|
443
443
|
# @param create_whats_app_template_request [CreateWhatsAppTemplateRequest]
|
|
444
444
|
# @param [Hash] opts the optional parameters
|
|
445
445
|
# @return [Array<(CreateWhatsAppTemplate200Response, Integer, Hash)>] CreateWhatsAppTemplate200Response data, response status code and response headers
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Late API
|
|
3
|
+
|
|
4
|
+
#API reference for Late. Authenticate with a Bearer API key. Base URL: https://getlate.dev/api
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.1
|
|
7
|
+
Contact: support@getlate.dev
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Late
|
|
17
|
+
class ConnectWhatsAppCredentials200Response < ApiModelBase
|
|
18
|
+
attr_accessor :message
|
|
19
|
+
|
|
20
|
+
attr_accessor :account
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'message' => :'message',
|
|
26
|
+
:'account' => :'account'
|
|
27
|
+
}
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Returns attribute mapping this model knows about
|
|
31
|
+
def self.acceptable_attribute_map
|
|
32
|
+
attribute_map
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Returns all the JSON keys this model knows about
|
|
36
|
+
def self.acceptable_attributes
|
|
37
|
+
acceptable_attribute_map.values
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Attribute type mapping.
|
|
41
|
+
def self.openapi_types
|
|
42
|
+
{
|
|
43
|
+
:'message' => :'String',
|
|
44
|
+
:'account' => :'ConnectWhatsAppCredentials200ResponseAccount'
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# List of attributes with nullable: true
|
|
49
|
+
def self.openapi_nullable
|
|
50
|
+
Set.new([
|
|
51
|
+
])
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Initializes the object
|
|
55
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
56
|
+
def initialize(attributes = {})
|
|
57
|
+
if (!attributes.is_a?(Hash))
|
|
58
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Late::ConnectWhatsAppCredentials200Response` initialize method"
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
62
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
63
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
64
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
65
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Late::ConnectWhatsAppCredentials200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
66
|
+
end
|
|
67
|
+
h[k.to_sym] = v
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if attributes.key?(:'message')
|
|
71
|
+
self.message = attributes[:'message']
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
if attributes.key?(:'account')
|
|
75
|
+
self.account = attributes[:'account']
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
80
|
+
# @return Array for valid properties with the reasons
|
|
81
|
+
def list_invalid_properties
|
|
82
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
83
|
+
invalid_properties = Array.new
|
|
84
|
+
invalid_properties
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Check to see if the all the properties in the model are valid
|
|
88
|
+
# @return true if the model is valid
|
|
89
|
+
def valid?
|
|
90
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
91
|
+
true
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Checks equality by comparing each attribute.
|
|
95
|
+
# @param [Object] Object to be compared
|
|
96
|
+
def ==(o)
|
|
97
|
+
return true if self.equal?(o)
|
|
98
|
+
self.class == o.class &&
|
|
99
|
+
message == o.message &&
|
|
100
|
+
account == o.account
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# @see the `==` method
|
|
104
|
+
# @param [Object] Object to be compared
|
|
105
|
+
def eql?(o)
|
|
106
|
+
self == o
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Calculates hash code according to all attributes.
|
|
110
|
+
# @return [Integer] Hash code
|
|
111
|
+
def hash
|
|
112
|
+
[message, account].hash
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Builds the object from hash
|
|
116
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
117
|
+
# @return [Object] Returns the model itself
|
|
118
|
+
def self.build_from_hash(attributes)
|
|
119
|
+
return nil unless attributes.is_a?(Hash)
|
|
120
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
121
|
+
transformed_hash = {}
|
|
122
|
+
openapi_types.each_pair do |key, type|
|
|
123
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
124
|
+
transformed_hash["#{key}"] = nil
|
|
125
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
126
|
+
# check to ensure the input is an array given that the attribute
|
|
127
|
+
# is documented as an array but the input is not
|
|
128
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
129
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
130
|
+
end
|
|
131
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
132
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
new(transformed_hash)
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Returns the object in the form of hash
|
|
139
|
+
# @return [Hash] Returns the object in the form of hash
|
|
140
|
+
def to_hash
|
|
141
|
+
hash = {}
|
|
142
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
143
|
+
value = self.send(attr)
|
|
144
|
+
if value.nil?
|
|
145
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
146
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
hash[param] = _to_hash(value)
|
|
150
|
+
end
|
|
151
|
+
hash
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
end
|