@@ -107,14 +107,14 @@ def revoke_channel_token(access_token)
107
107
# @param user_id [String] User Id
108
108
# @param messages [Hash or Array] Message Objects
109
109
# @return [Net::HTTPResponse]
110
- def push_message ( user_id , messages )
110
+ def push_message ( user_id , messages , headers = { } )
111
111
channel_token_required
112
112
113
113
messages = [ messages ] if messages . is_a? ( Hash )
114
114
115
115
endpoint_path = '/bot/message/push'
116
116
payload = { to : user_id , messages : messages } . to_json
117
- post ( endpoint , endpoint_path , payload , credentials )
117
+ post ( endpoint , endpoint_path , payload , headers . merge ( credentials ) )
118
118
end
119
119
120
120
# Reply messages to a user using replyToken.
@@ -152,29 +152,29 @@ def reply_message(token, messages)
152
152
# @param to [Array or String] Array of userIds
153
153
# @param messages [Hash or Array] Message Objects
154
154
# @return [Net::HTTPResponse]
155
- def multicast ( to , messages )
155
+ def multicast ( to , messages , headers = { } )
156
156
channel_token_required
157
157
158
158
to = [ to ] if to . is_a? ( String )
159
159
messages = [ messages ] if messages . is_a? ( Hash )
160
160
161
161
endpoint_path = '/bot/message/multicast'
162
162
payload = { to : to , messages : messages } . to_json
163
- post ( endpoint , endpoint_path , payload , credentials )
163
+ post ( endpoint , endpoint_path , payload , headers . merge ( credentials ) )
164
164
end
165
165
166
166
# Send messages to all friends.
167
167
#
168
168
# @param messages [Hash or Array] Message Objects
169
169
# @return [Net::HTTPResponse]
170
- def broadcast ( messages )
170
+ def broadcast ( messages , headers = { } )
171
171
channel_token_required
172
172
173
173
messages = [ messages ] if messages . is_a? ( Hash )
174
174
175
175
endpoint_path = '/bot/message/broadcast'
176
176
payload = { messages : messages } . to_json
177
- post ( endpoint , endpoint_path , payload , credentials )
177
+ post ( endpoint , endpoint_path , payload , headers . merge ( credentials ) )
178
178
end
179
179
180
180
# Narrowcast messages to users
@@ -188,7 +188,7 @@ def broadcast(messages)
188
188
# @param limit [Hash]
189
189
#
190
190
# @return [Net::HTTPResponse]
191
- def narrowcast ( messages , recipient : nil , filter : nil , limit : nil )
191
+ def narrowcast ( messages , recipient : nil , filter : nil , limit : nil , headers : { } )
192
192
channel_token_required
193
193
194
194
messages = [ messages ] if messages . is_a? ( Hash )
@@ -200,7 +200,7 @@ def narrowcast(messages, recipient: nil, filter: nil, limit: nil)
200
200
filter : filter ,
201
201
limit : limit
202
202
} . to_json
203
- post ( endpoint , endpoint_path , payload , credentials )
203
+ post ( endpoint , endpoint_path , payload , headers . merge ( credentials ) )
204
204
end
205
205
206
206
def leave_group ( group_id )
0 commit comments