Class: Line::Bot::Client Deprecated

Inherits:
Object
  • Object
show all
Defined in:
lib/line/bot/v1/client.rb

Overview

Deprecated.

This is deprecated. Please use one of the following instead:

API Client of LINE Bot SDK Ruby (deprecated)

@client ||= Line::Bot::Client.new do |config|
  config.channel_id = ENV["LINE_CHANNEL_ID"]
  config.channel_secret = ENV["LINE_CHANNEL_SECRET"]
  config.channel_token = ENV["LINE_CHANNEL_TOKEN"]
end

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) {|_self| ... } ⇒ Line::Bot::Client

Parameters:

  • options (Hash) (defaults to: {})

Yields:

  • (_self)

Yield Parameters:



62
63
64
65
66
67
# File 'lib/line/bot/v1/client.rb', line 62

def initialize(options = {})
  options.each do |key, value|
    instance_variable_set("@#{key}", value)
  end
  yield(self) if block_given?
end

Instance Attribute Details

#blob_endpointObject

@return [String]



40
41
42
# File 'lib/line/bot/v1/client.rb', line 40

def blob_endpoint
  @blob_endpoint
end

#channel_idObject

@return [String]



40
41
42
# File 'lib/line/bot/v1/client.rb', line 40

def channel_id
  @channel_id
end

#channel_secretObject

@return [String]



40
41
42
# File 'lib/line/bot/v1/client.rb', line 40

def channel_secret
  @channel_secret
end

#channel_tokenObject

@return [String]



40
41
42
# File 'lib/line/bot/v1/client.rb', line 40

def channel_token
  @channel_token
end

#endpointObject

@return [String]



40
41
42
# File 'lib/line/bot/v1/client.rb', line 40

def endpoint
  @endpoint
end

#http_optionsHash

Returns:

  • (Hash)


46
47
48
# File 'lib/line/bot/v1/client.rb', line 46

def http_options
  @http_options
end

#httpclientObject

Returns:

  • (Object)


43
44
45
# File 'lib/line/bot/v1/client.rb', line 43

def httpclient
  @httpclient
end

Instance Method Details

#broadcast(messages, headers: {}) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#broadcast instead.

Send messages to all friends.

Parameters:

  • messages (Hash, Array)

    Message Objects

  • headers (Hash) (defaults to: {})

    HTTP Headers

Returns:

  • (Net::HTTPResponse)


370
371
372
373
374
375
376
377
378
379
380
# File 'lib/line/bot/v1/client.rb', line 370

def broadcast(messages, headers: {})
  warn '[DEPRECATION] `Line::Bot::Client#broadcast` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#broadcast` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  messages = [messages] if messages.is_a?(Hash)

  endpoint_path = '/bot/message/broadcast'
  payload = { messages: messages }.to_json
  post(endpoint, endpoint_path, payload, credentials.merge(headers))
end
Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#link_rich_menu_id_to_users instead.

To link a rich menu to multiple users at a time

Parameters:

  • user_ids (Array)

    ID of the user

  • rich_menu_id (String)

    ID of the uploaded rich menu

Returns:

  • (Net::HTTPResponse)


1099
1100
1101
1102
1103
1104
1105
1106
# File 'lib/line/bot/v1/client.rb', line 1099

def bulk_link_rich_menus(user_ids, rich_menu_id)
  warn '[DEPRECATION] `Line::Bot::Client#bulk_link_rich_menus` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#link_rich_menu_id_to_users` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/richmenu/bulk/link"
  post(endpoint, endpoint_path, { richMenuId: rich_menu_id, userIds: user_ids }.to_json, credentials)
end
Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#unlink_rich_menu_id_from_users instead.

To unlink a rich menu from multiple users at a time

Parameters:

  • user_ids (Array)

    ID of the user

Returns:

  • (Net::HTTPResponse)


1117
1118
1119
1120
1121
1122
1123
1124
# File 'lib/line/bot/v1/client.rb', line 1117

def bulk_unlink_rich_menus(user_ids)
  warn '[DEPRECATION] `Line::Bot::Client#bulk_unlink_rich_menus` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#unlink_rich_menu_id_from_users` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/richmenu/bulk/unlink"
  post(endpoint, endpoint_path, { userIds: user_ids }.to_json, credentials)
end

#create_click_audience(params) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::ManageAudience::ApiClient#create_click_based_audience_group instead.

Create an audience group of users that clicked a URL in a message sent in the past

Parameters are described here. developers.line.biz/en/reference/messaging-api/#create-click-audience-group

Parameters:

  • params (Hash)

    options

Returns:

  • (Net::HTTPResponse)

    This response includes an audience_group_id.



1464
1465
1466
1467
1468
1469
1470
1471
# File 'lib/line/bot/v1/client.rb', line 1464

def create_click_audience(params)
  warn '[DEPRECATION] `Line::Bot::Client#create_click_audience` is deprecated. Please use `Line::Bot::V2::ManageAudience::ApiClient#create_click_based_audience_group` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = '/bot/audienceGroup/click'
  post(endpoint, endpoint_path, params.to_json, credentials)
end

#create_impression_audience(params) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::ManageAudience::ApiClient#create_imp_based_audience_group instead.

Create an audience group of users that opened a message sent in the past

Parameters are described here. developers.line.biz/en/reference/messaging-api/#create-imp-audience-group

Parameters:

  • params (Hash)

    options

Returns:

  • (Net::HTTPResponse)

    This response includes an audience_group_id.



1485
1486
1487
1488
1489
1490
1491
1492
# File 'lib/line/bot/v1/client.rb', line 1485

def create_impression_audience(params)
  warn '[DEPRECATION] `Line::Bot::Client#create_impression_audience` is deprecated. Please use `Line::Bot::V2::ManageAudience::ApiClient#create_imp_based_audience_group` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = '/bot/audienceGroup/imp'
  post(endpoint, endpoint_path, params.to_json, credentials)
end

#create_liff_app(app) ⇒ Object

Deprecated.

This is deprecated. Please use V2::Liff::ApiClient#add_liff_app instead.



1375
1376
1377
1378
1379
1380
1381
1382
# File 'lib/line/bot/v1/client.rb', line 1375

def create_liff_app(app)
  warn '[DEPRECATION] `Line::Bot::Client#create_liff_app` is deprecated. Please use `Line::Bot::V2::Liff::ApiClient#add_liff_app` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = '/apps'
  post(liff_endpoint, endpoint_path, app.to_json, credentials)
end
Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#issue_link_token instead.

Issue a link token to a user

Parameters:

  • user_id (String)

    ID of the user

Returns:

  • (Net::HTTPResponse)


1173
1174
1175
1176
1177
1178
1179
1180
# File 'lib/line/bot/v1/client.rb', line 1173

def create_link_token(user_id)
  warn '[DEPRECATION] `Line::Bot::Client#create_link_token` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#issue_link_token` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/user/#{user_id}/linkToken"
  post(endpoint, endpoint_path, nil, credentials)
end

#create_rich_menu(rich_menu) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#create_rich_menu instead.

Create a rich menu

Parameters:

  • rich_menu (Hash)

    The rich menu represented as a rich menu object

Returns:

  • (Net::HTTPResponse)


846
847
848
849
850
851
852
853
# File 'lib/line/bot/v1/client.rb', line 846

def create_rich_menu(rich_menu)
  warn '[DEPRECATION] `Line::Bot::Client#create_rich_menu` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#create_rich_menu` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = '/bot/richmenu'
  post(endpoint, endpoint_path, rich_menu.to_json, credentials)
end

#create_rich_menu_image(rich_menu_id, file) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiBlobClient#set_rich_menu_image instead.

Upload and attaches an image to a rich menu

Parameters:

  • rich_menu_id (String)

    The ID of the rich menu to attach the image to

  • file (File)

    Image file to attach rich menu

Returns:

  • (Net::HTTPResponse)


1154
1155
1156
1157
1158
1159
1160
1161
1162
# File 'lib/line/bot/v1/client.rb', line 1154

def create_rich_menu_image(rich_menu_id, file)
  warn '[DEPRECATION] `Line::Bot::Client#create_rich_menu_image` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiBlobClient#set_rich_menu_image` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/richmenu/#{rich_menu_id}/content"
  headers = credentials.merge('Content-Type' => content_type(file))
  post(blob_endpoint, endpoint_path, file.rewind && file.read, headers)
end

#create_user_id_audience(params) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::ManageAudience::ApiClient#create_audience_group instead.

Create an audience group by uploading user_ids

Parameters are described here. developers.line.biz/en/reference/messaging-api/#create-upload-audience-group

Parameters:

  • params (Hash)

    options

Returns:

  • (Net::HTTPResponse)

    This response includes an audience_group_id.



1422
1423
1424
1425
1426
1427
1428
1429
# File 'lib/line/bot/v1/client.rb', line 1422

def create_user_id_audience(params)
  warn '[DEPRECATION] `Line::Bot::Client#create_user_id_audience` is deprecated. Please use `Line::Bot::V2::ManageAudience::ApiClient#create_audience_group` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = '/bot/audienceGroup/upload'
  post(endpoint, endpoint_path, params.to_json, credentials)
end

#credentialsHash

Returns:

  • (Hash)


97
98
99
100
101
# File 'lib/line/bot/v1/client.rb', line 97

def credentials
  {
    "Authorization" => "Bearer #{channel_token}",
  }
end

#delete(endpoint_base, endpoint_path, headers = {}) ⇒ Net::HTTPResponse

Deprecated.

This is obsolete. You may use V2::HttpClient#delete instead, but it is not recommended.

Delete content of specified URL.

Parameters:

  • endpoint_base (String)
  • endpoint_path (String)
  • headers (Hash) (defaults to: {})

Returns:

  • (Net::HTTPResponse)


1835
1836
1837
1838
# File 'lib/line/bot/v1/client.rb', line 1835

def delete(endpoint_base, endpoint_path, headers = {})
  headers = API::DEFAULT_HEADERS.merge(headers)
  httpclient.delete(endpoint_base + endpoint_path, headers)
end

#delete_audience(audience_group_id) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::ManageAudience::ApiClient#delete_audience_group instead.

Delete an existing audience group

Parameters are described here. developers.line.biz/en/reference/messaging-api/#delete-audience-group

Parameters:

  • audience_group_id (Integer)

Returns:

  • (Net::HTTPResponse)


1526
1527
1528
1529
1530
1531
1532
1533
# File 'lib/line/bot/v1/client.rb', line 1526

def delete_audience(audience_group_id)
  warn '[DEPRECATION] `Line::Bot::Client#delete_audience` is deprecated. Please use `Line::Bot::V2::ManageAudience::ApiClient#delete_audience_group` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/audienceGroup/#{audience_group_id}"
  delete(endpoint, endpoint_path, credentials)
end

#delete_liff_app(liff_id) ⇒ Object

Deprecated.

This is deprecated. Please use V2::Liff::ApiClient#delete_liff_app instead.



1401
1402
1403
1404
1405
1406
1407
1408
# File 'lib/line/bot/v1/client.rb', line 1401

def delete_liff_app(liff_id)
  warn '[DEPRECATION] `Line::Bot::Client#delete_liff_app` is deprecated. Please use `Line::Bot::V2::Liff::ApiClient#delete_liff_app` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/apps/#{liff_id}"
  delete(liff_endpoint, endpoint_path, credentials)
end

#delete_rich_menu(rich_menu_id) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#delete_rich_menu instead.

Delete a rich menu

Parameters:

  • rich_menu_id (String)

    ID of an uploaded rich menu

Returns:

  • (Net::HTTPResponse)


882
883
884
885
886
887
888
889
# File 'lib/line/bot/v1/client.rb', line 882

def delete_rich_menu(rich_menu_id)
  warn '[DEPRECATION] `Line::Bot::Client#delete_rich_menu` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#delete_rich_menu` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/richmenu/#{rich_menu_id}"
  delete(endpoint, endpoint_path, credentials)
end

#get(endpoint_base, endpoint_path, headers = {}) ⇒ Net::HTTPResponse

Deprecated.

This is obsolete. You may use V2::HttpClient#get instead, but it is not recommended.

Fetch data, get content of specified URL.

Parameters:

  • endpoint_base (String)
  • endpoint_path (String)
  • headers (Hash) (defaults to: {})

Returns:

  • (Net::HTTPResponse)


1785
1786
1787
1788
# File 'lib/line/bot/v1/client.rb', line 1785

def get(endpoint_base, endpoint_path, headers = {})
  headers = API::DEFAULT_HEADERS.merge(headers)
  httpclient.get(endpoint_base + endpoint_path, headers)
end

#get_aggregation_infoNet::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#get_aggregation_unit_usage instead.

Get the number of aggregation units used this month.

Returns:

  • (Net::HTTPResponse)


1644
1645
1646
1647
1648
1649
1650
1651
# File 'lib/line/bot/v1/client.rb', line 1644

def get_aggregation_info
  warn '[DEPRECATION] `Line::Bot::Client#get_aggregation_info` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_aggregation_unit_usage` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/message/aggregation/info"
  get(endpoint, endpoint_path, credentials)
end

#get_aggregation_list(limit: nil, start: nil) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#get_aggregation_unit_name_list instead.

Get the name list of units used this month for statistics aggregation.

Parameters:

  • limit (Integer) (defaults to: nil)

    Maximum number of aggregation units per request. Maximum: 100, Default: 100.

  • start (String) (defaults to: nil)

    Value of the continuation token found in the next property of the JSON object returned in the response.

Returns:

  • (Net::HTTPResponse)


1663
1664
1665
1666
1667
1668
1669
1670
1671
# File 'lib/line/bot/v1/client.rb', line 1663

def get_aggregation_list(limit: nil, start: nil)
  warn '[DEPRECATION] `Line::Bot::Client#get_aggregation_list` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_aggregation_unit_name_list` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  params = {limit: limit, start: start}.compact
  endpoint_path = "/bot/message/aggregation/list?" + URI.encode_www_form(params)
  get(endpoint, endpoint_path, credentials)
end

#get_audience(audience_group_id) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::ManageAudience::ApiClient#get_audience_data instead.

Get audience group data

Parameters are described here. developers.line.biz/en/reference/messaging-api/#get-audience-group

Parameters:

  • audience_group_id (Integer)

Returns:

  • (Net::HTTPResponse)


1547
1548
1549
1550
1551
1552
1553
1554
# File 'lib/line/bot/v1/client.rb', line 1547

def get_audience(audience_group_id)
  warn '[DEPRECATION] `Line::Bot::Client#get_audience` is deprecated. Please use `Line::Bot::V2::ManageAudience::ApiClient#get_audience_data` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/audienceGroup/#{audience_group_id}"
  get(endpoint, endpoint_path, credentials)
end

#get_audience_authority_levelNet::HTTPResponse

Deprecated.

This is obsolete.

Get the authority level of the audience

Parameters are described here. developers.line.biz/en/reference/messaging-api/#get-authority-level

Returns:

  • (Net::HTTPResponse)


1586
1587
1588
1589
1590
1591
1592
1593
# File 'lib/line/bot/v1/client.rb', line 1586

def get_audience_authority_level
  warn '[DEPRECATION] `Line::Bot::Client#get_audience_authority_level` is obsolete.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/audienceGroup/authorityLevel"
  get(endpoint, endpoint_path, credentials)
end

#get_audiences(params) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::ManageAudience::ApiClient#get_audience_groups instead.

Get data for more than one audience group

Parameters are described here. developers.line.biz/en/reference/messaging-api/#get-audience-groups

Parameters:

  • params (Hash)

    key name page is required

Returns:

  • (Net::HTTPResponse)


1568
1569
1570
1571
1572
1573
1574
1575
# File 'lib/line/bot/v1/client.rb', line 1568

def get_audiences(params)
  warn '[DEPRECATION] `Line::Bot::Client#get_audiences` is deprecated. Please use `Line::Bot::V2::ManageAudience::ApiClient#get_audience_groups` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/audienceGroup/list?" + URI.encode_www_form(params)
  get(endpoint, endpoint_path, credentials)
end

#get_bot_infoNet::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#get_bot_info instead.

Gets a bot’s basic information.

Returns:

  • (Net::HTTPResponse)


1291
1292
1293
1294
1295
1296
1297
1298
# File 'lib/line/bot/v1/client.rb', line 1291

def get_bot_info
  warn '[DEPRECATION] `Line::Bot::Client#get_bot_info` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_bot_info` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = '/bot/info'
  get(endpoint, endpoint_path, credentials)
end

#get_channel_access_token_key_ids_jwt(jwt) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::ChannelAccessToken::ApiClient#gets_all_valid_channel_access_token_key_ids instead.

Get all valid channel access token key IDs v2.1

Parameters:

  • jwt (String)

Returns:

  • (Net::HTTPResponse)


246
247
248
249
250
251
252
253
254
255
256
257
# File 'lib/line/bot/v1/client.rb', line 246

def get_channel_access_token_key_ids_jwt(jwt)
  warn '[DEPRECATION] `Line::Bot::Client#get_channel_access_token_key_ids_jwt` is deprecated. Please use `Line::Bot::V2::ChannelAccessToken::ApiClient#gets_all_valid_channel_access_token_key_ids` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  payload = URI.encode_www_form(
    client_assertion_type: 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer',
    client_assertion: jwt
  )
  endpoint_path = "/oauth2/v2.1/tokens/kid?#{payload}"

  headers = { 'Content-Type' => 'application/x-www-form-urlencoded' }
  get(oauth_endpoint, endpoint_path, headers)
end

#get_default_rich_menuNet::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#get_default_rich_menu_id instead.

Get default rich menu

Returns:

  • (Net::HTTPResponse)


916
917
918
919
920
921
922
923
# File 'lib/line/bot/v1/client.rb', line 916

def get_default_rich_menu
  warn '[DEPRECATION] `Line::Bot::Client#get_default_rich_menu` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_default_rich_menu_id` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = '/bot/user/all/richmenu'
  get(endpoint, endpoint_path, credentials)
end

#get_delivery_result_sent_by_phone_numbers(date) ⇒ Net::HTTPResponse

Deprecated.

This is obsolete.

Get the delivery result of the message delivered in Send message using phone number. (#multicast_by_phone_numbers)

Parameters:

  • date (String)

    Date the message was sent in UTC+9 with yyyyMMdd format.

Returns:

  • (Net::HTTPResponse)


1723
1724
1725
1726
1727
1728
1729
1730
# File 'lib/line/bot/v1/client.rb', line 1723

def get_delivery_result_sent_by_phone_numbers(date)
  warn '[DEPRECATION] `Line::Bot::Client#get_delivery_result_sent_by_phone_numbers` is obsolete.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/message/delivery/ad_phone?date=#{date}"
  get(endpoint, endpoint_path, credentials)
end

#get_follower_ids(deprecated_continuation_token = nil, start: nil, limit: nil) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#get_followers instead.

Get user IDs of who added your LINE Official Account as a friend

Parameters:

  • start (String) (defaults to: nil)

    Identifier to return next page (next property to be included in the response)

  • limit (Integer) (defaults to: nil)

    The maximum number of user IDs to retrieve in a single request

Returns:

  • (Net::HTTPResponse)


523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
# File 'lib/line/bot/v1/client.rb', line 523

def get_follower_ids(deprecated_continuation_token = nil, start: nil, limit: nil)
  warn '[DEPRECATION] `Line::Bot::Client#get_follower_ids` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_followers` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  if deprecated_continuation_token
    warn "continuation_token as the first argument is deprecated. Please use :start instead."
    start = deprecated_continuation_token
  end

  params = { start: start, limit: limit }.compact

  endpoint_path = "/bot/followers/ids"
  endpoint_path += "?" + URI.encode_www_form(params) unless params.empty?
  get(endpoint, endpoint_path, credentials)
end

#get_friend_demographicsNet::HTTPResponse

Deprecated.

This is deprecated. Please use V2::Insight::ApiClient#get_friends_demographics instead.

Get the demographic attributes for a bot’s friends.

Returns:

  • (Net::HTTPResponse)


1275
1276
1277
1278
1279
1280
1281
1282
# File 'lib/line/bot/v1/client.rb', line 1275

def get_friend_demographics
  warn '[DEPRECATION] `Line::Bot::Client#get_friend_demographics` is deprecated. Please use `Line::Bot::V2::Insight::ApiClient#get_friends_demographics` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = '/bot/insight/demographic'
  get(endpoint, endpoint_path, credentials)
end

#get_group_member_ids(group_id, continuation_token = nil) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#get_group_members_ids instead.

Get user IDs of a group

Parameters:

  • group_id (String)

    Group’s identifier

  • continuation_token (String) (defaults to: nil)

    Identifier to return next page (next property to be included in the response)

Returns:

  • (Net::HTTPResponse)


551
552
553
554
555
556
557
558
559
# File 'lib/line/bot/v1/client.rb', line 551

def get_group_member_ids(group_id, continuation_token = nil)
  warn '[DEPRECATION] `Line::Bot::Client#get_group_member_ids` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_group_members_ids` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/group/#{group_id}/members/ids"
  endpoint_path += "?start=#{continuation_token}" if continuation_token
  get(endpoint, endpoint_path, credentials)
end

#get_group_member_profile(group_id, user_id) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#get_group_member_profile instead.

Get an user’s profile of a group.

Parameters:

  • group_id (String)

    Group’s identifier

  • user_id (String)

    User Id user_id

Returns:

  • (Net::HTTPResponse)


485
486
487
488
489
490
491
492
# File 'lib/line/bot/v1/client.rb', line 485

def get_group_member_profile(group_id, user_id)
  warn '[DEPRECATION] `Line::Bot::Client#get_group_member_profile` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_group_member_profile` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/group/#{group_id}/member/#{user_id}"
  get(endpoint, endpoint_path, credentials)
end

#get_group_members_count(group_id) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#get_group_member_count instead.

Gets the user IDs of the members of a group that the bot is in.

Parameters:

  • group_id (String)

    Group’s identifier

Returns:

  • (Net::HTTPResponse)


609
610
611
612
613
614
615
616
# File 'lib/line/bot/v1/client.rb', line 609

def get_group_members_count(group_id)
  warn '[DEPRECATION] `Line::Bot::Client#get_group_members_count` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_group_member_count` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/group/#{group_id}/members/count"
  get(endpoint, endpoint_path, credentials)
end

#get_group_summary(group_id) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#get_group_summary instead.

Gets the group ID, group name, and group icon URL of a group where the LINE Official Account is a member.

Parameters:

  • group_id (String)

    Group’s identifier

Returns:

  • (Net::HTTPResponse)


591
592
593
594
595
596
597
598
# File 'lib/line/bot/v1/client.rb', line 591

def get_group_summary(group_id)
  warn '[DEPRECATION] `Line::Bot::Client#get_group_summary` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_group_summary` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/group/#{group_id}/summary"
  get(endpoint, endpoint_path, credentials)
end

#get_liff_appsObject

Deprecated.

This is deprecated. Please use V2::Liff::ApiClient#get_all_liff_apps instead.



1362
1363
1364
1365
1366
1367
1368
1369
# File 'lib/line/bot/v1/client.rb', line 1362

def get_liff_apps
  warn '[DEPRECATION] `Line::Bot::Client#get_liff_apps` is deprecated. Please use `Line::Bot::V2::Liff::ApiClient#get_all_liff_apps` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = '/apps'
  get(liff_endpoint, endpoint_path, credentials)
end

#get_message_content(identifier) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiBlobClient#get_message_content instead.

Get message content.

Parameters:

  • identifier (String)

    Message’s identifier

Returns:

  • (Net::HTTPResponse)


449
450
451
452
453
454
455
456
# File 'lib/line/bot/v1/client.rb', line 449

def get_message_content(identifier)
  warn '[DEPRECATION] `Line::Bot::Client#get_message_content` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiBlobClient#get_message_content` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/message/#{identifier}/content"
  get(blob_endpoint, endpoint_path, credentials)
end

#get_message_delivery_broadcast(date) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#get_number_of_sent_broadcast_messages instead.

Gets the number of messages sent with the /bot/message/multicast endpoint.

Parameters:

  • date (String)

    Date the messages were sent (format: yyyyMMdd)

Returns:

  • (Net::HTTPResponse)


733
734
735
736
737
738
739
740
# File 'lib/line/bot/v1/client.rb', line 733

def get_message_delivery_broadcast(date)
  warn '[DEPRECATION] `Line::Bot::Client#get_message_delivery_broadcast` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_number_of_sent_broadcast_messages` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/message/delivery/broadcast?date=#{date}"
  get(endpoint, endpoint_path, credentials)
end

#get_message_delivery_multicast(date) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#get_number_of_sent_multicast_messages instead.

Gets the number of messages sent with the /bot/message/multicast endpoint.

Parameters:

  • date (String)

    Date the messages were sent (format: yyyyMMdd)

Returns:

  • (Net::HTTPResponse)


715
716
717
718
719
720
721
722
# File 'lib/line/bot/v1/client.rb', line 715

def get_message_delivery_multicast(date)
  warn '[DEPRECATION] `Line::Bot::Client#get_message_delivery_multicast` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_number_of_sent_multicast_messages` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/message/delivery/multicast?date=#{date}"
  get(endpoint, endpoint_path, credentials)
end

#get_message_delivery_pnp(date) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#get_pnp_message_statistics instead.

Get the number of LINE notification messages sent using the /bot/pnp/push endpoint.

Parameters:

  • date (String)

    Date the messages were sent (format: yyyyMMdd).

Returns:

  • (Net::HTTPResponse)


1765
1766
1767
1768
1769
1770
1771
1772
# File 'lib/line/bot/v1/client.rb', line 1765

def get_message_delivery_pnp(date)
  warn '[DEPRECATION] `Line::Bot::Client#get_message_delivery_pnp` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_pnp_message_statistics` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/message/delivery/pnp?date=#{date}"
  get(endpoint, endpoint_path, credentials)
end

#get_message_delivery_push(date) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#get_message_delivery_push instead.

Gets the number of messages sent with the /bot/message/push endpoint.

Parameters:

  • date (String)

    Date the messages were sent (format: yyyyMMdd)

Returns:

  • (Net::HTTPResponse)


697
698
699
700
701
702
703
704
# File 'lib/line/bot/v1/client.rb', line 697

def get_message_delivery_push(date)
  warn '[DEPRECATION] `Line::Bot::Client#get_message_delivery_push` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_message_delivery_push` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/message/delivery/push?date=#{date}"
  get(endpoint, endpoint_path, credentials)
end

#get_message_delivery_reply(date) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#get_number_of_sent_reply_messages instead.

Gets the number of messages sent with the /bot/message/reply endpoint.

Parameters:

  • date (String)

    Date the messages were sent (format: yyyyMMdd)

Returns:

  • (Net::HTTPResponse)


679
680
681
682
683
684
685
686
# File 'lib/line/bot/v1/client.rb', line 679

def get_message_delivery_reply(date)
  warn '[DEPRECATION] `Line::Bot::Client#get_message_delivery_reply` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_number_of_sent_reply_messages` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/message/delivery/reply?date=#{date}"
  get(endpoint, endpoint_path, credentials)
end

#get_narrowcast_message_status(request_id) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#get_narrowcast_progress instead.

Gets the status of a narrowcast message.

Parameters:

  • request_id (String)

    The narrowcast message’s request ID. Each Messaging API request has a request ID. Find it in the response headers.

Returns:

  • (Net::HTTPResponse)


1682
1683
1684
1685
1686
1687
1688
1689
# File 'lib/line/bot/v1/client.rb', line 1682

def get_narrowcast_message_status(request_id)
  warn '[DEPRECATION] `Line::Bot::Client#get_narrowcast_message_status` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_narrowcast_progress` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/message/progress/narrowcast?requestId=#{request_id}"
  get(endpoint, endpoint_path, credentials)
end

#get_number_of_followers(date) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::Insight::ApiClient#get_number_of_followers instead.

Returns the number of followers

Parameters:

  • date (String)

    (Format:yyyyMMdd, Example:20191231)

Returns:

  • (Net::HTTPResponse)


1259
1260
1261
1262
1263
1264
1265
1266
# File 'lib/line/bot/v1/client.rb', line 1259

def get_number_of_followers(date)
  warn '[DEPRECATION] `Line::Bot::Client#get_number_of_followers` is deprecated. Please use `Line::Bot::V2::Insight::ApiClient#get_number_of_followers` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/insight/followers?date=#{date}"
  get(endpoint, endpoint_path, credentials)
end

#get_number_of_message_deliveries(date) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::Insight::ApiClient#get_number_of_message_deliveries instead.

Returns the number of messages sent on a specified day

Parameters:

  • date (String)

    (Format:yyyyMMdd, Example:20191231)

Returns:

  • (Net::HTTPResponse)


1223
1224
1225
1226
1227
1228
1229
1230
# File 'lib/line/bot/v1/client.rb', line 1223

def get_number_of_message_deliveries(date)
  warn '[DEPRECATION] `Line::Bot::Client#get_number_of_message_deliveries` is deprecated. Please use `Line::Bot::V2::Insight::ApiClient#get_number_of_message_deliveries` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/insight/message/delivery?date=#{date}"
  get(endpoint, endpoint_path, credentials)
end

#get_profile(user_id) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#get_profile instead.

Get an user’s profile.

Parameters:

  • user_id (String)

    User Id user_id

Returns:

  • (Net::HTTPResponse)


466
467
468
469
470
471
472
473
# File 'lib/line/bot/v1/client.rb', line 466

def get_profile(user_id)
  warn '[DEPRECATION] `Line::Bot::Client#get_profile` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_profile` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/profile/#{user_id}"
  get(endpoint, endpoint_path, credentials)
end

#get_profile_by_access_token(access_token) ⇒ Net::HTTPResponse

Deprecated.

This is obsolete.

Get user profile by access token

Parameters:

  • access_token (String)

    access token

Returns:

  • (Net::HTTPResponse)


267
268
269
270
271
272
273
274
275
# File 'lib/line/bot/v1/client.rb', line 267

def get_profile_by_access_token(access_token)
  warn '[DEPRECATION] `Line::Bot::Client#get_profile_by_access_token` is obsolete. (LINE Login feature, not bot feature)' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  headers = {
    "Authorization" => "Bearer #{access_token}",
  }
  endpoint_path = "/v2/profile"
  get(oauth_endpoint, endpoint_path, headers)
end

#get_quotaNet::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#get_message_quota instead.

Get the target limit for additional messages

Returns:

  • (Net::HTTPResponse)


1189
1190
1191
1192
1193
1194
1195
1196
# File 'lib/line/bot/v1/client.rb', line 1189

def get_quota
  warn '[DEPRECATION] `Line::Bot::Client#get_quota` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_message_quota` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/message/quota"
  get(endpoint, endpoint_path, credentials)
end

#get_quota_consumptionNet::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#get_message_quota_consumption instead.

Get number of messages sent this month

Returns:

  • (Net::HTTPResponse)


1205
1206
1207
1208
1209
1210
1211
1212
# File 'lib/line/bot/v1/client.rb', line 1205

def get_quota_consumption
  warn '[DEPRECATION] `Line::Bot::Client#get_quota_consumption` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_message_quota_consumption` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/message/quota/consumption"
  get(endpoint, endpoint_path, credentials)
end

#get_rich_menu(rich_menu_id) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#get_rich_menu instead.

Get a rich menu via a rich menu ID

Parameters:

  • rich_menu_id (String)

    ID of an uploaded rich menu

Returns:

  • (Net::HTTPResponse)


661
662
663
664
665
666
667
668
# File 'lib/line/bot/v1/client.rb', line 661

def get_rich_menu(rich_menu_id)
  warn '[DEPRECATION] `Line::Bot::Client#get_rich_menu` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_rich_menu` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/richmenu/#{rich_menu_id}"
  get(endpoint, endpoint_path, credentials)
end

#get_rich_menu_image(rich_menu_id) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiBlobClient#get_rich_menu_image instead.

Download an image associated with a rich menu

Parameters:

  • rich_menu_id (String)

    ID of an uploaded rich menu

Returns:

  • (Net::HTTPResponse)


1135
1136
1137
1138
1139
1140
1141
1142
# File 'lib/line/bot/v1/client.rb', line 1135

def get_rich_menu_image(rich_menu_id)
  warn '[DEPRECATION] `Line::Bot::Client#get_rich_menu_image` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiBlobClient#get_rich_menu_image` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/richmenu/#{rich_menu_id}/content"
  get(blob_endpoint, endpoint_path, credentials)
end

#get_rich_menusNet::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#get_rich_menu_list instead.

Get a list of all uploaded rich menus

Returns:

  • (Net::HTTPResponse)


643
644
645
646
647
648
649
650
# File 'lib/line/bot/v1/client.rb', line 643

def get_rich_menus
  warn '[DEPRECATION] `Line::Bot::Client#get_rich_menus` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_rich_menu_list` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = '/bot/richmenu/list'
  get(endpoint, endpoint_path, credentials)
end

#get_rich_menus_alias(rich_menu_alias_id) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#get_rich_menu_alias instead.

Get a rich menu alias via a rich menu alias ID

Parameters:

  • rich_menu_alias_id (String)

    string of alias words rich menu

Returns:

  • (Net::HTTPResponse)


1024
1025
1026
1027
1028
1029
1030
1031
# File 'lib/line/bot/v1/client.rb', line 1024

def get_rich_menus_alias(rich_menu_alias_id)
  warn '[DEPRECATION] `Line::Bot::Client#get_rich_menus_alias` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_rich_menu_alias` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/richmenu/alias/#{rich_menu_alias_id}"
  get(endpoint, endpoint_path, credentials)
end

#get_rich_menus_alias_listNet::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#get_rich_menu_alias_list instead.

Get a list of all uploaded rich menus alias

Returns:

  • (Net::HTTPResponse)


1040
1041
1042
1043
1044
1045
1046
1047
# File 'lib/line/bot/v1/client.rb', line 1040

def get_rich_menus_alias_list
  warn '[DEPRECATION] `Line::Bot::Client#get_rich_menus_alias_list` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_rich_menu_alias_list` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/richmenu/alias/list"
  get(endpoint, endpoint_path, credentials)
end

#get_room_member_ids(room_id, continuation_token = nil) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#get_room_members_ids instead.

Get user IDs of a room

Parameters:

  • room_id (String)

    Room’s identifier

  • continuation_token (String) (defaults to: nil)

    Identifier to return next page (next property to be included in the response)

Returns:

  • (Net::HTTPResponse)


572
573
574
575
576
577
578
579
580
# File 'lib/line/bot/v1/client.rb', line 572

def get_room_member_ids(room_id, continuation_token = nil)
  warn '[DEPRECATION] `Line::Bot::Client#get_room_member_ids` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_room_members_ids` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/room/#{room_id}/members/ids"
  endpoint_path += "?start=#{continuation_token}" if continuation_token
  get(endpoint, endpoint_path, credentials)
end

#get_room_member_profile(room_id, user_id) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#get_room_member_profile instead.

Get an user’s profile of a room.

Parameters:

  • room_id (String)

    Room’s identifier

  • user_id (String)

    User Id user_id

Returns:

  • (Net::HTTPResponse)


504
505
506
507
508
509
510
511
# File 'lib/line/bot/v1/client.rb', line 504

def get_room_member_profile(room_id, user_id)
  warn '[DEPRECATION] `Line::Bot::Client#get_room_member_profile` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_room_member_profile` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/room/#{room_id}/member/#{user_id}"
  get(endpoint, endpoint_path, credentials)
end

#get_room_members_count(room_id) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#get_room_member_count instead.

Gets the count of members in a room.

Parameters:

  • room_id (String)

    Room’s identifier

Returns:

  • (Net::HTTPResponse)


627
628
629
630
631
632
633
634
# File 'lib/line/bot/v1/client.rb', line 627

def get_room_members_count(room_id)
  warn '[DEPRECATION] `Line::Bot::Client#get_room_members_count` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_room_member_count` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/room/#{room_id}/members/count"
  get(endpoint, endpoint_path, credentials)
end

#get_statistics_per_unit(unit:, from:, to:) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::Insight::ApiClient#get_statistics_per_unit instead.

Get the per-unit statistics of how users interact with push messages and multicast messages.

Parameters:

  • unit (String)

    Case-sensitive name of aggregation unit specified when sending the message.

  • from (String)

    Start date of aggregation period in UTC+9 with yyyyMMdd format

  • to (String)

    End date of aggregation period in UTC+9 with yyyyMMdd format.

Returns:

  • (Net::HTTPResponse)


1627
1628
1629
1630
1631
1632
1633
1634
1635
# File 'lib/line/bot/v1/client.rb', line 1627

def get_statistics_per_unit(unit:, from:, to:)
  warn '[DEPRECATION] `Line::Bot::Client#get_statistics_per_unit` is deprecated. Please use `Line::Bot::V2::Insight::ApiClient#get_statistics_per_unit` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  params = {customAggregationUnit: unit, from: from, to: to}
  endpoint_path = "/bot/insight/message/event/aggregation?" + URI.encode_www_form(params)
  get(endpoint, endpoint_path, credentials)
end

#get_user_interaction_statistics(request_id) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::Insight::ApiClient#get_message_event instead.

Returns statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account.

Parameters:

  • request_id (String)

Returns:

  • (Net::HTTPResponse)


1241
1242
1243
1244
1245
1246
1247
1248
# File 'lib/line/bot/v1/client.rb', line 1241

def get_user_interaction_statistics(request_id)
  warn '[DEPRECATION] `Line::Bot::Client#get_user_interaction_statistics` is deprecated. Please use `Line::Bot::V2::Insight::ApiClient#get_message_event` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/insight/message/event?requestId=#{request_id}"
  get(endpoint, endpoint_path, credentials)
end

#get_user_rich_menu(user_id) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#get_rich_menu_id_of_user instead.

Get the ID of the rich menu linked to a user

Parameters:

  • user_id (String)

    ID of the user

Returns:

  • (Net::HTTPResponse)


900
901
902
903
904
905
906
907
# File 'lib/line/bot/v1/client.rb', line 900

def get_user_rich_menu(user_id)
  warn '[DEPRECATION] `Line::Bot::Client#get_user_rich_menu` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_rich_menu_id_of_user` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/user/#{user_id}/richmenu"
  get(endpoint, endpoint_path, credentials)
end

#get_webhook_endpointNet::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#get_webhook_endpoint instead.

Gets information on a webhook endpoint.

Returns:

  • (Net::HTTPResponse)


1307
1308
1309
1310
1311
1312
1313
1314
# File 'lib/line/bot/v1/client.rb', line 1307

def get_webhook_endpoint
  warn '[DEPRECATION] `Line::Bot::Client#get_webhook_endpoint` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_webhook_endpoint` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = '/bot/channel/webhook/endpoint'
  get(endpoint, endpoint_path, credentials)
end

#issue_channel_access_token_jwt(jwt) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::ChannelAccessToken::ApiClient#issue_channel_token_by_jwt instead.

Issue channel access token v2.1

Parameters:

  • jwt (String)

Returns:

  • (Net::HTTPResponse)


153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/line/bot/v1/client.rb', line 153

def issue_channel_access_token_jwt(jwt)
  warn '[DEPRECATION] `Line::Bot::Client#issue_channel_access_token_jwt` is deprecated. Please use `Line::Bot::V2::ChannelAccessToken::ApiClient#issue_channel_token_by_jwt` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  endpoint_path = '/oauth2/v2.1/token'
  payload = URI.encode_www_form(
    grant_type: 'client_credentials',
    client_assertion_type: 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer',
    client_assertion: jwt
  )
  headers = { 'Content-Type' => 'application/x-www-form-urlencoded' }
  post(oauth_endpoint, endpoint_path, payload, headers)
end

#issue_channel_token(grant_type = 'client_credentials') ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::ChannelAccessToken::ApiClient#issue_channel_token instead.

Issue channel access token

Parameters:

  • grant_type (String) (defaults to: 'client_credentials')

    Grant type

Returns:

  • (Net::HTTPResponse)


112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/line/bot/v1/client.rb', line 112

def issue_channel_token(grant_type = 'client_credentials')
  warn '[DEPRECATION] `Line::Bot::Client#issue_channel_token` is deprecated. Please use `Line::Bot::V2::ChannelAccessToken::ApiClient#issue_channel_token` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_id_required
  channel_secret_required

  endpoint_path = '/oauth/accessToken'
  payload = URI.encode_www_form(
    grant_type:    grant_type,
    client_id:     channel_id,
    client_secret: channel_secret
  )
  headers = { 'Content-Type' => 'application/x-www-form-urlencoded' }
  post(endpoint, endpoint_path, payload, headers)
end

#leave_group(group_id) ⇒ Object

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#leave_group instead.



419
420
421
422
423
424
425
426
# File 'lib/line/bot/v1/client.rb', line 419

def leave_group(group_id)
  warn '[DEPRECATION] `Line::Bot::Client#leave_group` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#leave_group` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/group/#{group_id}/leave"
  post(endpoint, endpoint_path, nil, credentials)
end

#leave_room(room_id) ⇒ Object

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#leave_room instead.



432
433
434
435
436
437
438
439
# File 'lib/line/bot/v1/client.rb', line 432

def leave_room(room_id)
  warn '[DEPRECATION] `Line::Bot::Client#leave_room` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#leave_room` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/room/#{room_id}/leave"
  post(endpoint, endpoint_path, nil, credentials)
end

#liff_endpointObject



92
93
94
# File 'lib/line/bot/v1/client.rb', line 92

def liff_endpoint
  @liff_endpoint ||= API::DEFAULT_LIFF_ENDPOINT
end
Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#link_rich_menu_id_to_user instead.

Link a rich menu to a user

If you want to link a rich menu to multiple users, please consider to use bulk_link_rich_menus.

Parameters:

  • user_id (String)

    ID of the user

  • rich_menu_id (String)

    ID of an uploaded rich menu

Returns:

  • (Net::HTTPResponse)


1062
1063
1064
1065
1066
1067
1068
1069
# File 'lib/line/bot/v1/client.rb', line 1062

def link_user_rich_menu(user_id, rich_menu_id)
  warn '[DEPRECATION] `Line::Bot::Client#link_user_rich_menu` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#link_rich_menu_id_to_user` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/user/#{user_id}/richmenu/#{rich_menu_id}"
  post(endpoint, endpoint_path, nil, credentials)
end

#multicast(to, messages, headers: {}, payload: {}) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#multicast instead.

Send messages to multiple users using userIds.

Parameters:

  • to (Array, String)

    Array of userIds

  • messages (Hash, Array)

    Message Objects

  • headers (Hash) (defaults to: {})

    HTTP Headers

  • payload (Hash) (defaults to: {})

    Additional request body

Returns:

  • (Net::HTTPResponse)


347
348
349
350
351
352
353
354
355
356
357
358
# File 'lib/line/bot/v1/client.rb', line 347

def multicast(to, messages, headers: {}, payload: {})
  warn '[DEPRECATION] `Line::Bot::Client#multicast` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#multicast` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  to = [to] if to.is_a?(String)
  messages = [messages] if messages.is_a?(Hash)

  endpoint_path = '/bot/message/multicast'
  payload = payload.merge({ to: to, messages: messages }).to_json
  post(endpoint, endpoint_path, payload, credentials.merge(headers))
end

#multicast_by_phone_numbers(to, messages, headers: {}, payload: {}) ⇒ Net::HTTPResponse

Deprecated.

This is obsolete.

Send messages to multiple users using phone numbers.

Parameters:

  • to (Array, String)

    Array of hashed phone numbers.

  • messages (Hash, Array)

    Message Objects.

  • headers (Hash) (defaults to: {})

    HTTP Headers.

  • payload (Hash) (defaults to: {})

    Additional request body.

Returns:

  • (Net::HTTPResponse)


1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
# File 'lib/line/bot/v1/client.rb', line 1702

def multicast_by_phone_numbers(to, messages, headers: {}, payload: {})
  warn '[DEPRECATION] `Line::Bot::Client#get_narrowcast_message_status` is obsolete.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  to = [to] if to.is_a?(String)
  messages = [messages] if messages.is_a?(Hash)

  endpoint_path = 'bot/ad/multicast/phone'
  payload = payload.merge({ to: to, messages: messages }).to_json
  post(oauth_endpoint, endpoint_path, payload, credentials.merge(headers))
end

#narrowcast(messages, recipient: nil, filter: nil, limit: nil, headers: {}) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#narrowcast instead.

Narrowcast messages to users

API Documentation is here. developers.line.biz/en/reference/messaging-api/#send-narrowcast-message

Parameters:

  • messages (Hash, Array)
  • recipient (Hash) (defaults to: nil)
  • filter (Hash) (defaults to: nil)
  • limit (Hash) (defaults to: nil)
  • headers (Hash) (defaults to: {})

    HTTP Headers

Returns:

  • (Net::HTTPResponse)


398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
# File 'lib/line/bot/v1/client.rb', line 398

def narrowcast(messages, recipient: nil, filter: nil, limit: nil, headers: {})
  warn '[DEPRECATION] `Line::Bot::Client#narrowcast` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#narrowcast` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  messages = [messages] if messages.is_a?(Hash)

  endpoint_path = '/bot/message/narrowcast'
  payload = {
    messages: messages,
    recipient: recipient,
    filter: filter,
    limit: limit
  }.to_json
  post(endpoint, endpoint_path, payload, credentials.merge(headers))
end

#oauth_endpointObject



77
78
79
# File 'lib/line/bot/v1/client.rb', line 77

def oauth_endpoint
  @oauth_endpoint ||= API::DEFAULT_OAUTH_ENDPOINT
end

#parse_events_from(request_body) ⇒ Array<Line::Bot::Event::Class>

Deprecated.

This is deprecated. Please use V2::WebhookParser#parse instead.

Parse events from request.body

Parameters:

  • request_body (String)

Returns:

  • (Array<Line::Bot::Event::Class>)


1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
# File 'lib/line/bot/v1/client.rb', line 1849

def parse_events_from(request_body)
  warn '[DEPRECATION] `Line::Bot::Client#parse_events_from` is deprecated. Please use `Line::Bot::V2::WebhookParser#parse` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']
  json = JSON.parse(request_body)

  json['events'].map do |item|
    begin
      klass = Event.const_get(Util.camelize(item['type']))
      klass.new(item)
    rescue NameError
      Event::Base.new(item)
    end
  end
end

#post(endpoint_base, endpoint_path, payload = nil, headers = {}) ⇒ Net::HTTPResponse

Deprecated.

This is obsolete. You may use V2::HttpClient#post instead, but it is not recommended.

Post data, get content of specified URL.

Parameters:

  • endpoint_base (String)
  • endpoint_path (String)
  • payload (String, NilClass) (defaults to: nil)
  • headers (Hash) (defaults to: {})

Returns:

  • (Net::HTTPResponse)


1802
1803
1804
1805
# File 'lib/line/bot/v1/client.rb', line 1802

def post(endpoint_base, endpoint_path, payload = nil, headers = {})
  headers = API::DEFAULT_HEADERS.merge(headers)
  httpclient.post(endpoint_base + endpoint_path, payload, headers)
end

#push_message(user_id, messages, headers: {}, payload: {}) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#push_message instead.

Push messages to a user using user_id.

Parameters:

  • user_id (String)

    User Id

  • messages (Hash, Array)

    Message Objects

  • headers (Hash) (defaults to: {})

    HTTP Headers

  • payload (Hash) (defaults to: {})

    Additional request body

Returns:

  • (Net::HTTPResponse)


288
289
290
291
292
293
294
295
296
297
298
# File 'lib/line/bot/v1/client.rb', line 288

def push_message(user_id, messages, headers: {}, payload: {})
  warn '[DEPRECATION] `Line::Bot::Client#push_message` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#push_message` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  messages = [messages] if messages.is_a?(Hash)

  endpoint_path = '/bot/message/push'
  payload = payload.merge({ to: user_id, messages: messages }).to_json
  post(endpoint, endpoint_path, payload, credentials.merge(headers))
end

#push_pnp(hashed_phone_number, messages, headers: {}, payload: {}) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#push_messages_by_phone instead.

Send a LINE notification message by specifying the user’s phone number.

Parameters:

  • hashed_phone_number (String)

    Phone number that has been normalized.

  • messages (Hash, Array)

    Message Objects.

  • headers (Hash) (defaults to: {})

    HTTP Headers.

  • payload (Hash) (defaults to: {})

    Additional request body.

Returns:

  • (Net::HTTPResponse)


1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
# File 'lib/line/bot/v1/client.rb', line 1744

def push_pnp(hashed_phone_number, messages, headers: {}, payload: {})
  warn '[DEPRECATION] `Line::Bot::Client#push_pnp` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#push_messages_by_phone` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  messages = [messages] if messages.is_a?(Hash)

  endpoint_path = '/bot/pnp/push'
  payload = payload.merge({ to: hashed_phone_number, messages: messages }).to_json
  post(oauth_endpoint, endpoint_path, payload, credentials.merge(headers))
end

#put(endpoint_base, endpoint_path, payload = nil, headers = {}) ⇒ Net::HTTPResponse

Deprecated.

This is obsolete. You may use V2::HttpClient#put instead, but it is not recommended.

Put data, get content of specified URL.

Parameters:

  • endpoint_base (String)
  • endpoint_path (String)
  • payload (String, NilClass) (defaults to: nil)
  • headers (Hash) (defaults to: {})

Returns:

  • (Net::HTTPResponse)


1819
1820
1821
1822
# File 'lib/line/bot/v1/client.rb', line 1819

def put(endpoint_base, endpoint_path, payload = nil, headers = {})
  headers = API::DEFAULT_HEADERS.merge(headers)
  httpclient.put(endpoint_base + endpoint_path, payload, headers)
end

#rename_audience(audience_group_id, description) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::ManageAudience::ApiClient#update_audience_group_description instead.

Rename an existing audience group

Parameters:

  • audience_group_id (Integer)
  • description (String)

Returns:

  • (Net::HTTPResponse)


1504
1505
1506
1507
1508
1509
1510
1511
1512
# File 'lib/line/bot/v1/client.rb', line 1504

def rename_audience(audience_group_id, description)
  warn '[DEPRECATION] `Line::Bot::Client#rename_audience` is deprecated. Please use `Line::Bot::V2::ManageAudience::ApiClient#update_audience_group_description` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/audienceGroup/#{audience_group_id}/updateDescription"
  body = {description: description}
  put(endpoint, endpoint_path, body.to_json, credentials)
end

#reply_message(token, messages) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#reply_message instead.

Reply messages to a user using replyToken.

Examples:

Send a balloon to a user.

message = {
  type: 'text',
  text: 'Hello, World!'
}
client.reply_message(event['replyToken'], message)

Send multiple balloons to a user.


messages = [
 {type: 'text', text: 'Message1'},
 {type: 'text', text: 'Message2'}
]
client.reply_message(event['replyToken'], messages)

Parameters:

  • token (String)

    Reply Token

  • messages (Hash, Array)

    Message Objects

Returns:

  • (Net::HTTPResponse)


324
325
326
327
328
329
330
331
332
333
334
# File 'lib/line/bot/v1/client.rb', line 324

def reply_message(token, messages)
  warn '[DEPRECATION] `Line::Bot::Client#reply_message` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#reply_message` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  messages = [messages] if messages.is_a?(Hash)

  endpoint_path = '/bot/message/reply'
  payload = { replyToken: token, messages: messages }.to_json
  post(endpoint, endpoint_path, payload, credentials)
end

#revoke_channel_access_token_jwt(access_token) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::ChannelAccessToken::ApiClient#revoke_channel_token_by_jwt instead.

Revoke channel access token v2.1

Parameters:

  • access_token (String)

Returns:

  • (Net::HTTPResponse)


175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# File 'lib/line/bot/v1/client.rb', line 175

def revoke_channel_access_token_jwt(access_token)
  warn '[DEPRECATION] `Line::Bot::Client#revoke_channel_access_token_jwt` is deprecated. Please use `Line::Bot::V2::ChannelAccessToken::ApiClient#revoke_channel_token_by_jwt` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_id_required
  channel_secret_required

  endpoint_path = '/oauth2/v2.1/revoke'
  payload = URI.encode_www_form(
    client_id: channel_id,
    client_secret: channel_secret,
    access_token: access_token
  )
  headers = { 'Content-Type' => 'application/x-www-form-urlencoded' }
  post(oauth_endpoint, endpoint_path, payload, headers)
end

#revoke_channel_token(access_token) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::ChannelAccessToken::ApiClient#revoke_channel_token instead.

Revoke channel access token

Returns:

  • (Net::HTTPResponse)


135
136
137
138
139
140
141
142
# File 'lib/line/bot/v1/client.rb', line 135

def revoke_channel_token(access_token)
  warn '[DEPRECATION] `Line::Bot::Client#revoke_channel_token` is deprecated. Please use `Line::Bot::V2::ChannelAccessToken::ApiClient#revoke_channel_token` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  endpoint_path = '/oauth/revoke'
  payload = URI.encode_www_form(access_token: access_token)
  headers = { 'Content-Type' => 'application/x-www-form-urlencoded' }
  post(endpoint, endpoint_path, payload, headers)
end

#set_default_rich_menu(rich_menu_id) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#set_default_rich_menu instead.

Set default rich menu (Link a rich menu to all user)

Parameters:

  • rich_menu_id (String)

    ID of an uploaded rich menu

Returns:

  • (Net::HTTPResponse)


934
935
936
937
938
939
940
941
# File 'lib/line/bot/v1/client.rb', line 934

def set_default_rich_menu(rich_menu_id)
  warn '[DEPRECATION] `Line::Bot::Client#set_default_rich_menu` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#set_default_rich_menu` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/user/all/richmenu/#{rich_menu_id}"
  post(endpoint, endpoint_path, nil, credentials)
end

#set_rich_menus_alias(rich_menu_id, rich_menu_alias_id) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#create_rich_menu_alias instead.

Set rich menu alias

Parameters:

  • rich_menu_id (String)

    ID of an uploaded rich menu

  • rich_menu_alias_id (String)

    string of alias words rich menu

Returns:

  • (Net::HTTPResponse)


969
970
971
972
973
974
975
976
# File 'lib/line/bot/v1/client.rb', line 969

def set_rich_menus_alias(rich_menu_id, rich_menu_alias_id)
  warn '[DEPRECATION] `Line::Bot::Client#set_rich_menus_alias` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#create_rich_menu_alias` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = '/bot/richmenu/alias'
  post(endpoint, endpoint_path, { richMenuId: rich_menu_id, richMenuAliasId: rich_menu_alias_id }.to_json, credentials)
end

#set_webhook_endpoint(webhook_endpoint) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#set_webhook_endpoint instead.

Sets the webhook endpoint URL.

Parameters:

  • webhook_endpoint (String)

Returns:

  • (Net::HTTPResponse)


1325
1326
1327
1328
1329
1330
1331
1332
1333
# File 'lib/line/bot/v1/client.rb', line 1325

def set_webhook_endpoint(webhook_endpoint)
  warn '[DEPRECATION] `Line::Bot::Client#set_webhook_endpoint` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#set_webhook_endpoint` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = '/bot/channel/webhook/endpoint'
  body = {endpoint: webhook_endpoint}
  put(endpoint, endpoint_path, body.to_json, credentials)
end

#test_webhook_endpoint(webhook_endpoint = nil) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#test_webhook_endpoint instead.

Checks if the configured webhook endpoint can receive a test webhook event.

Parameters:

  • webhook_endpoint (String) (defaults to: nil)

    options

Returns:

  • (Net::HTTPResponse)


1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
# File 'lib/line/bot/v1/client.rb', line 1344

def test_webhook_endpoint(webhook_endpoint = nil)
  warn '[DEPRECATION] `Line::Bot::Client#test_webhook_endpoint` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#test_webhook_endpoint` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = '/bot/channel/webhook/test'
  body = if webhook_endpoint.nil?
           {}
         else
           {endpoint: webhook_endpoint}
         end
  post(endpoint, endpoint_path, body.to_json, credentials)
end
Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#unlink_rich_menu_id_from_user instead.

Unlink a rich menu from a user

Parameters:

  • user_id (String)

    ID of the user

Returns:

  • (Net::HTTPResponse)


1080
1081
1082
1083
1084
1085
1086
1087
# File 'lib/line/bot/v1/client.rb', line 1080

def unlink_user_rich_menu(user_id)
  warn '[DEPRECATION] `Line::Bot::Client#unlink_user_rich_menu` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#unlink_rich_menu_id_from_user` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/user/#{user_id}/richmenu"
  delete(endpoint, endpoint_path, credentials)
end

#unset_default_rich_menuNet::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#cancel_default_rich_menu instead.

Unset default rich menu (Unlink a rich menu from all user)

Returns:

  • (Net::HTTPResponse)


950
951
952
953
954
955
956
957
# File 'lib/line/bot/v1/client.rb', line 950

def unset_default_rich_menu
  warn '[DEPRECATION] `Line::Bot::Client#unset_default_rich_menu` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#cancel_default_rich_menu` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/user/all/richmenu"
  delete(endpoint, endpoint_path, credentials)
end

#unset_rich_menus_alias(rich_menu_alias_id) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#delete_rich_menu_alias instead.

Unset rich menu alias

Parameters:

  • rich_menu_alias_id (String)

    string of alias words rich menu

Returns:

  • (Net::HTTPResponse)


987
988
989
990
991
992
993
994
# File 'lib/line/bot/v1/client.rb', line 987

def unset_rich_menus_alias(rich_menu_alias_id)
  warn '[DEPRECATION] `Line::Bot::Client#unset_rich_menus_alias` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#delete_rich_menu_alias` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/richmenu/alias/#{rich_menu_alias_id}"
  delete(endpoint, endpoint_path, credentials)
end

#update_audience_authority_level(authority_level) ⇒ Net::HTTPResponse

Deprecated.

This is obsolete.

Change the authority level of the audience

Parameters are described here. developers.line.biz/en/reference/messaging-api/#change-authority-level

Parameters:

  • authority_level (String)

    value must be PUBLIC or PRIVATE

Returns:

  • (Net::HTTPResponse)


1606
1607
1608
1609
1610
1611
1612
1613
1614
# File 'lib/line/bot/v1/client.rb', line 1606

def update_audience_authority_level(authority_level)
  warn '[DEPRECATION] `Line::Bot::Client#update_audience_authority_level` is obsolete.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/audienceGroup/authorityLevel"
  body = {authorityLevel: authority_level}
  put(endpoint, endpoint_path, body.to_json, credentials)
end

#update_liff_app(liff_id, app) ⇒ Object

Deprecated.

This is deprecated. Please use V2::Liff::ApiClient#update_liff_app instead.



1388
1389
1390
1391
1392
1393
1394
1395
# File 'lib/line/bot/v1/client.rb', line 1388

def update_liff_app(liff_id, app)
  warn '[DEPRECATION] `Line::Bot::Client#update_liff_app` is deprecated. Please use `Line::Bot::V2::Liff::ApiClient#update_liff_app` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/apps/#{liff_id}"
  put(liff_endpoint, endpoint_path, app.to_json, credentials)
end

#update_rich_menus_alias(rich_menu_id, rich_menu_alias_id) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#update_rich_menu_alias instead.

Update rich menu alias

Parameters:

  • rich_menu_id (String)

    ID of an uploaded rich menu

  • rich_menu_alias_id (String)

    string of alias words rich menu

Returns:

  • (Net::HTTPResponse)


1006
1007
1008
1009
1010
1011
1012
1013
# File 'lib/line/bot/v1/client.rb', line 1006

def update_rich_menus_alias(rich_menu_id, rich_menu_alias_id)
  warn '[DEPRECATION] `Line::Bot::Client#update_rich_menus_alias` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#update_rich_menu_alias` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = "/bot/richmenu/alias/#{rich_menu_alias_id}"
  post(endpoint, endpoint_path, { richMenuId: rich_menu_id }.to_json, credentials)
end

#update_user_id_audience(params) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::ManageAudience::ApiClient#add_audience_to_audience_group instead.

Update an audience group

Parameters are described here. developers.line.biz/en/reference/messaging-api/#update-upload-audience-group

Parameters:

  • params (Hash)

    options

Returns:

  • (Net::HTTPResponse)

    This response includes an audience_group_id.



1443
1444
1445
1446
1447
1448
1449
1450
# File 'lib/line/bot/v1/client.rb', line 1443

def update_user_id_audience(params)
  warn '[DEPRECATION] `Line::Bot::Client#update_user_id_audience` is deprecated. Please use `Line::Bot::V2::ManageAudience::ApiClient#add_audience_to_audience_group` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = '/bot/audienceGroup/upload'
  put(endpoint, endpoint_path, params.to_json, credentials)
end

#validate_broadcast_message_objects(messages) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#validate_broadcast instead.

Validate message objects of a broadcast message

Parameters:

  • messages (Array)

    Array of message objects to validate

Returns:

  • (Net::HTTPResponse)


827
828
829
830
831
832
833
834
835
# File 'lib/line/bot/v1/client.rb', line 827

def validate_broadcast_message_objects(messages)
  warn '[DEPRECATION] `Line::Bot::Client#validate_broadcast_message_objects` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#validate_broadcast` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = '/bot/message/validate/broadcast'
  payload = { messages: messages }.to_json
  post(endpoint, endpoint_path, payload, credentials)
end

#validate_multicast_message_objects(messages) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#validate_multicast instead.

Validate message objects of a multicast message

Parameters:

  • messages (Array)

    Array of message objects to validate

Returns:

  • (Net::HTTPResponse)


789
790
791
792
793
794
795
796
797
# File 'lib/line/bot/v1/client.rb', line 789

def validate_multicast_message_objects(messages)
  warn '[DEPRECATION] `Line::Bot::Client#validate_multicast_message_objects` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#validate_multicast` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = '/bot/message/validate/multicast'
  payload = { messages: messages }.to_json
  post(endpoint, endpoint_path, payload, credentials)
end

#validate_narrowcast_message_objects(messages) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#validate_narrowcast instead.

Validate message objects of a narrowcast message

Parameters:

  • messages (Array)

    Array of message objects to validate

Returns:

  • (Net::HTTPResponse)


808
809
810
811
812
813
814
815
816
# File 'lib/line/bot/v1/client.rb', line 808

def validate_narrowcast_message_objects(messages)
  warn '[DEPRECATION] `Line::Bot::Client#validate_narrowcast_message_objects` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#validate_narrowcast` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = '/bot/message/validate/narrowcast'
  payload = { messages: messages }.to_json
  post(endpoint, endpoint_path, payload, credentials)
end

#validate_push_message_objects(messages) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#validate_push instead.

Validate message objects of a push message

Parameters:

  • messages (Array)

    Array of message objects to validate

Returns:

  • (Net::HTTPResponse)


770
771
772
773
774
775
776
777
778
# File 'lib/line/bot/v1/client.rb', line 770

def validate_push_message_objects(messages)
  warn '[DEPRECATION] `Line::Bot::Client#validate_push_message_objects` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#validate_push` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = '/bot/message/validate/push'
  payload = { messages: messages }.to_json
  post(endpoint, endpoint_path, payload, credentials)
end

#validate_reply_message_objects(messages) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#validate_reply instead.

Validate message objects of a reply message

Parameters:

  • messages (Array)

    Array of message objects to validate

Returns:

  • (Net::HTTPResponse)


751
752
753
754
755
756
757
758
759
# File 'lib/line/bot/v1/client.rb', line 751

def validate_reply_message_objects(messages)
  warn '[DEPRECATION] `Line::Bot::Client#validate_reply_message_objects` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#validate_reply` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = '/bot/message/validate/reply'
  payload = { messages: messages }.to_json
  post(endpoint, endpoint_path, payload, credentials)
end

#validate_rich_menu_object(rich_menu) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::MessagingApi::ApiClient#validate_rich_menu_object instead.

Validate a rich menu object

Parameters:

  • rich_menu (Hash)

    The rich menu represented as a rich menu object

Returns:

  • (Net::HTTPResponse)


864
865
866
867
868
869
870
871
# File 'lib/line/bot/v1/client.rb', line 864

def validate_rich_menu_object(rich_menu)
  warn '[DEPRECATION] `Line::Bot::Client#validate_rich_menu_object` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#validate_rich_menu_object` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_token_required

  endpoint_path = '/bot/richmenu/validate'
  post(endpoint, endpoint_path, rich_menu.to_json, credentials)
end

#validate_signature(content, channel_signature) ⇒ Boolean

Deprecated.

This is deprecated. Please use V2::WebhookParser#parse instead.

Validate signature of a webhook event.

developers.line.biz/en/reference/messaging-api/#signature-validation

Parameters:

  • content (String)

    Request’s body

  • channel_signature (String)

    Request’header ‘X-LINE-Signature’ # HTTP_X_LINE_SIGNATURE

Returns:

  • (Boolean)


1875
1876
1877
1878
1879
1880
1881
1882
1883
# File 'lib/line/bot/v1/client.rb', line 1875

def validate_signature(content, channel_signature)
  warn '[DEPRECATION] `Line::Bot::Client#validate_signature` is deprecated. Please use `Line::Bot::V2::WebhookParser#parse` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']
  return false if !channel_signature || !channel_secret

  hash = OpenSSL::HMAC.digest(OpenSSL::Digest.new('SHA256'), channel_secret, content)
  signature = Base64.strict_encode64(hash)

  variable_secure_compare(channel_signature, signature)
end

#verify_access_token(access_token) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::ChannelAccessToken::ApiClient#verify_channel_token instead.

Verify access token v2.1

Parameters:

  • access_token (String)

    access token

Returns:

  • (Net::HTTPResponse)


227
228
229
230
231
232
233
234
235
# File 'lib/line/bot/v1/client.rb', line 227

def verify_access_token(access_token)
  warn '[DEPRECATION] `Line::Bot::Client#verify_access_token` is deprecated. Please use `Line::Bot::V2::ChannelAccessToken::ApiClient#verify_channel_token` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  payload = URI.encode_www_form(
    access_token: access_token
  )
  endpoint_path = "/oauth2/v2.1/verify?#{payload}"
  get(oauth_endpoint, endpoint_path)
end

#verify_id_token(id_token, nonce: nil, user_id: nil) ⇒ Net::HTTPResponse

Deprecated.

This is deprecated. Please use V2::ChannelAccessToken::ApiClient#verify_channel_token_by_jwt instead.

Verify ID token

Parameters:

  • id_token (String)

    ID token

  • nonce (String) (defaults to: nil)

    Expected nonce value. Use the nonce value provided in the authorization request. Omit if the nonce value was not specified in the authorization request.

  • user_id (String) (defaults to: nil)

    Expected user ID.

Returns:

  • (Net::HTTPResponse)


202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/line/bot/v1/client.rb', line 202

def verify_id_token(id_token, nonce: nil, user_id: nil)
  warn '[DEPRECATION] `Line::Bot::Client#verify_id_token` is deprecated. Please use `Line::Bot::V2::ChannelAccessToken::ApiClient#verify_channel_token_by_jwt` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS']

  channel_id_required

  endpoint_path = '/oauth2/v2.1/verify'
  payload = URI.encode_www_form({
    client_id: channel_id,
    id_token: id_token,
    nonce: nonce,
    user_id: user_id
  }.compact)
  headers = { 'Content-Type' => 'application/x-www-form-urlencoded' }
  post(oauth_endpoint, endpoint_path, payload, headers)
end