late-sdk 0.0.46 → 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
data/lib/late-sdk/models/create_whats_app_template_request_library_template_button_inputs_inner.rb
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
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 CreateWhatsAppTemplateRequestLibraryTemplateButtonInputsInner < ApiModelBase
|
|
18
|
+
attr_accessor :type
|
|
19
|
+
|
|
20
|
+
attr_accessor :url
|
|
21
|
+
|
|
22
|
+
attr_accessor :phone_number
|
|
23
|
+
|
|
24
|
+
class EnumAttributeValidator
|
|
25
|
+
attr_reader :datatype
|
|
26
|
+
attr_reader :allowable_values
|
|
27
|
+
|
|
28
|
+
def initialize(datatype, allowable_values)
|
|
29
|
+
@allowable_values = allowable_values.map do |value|
|
|
30
|
+
case datatype.to_s
|
|
31
|
+
when /Integer/i
|
|
32
|
+
value.to_i
|
|
33
|
+
when /Float/i
|
|
34
|
+
value.to_f
|
|
35
|
+
else
|
|
36
|
+
value
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def valid?(value)
|
|
42
|
+
!value || allowable_values.include?(value)
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
47
|
+
def self.attribute_map
|
|
48
|
+
{
|
|
49
|
+
:'type' => :'type',
|
|
50
|
+
:'url' => :'url',
|
|
51
|
+
:'phone_number' => :'phone_number'
|
|
52
|
+
}
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Returns attribute mapping this model knows about
|
|
56
|
+
def self.acceptable_attribute_map
|
|
57
|
+
attribute_map
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Returns all the JSON keys this model knows about
|
|
61
|
+
def self.acceptable_attributes
|
|
62
|
+
acceptable_attribute_map.values
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Attribute type mapping.
|
|
66
|
+
def self.openapi_types
|
|
67
|
+
{
|
|
68
|
+
:'type' => :'String',
|
|
69
|
+
:'url' => :'CreateWhatsAppTemplateRequestLibraryTemplateButtonInputsInnerUrl',
|
|
70
|
+
:'phone_number' => :'String'
|
|
71
|
+
}
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# List of attributes with nullable: true
|
|
75
|
+
def self.openapi_nullable
|
|
76
|
+
Set.new([
|
|
77
|
+
])
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Initializes the object
|
|
81
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
82
|
+
def initialize(attributes = {})
|
|
83
|
+
if (!attributes.is_a?(Hash))
|
|
84
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Late::CreateWhatsAppTemplateRequestLibraryTemplateButtonInputsInner` initialize method"
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
88
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
89
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
90
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
91
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Late::CreateWhatsAppTemplateRequestLibraryTemplateButtonInputsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
92
|
+
end
|
|
93
|
+
h[k.to_sym] = v
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if attributes.key?(:'type')
|
|
97
|
+
self.type = attributes[:'type']
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
if attributes.key?(:'url')
|
|
101
|
+
self.url = attributes[:'url']
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if attributes.key?(:'phone_number')
|
|
105
|
+
self.phone_number = attributes[:'phone_number']
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
110
|
+
# @return Array for valid properties with the reasons
|
|
111
|
+
def list_invalid_properties
|
|
112
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
113
|
+
invalid_properties = Array.new
|
|
114
|
+
invalid_properties
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Check to see if the all the properties in the model are valid
|
|
118
|
+
# @return true if the model is valid
|
|
119
|
+
def valid?
|
|
120
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
121
|
+
type_validator = EnumAttributeValidator.new('String', ["QUICK_REPLY", "URL", "PHONE_NUMBER"])
|
|
122
|
+
return false unless type_validator.valid?(@type)
|
|
123
|
+
true
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
127
|
+
# @param [Object] type Object to be assigned
|
|
128
|
+
def type=(type)
|
|
129
|
+
validator = EnumAttributeValidator.new('String', ["QUICK_REPLY", "URL", "PHONE_NUMBER"])
|
|
130
|
+
unless validator.valid?(type)
|
|
131
|
+
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
|
132
|
+
end
|
|
133
|
+
@type = type
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Checks equality by comparing each attribute.
|
|
137
|
+
# @param [Object] Object to be compared
|
|
138
|
+
def ==(o)
|
|
139
|
+
return true if self.equal?(o)
|
|
140
|
+
self.class == o.class &&
|
|
141
|
+
type == o.type &&
|
|
142
|
+
url == o.url &&
|
|
143
|
+
phone_number == o.phone_number
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# @see the `==` method
|
|
147
|
+
# @param [Object] Object to be compared
|
|
148
|
+
def eql?(o)
|
|
149
|
+
self == o
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Calculates hash code according to all attributes.
|
|
153
|
+
# @return [Integer] Hash code
|
|
154
|
+
def hash
|
|
155
|
+
[type, url, phone_number].hash
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Builds the object from hash
|
|
159
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
160
|
+
# @return [Object] Returns the model itself
|
|
161
|
+
def self.build_from_hash(attributes)
|
|
162
|
+
return nil unless attributes.is_a?(Hash)
|
|
163
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
164
|
+
transformed_hash = {}
|
|
165
|
+
openapi_types.each_pair do |key, type|
|
|
166
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
167
|
+
transformed_hash["#{key}"] = nil
|
|
168
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
169
|
+
# check to ensure the input is an array given that the attribute
|
|
170
|
+
# is documented as an array but the input is not
|
|
171
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
172
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
173
|
+
end
|
|
174
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
175
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
new(transformed_hash)
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Returns the object in the form of hash
|
|
182
|
+
# @return [Hash] Returns the object in the form of hash
|
|
183
|
+
def to_hash
|
|
184
|
+
hash = {}
|
|
185
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
186
|
+
value = self.send(attr)
|
|
187
|
+
if value.nil?
|
|
188
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
189
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
hash[param] = _to_hash(value)
|
|
193
|
+
end
|
|
194
|
+
hash
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
end
|
|
@@ -0,0 +1,147 @@
|
|
|
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 CreateWhatsAppTemplateRequestLibraryTemplateButtonInputsInnerUrl < ApiModelBase
|
|
18
|
+
attr_accessor :base_url
|
|
19
|
+
|
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
|
+
def self.attribute_map
|
|
22
|
+
{
|
|
23
|
+
:'base_url' => :'base_url'
|
|
24
|
+
}
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Returns attribute mapping this model knows about
|
|
28
|
+
def self.acceptable_attribute_map
|
|
29
|
+
attribute_map
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Returns all the JSON keys this model knows about
|
|
33
|
+
def self.acceptable_attributes
|
|
34
|
+
acceptable_attribute_map.values
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Attribute type mapping.
|
|
38
|
+
def self.openapi_types
|
|
39
|
+
{
|
|
40
|
+
:'base_url' => :'String'
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# List of attributes with nullable: true
|
|
45
|
+
def self.openapi_nullable
|
|
46
|
+
Set.new([
|
|
47
|
+
])
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Initializes the object
|
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
52
|
+
def initialize(attributes = {})
|
|
53
|
+
if (!attributes.is_a?(Hash))
|
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Late::CreateWhatsAppTemplateRequestLibraryTemplateButtonInputsInnerUrl` initialize method"
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
58
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
60
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Late::CreateWhatsAppTemplateRequestLibraryTemplateButtonInputsInnerUrl`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
62
|
+
end
|
|
63
|
+
h[k.to_sym] = v
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if attributes.key?(:'base_url')
|
|
67
|
+
self.base_url = attributes[:'base_url']
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
72
|
+
# @return Array for valid properties with the reasons
|
|
73
|
+
def list_invalid_properties
|
|
74
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
75
|
+
invalid_properties = Array.new
|
|
76
|
+
invalid_properties
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Check to see if the all the properties in the model are valid
|
|
80
|
+
# @return true if the model is valid
|
|
81
|
+
def valid?
|
|
82
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
83
|
+
true
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Checks equality by comparing each attribute.
|
|
87
|
+
# @param [Object] Object to be compared
|
|
88
|
+
def ==(o)
|
|
89
|
+
return true if self.equal?(o)
|
|
90
|
+
self.class == o.class &&
|
|
91
|
+
base_url == o.base_url
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# @see the `==` method
|
|
95
|
+
# @param [Object] Object to be compared
|
|
96
|
+
def eql?(o)
|
|
97
|
+
self == o
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Calculates hash code according to all attributes.
|
|
101
|
+
# @return [Integer] Hash code
|
|
102
|
+
def hash
|
|
103
|
+
[base_url].hash
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Builds the object from hash
|
|
107
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
108
|
+
# @return [Object] Returns the model itself
|
|
109
|
+
def self.build_from_hash(attributes)
|
|
110
|
+
return nil unless attributes.is_a?(Hash)
|
|
111
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
112
|
+
transformed_hash = {}
|
|
113
|
+
openapi_types.each_pair do |key, type|
|
|
114
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
115
|
+
transformed_hash["#{key}"] = nil
|
|
116
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
117
|
+
# check to ensure the input is an array given that the attribute
|
|
118
|
+
# is documented as an array but the input is not
|
|
119
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
120
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
121
|
+
end
|
|
122
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
123
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
new(transformed_hash)
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Returns the object in the form of hash
|
|
130
|
+
# @return [Hash] Returns the object in the form of hash
|
|
131
|
+
def to_hash
|
|
132
|
+
hash = {}
|
|
133
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
134
|
+
value = self.send(attr)
|
|
135
|
+
if value.nil?
|
|
136
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
137
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
hash[param] = _to_hash(value)
|
|
141
|
+
end
|
|
142
|
+
hash
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
end
|
data/lib/late-sdk/version.rb
CHANGED
data/lib/late-sdk.rb
CHANGED
|
@@ -48,6 +48,9 @@ require 'late-sdk/models/check_instagram_hashtags_request'
|
|
|
48
48
|
require 'late-sdk/models/complete_telegram_connect200_response'
|
|
49
49
|
require 'late-sdk/models/connect_bluesky_credentials200_response'
|
|
50
50
|
require 'late-sdk/models/connect_bluesky_credentials_request'
|
|
51
|
+
require 'late-sdk/models/connect_whats_app_credentials200_response'
|
|
52
|
+
require 'late-sdk/models/connect_whats_app_credentials200_response_account'
|
|
53
|
+
require 'late-sdk/models/connect_whats_app_credentials_request'
|
|
51
54
|
require 'late-sdk/models/connected'
|
|
52
55
|
require 'late-sdk/models/connected_account'
|
|
53
56
|
require 'late-sdk/models/connection_log'
|
|
@@ -85,6 +88,8 @@ require 'late-sdk/models/create_whats_app_contact_request'
|
|
|
85
88
|
require 'late-sdk/models/create_whats_app_template200_response'
|
|
86
89
|
require 'late-sdk/models/create_whats_app_template200_response_template'
|
|
87
90
|
require 'late-sdk/models/create_whats_app_template_request'
|
|
91
|
+
require 'late-sdk/models/create_whats_app_template_request_library_template_button_inputs_inner'
|
|
92
|
+
require 'late-sdk/models/create_whats_app_template_request_library_template_button_inputs_inner_url'
|
|
88
93
|
require 'late-sdk/models/delete_account_group200_response'
|
|
89
94
|
require 'late-sdk/models/delete_google_business_media200_response'
|
|
90
95
|
require 'late-sdk/models/delete_google_business_place_action200_response'
|
data/openapi.yaml
CHANGED
|
@@ -7628,6 +7628,91 @@ paths:
|
|
|
7628
7628
|
'401': { $ref: '#/components/responses/Unauthorized' }
|
|
7629
7629
|
'500': { description: Internal error }
|
|
7630
7630
|
|
|
7631
|
+
/v1/connect/whatsapp/credentials:
|
|
7632
|
+
post:
|
|
7633
|
+
operationId: connectWhatsAppCredentials
|
|
7634
|
+
tags: [Connect]
|
|
7635
|
+
summary: Connect WhatsApp via credentials
|
|
7636
|
+
description: |
|
|
7637
|
+
Connect a WhatsApp Business Account by providing Meta credentials directly.
|
|
7638
|
+
This is the headless alternative to the Embedded Signup browser flow.
|
|
7639
|
+
|
|
7640
|
+
To get the required credentials:
|
|
7641
|
+
1. Go to Meta Business Suite (business.facebook.com)
|
|
7642
|
+
2. Create or select a WhatsApp Business Account
|
|
7643
|
+
3. In Business Settings > System Users, create a System User
|
|
7644
|
+
4. Assign it the `whatsapp_business_management` and `whatsapp_business_messaging` permissions
|
|
7645
|
+
5. Generate a permanent access token
|
|
7646
|
+
6. Get the WABA ID from WhatsApp Manager > Account Tools > Phone Numbers
|
|
7647
|
+
7. Get the Phone Number ID from the same page (click on the number)
|
|
7648
|
+
security:
|
|
7649
|
+
- bearerAuth: []
|
|
7650
|
+
requestBody:
|
|
7651
|
+
required: true
|
|
7652
|
+
content:
|
|
7653
|
+
application/json:
|
|
7654
|
+
schema:
|
|
7655
|
+
type: object
|
|
7656
|
+
required: [profileId, accessToken, wabaId, phoneNumberId]
|
|
7657
|
+
properties:
|
|
7658
|
+
profileId:
|
|
7659
|
+
type: string
|
|
7660
|
+
description: Your Late profile ID
|
|
7661
|
+
accessToken:
|
|
7662
|
+
type: string
|
|
7663
|
+
description: Permanent System User access token from Meta Business Suite
|
|
7664
|
+
wabaId:
|
|
7665
|
+
type: string
|
|
7666
|
+
description: WhatsApp Business Account ID from Meta
|
|
7667
|
+
phoneNumberId:
|
|
7668
|
+
type: string
|
|
7669
|
+
description: Phone Number ID from Meta WhatsApp Manager
|
|
7670
|
+
example:
|
|
7671
|
+
profileId: "6507a1b2c3d4e5f6a7b8c9d0"
|
|
7672
|
+
accessToken: "EAABsbCS...your-system-user-token"
|
|
7673
|
+
wabaId: "123456789012345"
|
|
7674
|
+
phoneNumberId: "987654321098765"
|
|
7675
|
+
responses:
|
|
7676
|
+
'200':
|
|
7677
|
+
description: WhatsApp connected successfully
|
|
7678
|
+
content:
|
|
7679
|
+
application/json:
|
|
7680
|
+
schema:
|
|
7681
|
+
type: object
|
|
7682
|
+
properties:
|
|
7683
|
+
message: { type: string }
|
|
7684
|
+
account:
|
|
7685
|
+
type: object
|
|
7686
|
+
properties:
|
|
7687
|
+
accountId: { type: string }
|
|
7688
|
+
platform: { type: string, enum: [whatsapp] }
|
|
7689
|
+
username: { type: string, description: Display phone number }
|
|
7690
|
+
displayName: { type: string, description: Meta-verified business name }
|
|
7691
|
+
isActive: { type: boolean }
|
|
7692
|
+
phoneNumber: { type: string }
|
|
7693
|
+
verifiedName: { type: string }
|
|
7694
|
+
qualityRating: { type: string, description: "GREEN, YELLOW, or RED" }
|
|
7695
|
+
example:
|
|
7696
|
+
message: "WhatsApp connected successfully"
|
|
7697
|
+
account:
|
|
7698
|
+
accountId: "6507a1b2c3d4e5f6a7b8c9d0"
|
|
7699
|
+
platform: "whatsapp"
|
|
7700
|
+
username: "+1 555-123-4567"
|
|
7701
|
+
displayName: "Acme Corp"
|
|
7702
|
+
isActive: true
|
|
7703
|
+
phoneNumber: "+1 555-123-4567"
|
|
7704
|
+
verifiedName: "Acme Corp"
|
|
7705
|
+
qualityRating: "GREEN"
|
|
7706
|
+
'400':
|
|
7707
|
+
description: |
|
|
7708
|
+
Invalid request. Either missing fields or the phoneNumberId was not found
|
|
7709
|
+
in the specified WABA. If the phone was not found, the response includes
|
|
7710
|
+
`availablePhoneNumbers` to help identify the correct ID.
|
|
7711
|
+
'401':
|
|
7712
|
+
description: Invalid or expired access token
|
|
7713
|
+
'403':
|
|
7714
|
+
description: Profile limit exceeded for this plan
|
|
7715
|
+
|
|
7631
7716
|
/v1/connect/telegram:
|
|
7632
7717
|
get:
|
|
7633
7718
|
operationId: getTelegramConnectStatus
|
|
@@ -12136,8 +12221,15 @@ paths:
|
|
|
12136
12221
|
tags: [WhatsApp]
|
|
12137
12222
|
summary: Create template
|
|
12138
12223
|
description: |
|
|
12139
|
-
Create a new message template.
|
|
12140
|
-
|
|
12224
|
+
Create a new message template. Supports two modes:
|
|
12225
|
+
|
|
12226
|
+
**Custom template:** Provide `components` with your own content. Submitted to Meta for review (can take up to 24h).
|
|
12227
|
+
|
|
12228
|
+
**Library template:** Provide `library_template_name` instead of `components` to use a pre-built template
|
|
12229
|
+
from Meta's template library. Library templates are **pre-approved** (no review wait). You can optionally
|
|
12230
|
+
customize parameters and buttons via `library_template_body_inputs` and `library_template_button_inputs`.
|
|
12231
|
+
|
|
12232
|
+
Browse available library templates at: https://business.facebook.com/wa/manage/message-templates/
|
|
12141
12233
|
security:
|
|
12142
12234
|
- bearerAuth: []
|
|
12143
12235
|
requestBody:
|
|
@@ -12151,7 +12243,6 @@ paths:
|
|
|
12151
12243
|
- name
|
|
12152
12244
|
- category
|
|
12153
12245
|
- language
|
|
12154
|
-
- components
|
|
12155
12246
|
properties:
|
|
12156
12247
|
accountId:
|
|
12157
12248
|
type: string
|
|
@@ -12169,20 +12260,64 @@ paths:
|
|
|
12169
12260
|
description: Template language code (e.g., en_US)
|
|
12170
12261
|
components:
|
|
12171
12262
|
type: array
|
|
12172
|
-
description: Template components (header, body, footer, buttons)
|
|
12263
|
+
description: "Template components (header, body, footer, buttons). Required for custom templates, omit when using library_template_name."
|
|
12173
12264
|
items:
|
|
12174
12265
|
type: object
|
|
12175
|
-
|
|
12176
|
-
|
|
12177
|
-
|
|
12178
|
-
|
|
12179
|
-
|
|
12180
|
-
|
|
12181
|
-
|
|
12182
|
-
|
|
12266
|
+
library_template_name:
|
|
12267
|
+
type: string
|
|
12268
|
+
description: |
|
|
12269
|
+
Name of a pre-built template from Meta's template library (e.g., "appointment_reminder",
|
|
12270
|
+
"auto_pay_reminder_1", "address_update"). When provided, the template is pre-approved
|
|
12271
|
+
by Meta with no review wait. Omit `components` when using this field.
|
|
12272
|
+
library_template_body_inputs:
|
|
12273
|
+
type: object
|
|
12274
|
+
description: |
|
|
12275
|
+
Optional body customizations for library templates. Available options depend on the
|
|
12276
|
+
template (e.g., add_contact_number, add_learn_more_link, add_security_recommendation,
|
|
12277
|
+
add_track_package_link, code_expiration_minutes).
|
|
12278
|
+
library_template_button_inputs:
|
|
12279
|
+
type: array
|
|
12280
|
+
description: |
|
|
12281
|
+
Optional button customizations for library templates. Each item specifies button type
|
|
12282
|
+
and configuration (e.g., URL, phone number, quick reply).
|
|
12283
|
+
items:
|
|
12284
|
+
type: object
|
|
12285
|
+
properties:
|
|
12286
|
+
type:
|
|
12287
|
+
type: string
|
|
12288
|
+
enum: [QUICK_REPLY, URL, PHONE_NUMBER]
|
|
12289
|
+
url:
|
|
12290
|
+
type: object
|
|
12291
|
+
properties:
|
|
12292
|
+
base_url: { type: string }
|
|
12293
|
+
phone_number:
|
|
12294
|
+
type: string
|
|
12295
|
+
examples:
|
|
12296
|
+
custom:
|
|
12297
|
+
summary: Custom template (requires review)
|
|
12298
|
+
value:
|
|
12299
|
+
accountId: "507f1f77bcf86cd799439011"
|
|
12300
|
+
name: "order_confirmation"
|
|
12301
|
+
category: "UTILITY"
|
|
12302
|
+
language: "en_US"
|
|
12303
|
+
components:
|
|
12304
|
+
- type: "body"
|
|
12305
|
+
text: "Your order {{1}} has been confirmed. Expected delivery: {{2}}"
|
|
12306
|
+
library:
|
|
12307
|
+
summary: Library template (pre-approved, no review)
|
|
12308
|
+
value:
|
|
12309
|
+
accountId: "507f1f77bcf86cd799439011"
|
|
12310
|
+
name: "my_appointment_reminder"
|
|
12311
|
+
category: "UTILITY"
|
|
12312
|
+
language: "en_US"
|
|
12313
|
+
library_template_name: "appointment_reminder"
|
|
12314
|
+
library_template_button_inputs:
|
|
12315
|
+
- type: "URL"
|
|
12316
|
+
url:
|
|
12317
|
+
base_url: "https://myapp.com/appointments/{{1}}"
|
|
12183
12318
|
responses:
|
|
12184
12319
|
'200':
|
|
12185
|
-
description: Template created
|
|
12320
|
+
description: Template created (pre-approved for library templates, pending review for custom)
|
|
12186
12321
|
content:
|
|
12187
12322
|
application/json:
|
|
12188
12323
|
schema:
|
|
@@ -12194,7 +12329,7 @@ paths:
|
|
|
12194
12329
|
properties:
|
|
12195
12330
|
id: { type: string }
|
|
12196
12331
|
name: { type: string }
|
|
12197
|
-
status: { type: string }
|
|
12332
|
+
status: { type: string, description: "APPROVED for library templates, PENDING for custom" }
|
|
12198
12333
|
category: { type: string }
|
|
12199
12334
|
language: { type: string }
|
|
12200
12335
|
'400': { description: Validation error (invalid name format, missing fields, invalid category) }
|
|
@@ -56,6 +56,18 @@ describe 'ConnectApi' do
|
|
|
56
56
|
end
|
|
57
57
|
end
|
|
58
58
|
|
|
59
|
+
# unit tests for connect_whats_app_credentials
|
|
60
|
+
# Connect WhatsApp via credentials
|
|
61
|
+
# 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)
|
|
62
|
+
# @param connect_whats_app_credentials_request
|
|
63
|
+
# @param [Hash] opts the optional parameters
|
|
64
|
+
# @return [ConnectWhatsAppCredentials200Response]
|
|
65
|
+
describe 'connect_whats_app_credentials test' do
|
|
66
|
+
it 'should work' do
|
|
67
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
59
71
|
# unit tests for get_connect_url
|
|
60
72
|
# Get OAuth connect URL
|
|
61
73
|
# 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.
|
|
@@ -107,7 +107,7 @@ describe 'WhatsAppApi' do
|
|
|
107
107
|
|
|
108
108
|
# unit tests for create_whats_app_template
|
|
109
109
|
# Create template
|
|
110
|
-
# Create a new message template.
|
|
110
|
+
# 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/
|
|
111
111
|
# @param create_whats_app_template_request
|
|
112
112
|
# @param [Hash] opts the optional parameters
|
|
113
113
|
# @return [CreateWhatsAppTemplate200Response]
|