{"id":13683234,"url":"https://github.com/line/line-bot-sdk-perl","last_synced_at":"2025-04-30T12:34:04.234Z","repository":{"id":47008524,"uuid":"56061470","full_name":"line/line-bot-sdk-perl","owner":"line","description":"LINE Messaging API SDK for Perl","archived":false,"fork":false,"pushed_at":"2024-09-17T01:08:54.000Z","size":852,"stargazers_count":73,"open_issues_count":14,"forks_count":31,"subscribers_count":35,"default_branch":"master","last_synced_at":"2024-09-18T02:47:09.218Z","etag":null,"topics":["bot","line","perl","sdk"],"latest_commit_sha":null,"homepage":"https://developers.line.biz/en/docs/messaging-api/overview/","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/line.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-12T12:33:19.000Z","updated_at":"2024-09-17T23:32:22.000Z","dependencies_parsed_at":"2024-07-23T02:12:15.620Z","dependency_job_id":null,"html_url":"https://github.com/line/line-bot-sdk-perl","commit_stats":{"total_commits":450,"total_committers":18,"mean_commits":25.0,"dds":0.6155555555555556,"last_synced_commit":"4ad644850e2001d944cab81e0457a5f980b98b77"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/line%2Fline-bot-sdk-perl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/line%2Fline-bot-sdk-perl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/line%2Fline-bot-sdk-perl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/line%2Fline-bot-sdk-perl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/line","download_url":"https://codeload.github.com/line/line-bot-sdk-perl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224212089,"owners_count":17274356,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","line","perl","sdk"],"created_at":"2024-08-02T13:02:04.966Z","updated_at":"2024-11-12T03:30:43.451Z","avatar_url":"https://github.com/line.png","language":"Perl","funding_links":[],"categories":["Perl"],"sub_categories":[],"readme":"# NAME\n\nLINE::Bot::API - SDK of the LINE Messaging API for Perl\n\n# Maintenance Mode\n\nAs of May 13, 2024, the project [line-bot-sdk-perl](https://github.com/line/line-bot-sdk-perl/) project will enter maintenance mode. During this period, we will continue to provide critical bug fixes and security updates; however, new features will not be added. We encourage the community to submit patches and improvements, which we will gladly review and merge as appropriate.\n\n# Archiving\n\nOn December 2, 2024, the repository [line-bot-sdk-perl](https://github.com/line/line-bot-sdk-perl/) will be archived. This means the codebase will become read-only. While the repository will still be available for cloning and viewing, no further contributions or changes will be accepted. We recommend users and developers fork the repository if they wish to continue development independently.\n\nWe appreciate the support and contributions from our community throughout the project's lifecycle. Thank you for being a part of our journey.\n\n# SYNOPSIS\n\n    # in the synopsis.psgi\n    use strict;\n    use warnings;\n    use LINE::Bot::API;\n    use LINE::Bot::API::Builder::SendMessage;\n    use Plack::Request;\n\n    my $bot = LINE::Bot::API-\u003enew(\n        channel_secret       =\u003e $channel_secret,\n        channel_access_token =\u003e $channel_access_token,\n    );\n\n    sub {\n        my $req = Plack::Request-\u003enew(shift);\n\n        unless ($req-\u003emethod eq 'POST' \u0026\u0026 $req-\u003epath eq '/callback') {\n            return [200, [], ['Not Found']];\n        }\n\n        unless ($bot-\u003evalidate_signature($req-\u003econtent, $req-\u003eheader('X-Line-Signature'))) {\n            return [200, [], ['failed to validate signature']];\n        }\n\n        my $events = $bot-\u003eparse_events_from_json($req-\u003econtent);\n        for my $event (@{ $events }) {\n            next unless $event-\u003eis_message_event \u0026\u0026 $event-\u003eis_text_message;\n\n            my $messages = LINE::Bot::API::Builder::SendMessage-\u003enew;\n            $messages-\u003eadd_text( text =\u003e $event-\u003etext );\n            $bot-\u003ereply_message($event-\u003ereply_token, $messages-\u003ebuild);\n        }\n\n        return [200, [], [\"OK\"]];\n    };\n\n# DESCRIPTION\n\nLINE::Bot::API is a client library which lets you easily start using the LINE Messaging API.\nYou can create a bot which runs on the LINE app by registering for a LINE Messaging API account.\nYou can create a **Messaging API** account from the [LINE Business Center](https://business.line.me/).\n\nYou can find the **Channel secret** and **Channel access token** on the Basic information page on the Channel Console which you can access from the [LINE Business Center](https://business.line.me/).\n\nUse this documentation and the LINE Developers documentation to get you started developing your own bot!\n\n# METHODS\n\n## `new(%args)`\n\nCreate a new LINE::Bot::API instance.\n\n     my $bot = LINE::Bot::API-\u003enew(\n        channel_secret       =\u003e $channel_secret,\n        channel_access_token =\u003e $channel_access_token,\n    );\n\n## `reply_message($reply_token, [ $message, ... ] )`\n\nSend reply messages to a user, room or group.\n\n    my $messages = LINE::Bot::API::Builder::SendMessage-\u003enew;\n    $messages-\u003eadd_text( text =\u003e 'Example reply text' );\n\n    my $ret = $bot-\u003ereply_message($reply_token, $messages-\u003ebuild);\n    unless ($ret-\u003eis_success) {\n        # error\n        warn $ret-\u003emessage;\n        for my $detail (@{ $ret-\u003edetails // []}) {\n            warn \"    detail: \" . $detail-\u003e{message};\n        }\n    }\n\nYou can get a `reply_token` from a [webhook event object](https://developers.line.biz/en/reference/messaging-api/#webhook-event-objects).\nSee the documentation for the `parse_events_from_json($json)` method.\n\nSee also the API reference of this method: [https://developers.line.biz/en/reference/messaging-api/#send-reply-message](https://developers.line.biz/en/reference/messaging-api/#send-reply-message)\n\n## `push_message( $user_id|$room_id|$group_id, $message, $options)`\n\nSend push messages to a user, room or group.\n\n    my $messages = LINE::Bot::API::Builder::SendMessage-\u003enew;\n    $messages-\u003eadd_text( text =\u003e 'Example push text' );\n    $bot-\u003epush_message($user_id, $messages-\u003ebuild);\n\nYou can get a `user_id`, `room_id` or `group_id` from a [webhook event object](https://developers.line.biz/en/reference/messaging-api/#webhook-event-objects)\nSee the documentation for the `parse_events_from_json($json)` method.\n\nThe last parameter `$options` is an HashRef with a list of key-values\npairs to fine-tune the behaviour of this message. At the moment, the\nonly defined configurable option is `\"retry_key\"`, which requires an\nUUID string for its value. See the section [\"Handling Retries\"](#handling-retries) for\nthe meaning of this particular option.\n\nFor mor detail, read the LINE Developers API reference of this method: [https://developers.line.biz/en/reference/messaging-api/#send-push-message](https://developers.line.biz/en/reference/messaging-api/#send-push-message)\n\n## `multicast( $user_id, $message, $options )`\n\nSend push messages to multiple users.\n\n    my $messages = LINE::Bot::API::Builder::SendMessage-\u003enew;\n    $messages-\u003eadd_text( text =\u003e 'Example push text' );\n    $bot-\u003emulticast([ $user_id ], $messages-\u003ebuild);\n\nYou can get a `user_id` from a [webhook event object](https://developers.line.biz/en/reference/messaging-api/#webhook-event-objects).\nSee the documentation for the `parse_events_from_json($json)` method.\n\nThe last parameter `$options` is an HashRef with a list of key-values\npairs to fine-tune the behaviour of this message. At the moment, the\nonly defined configurable option is `\"retry_key\"`, which requires an\nUUID string for its value. See the section [\"Handling Retries\"](#handling-retries) for\nthe meaning of this particular option.\n\nSee also the LINE Developers API reference of this method: [https://developers.line.biz/en/reference/messaging-api/#send-multicast-messages](https://developers.line.biz/en/reference/messaging-api/#send-multicast-messages)\n\n## `broadcast($message, $options)`\n\nSends push messages to multiple users at any time.\n\n    my $messages = LINE::Bot::API::Builder::SendMessage-\u003enew;\n    $messages-\u003eadd_text( text =\u003e 'Example push text' );\n    $bot-\u003ebroadcast($messages-\u003ebuild);\n\nThe last parameter `$options` is an HashRef with a list of key-values\npairs to fine-tune the behaviour of this message. At the moment, the\nonly defined configurable option is `\"retry_key\"`, which requires an\nUUID string for its value. See the section [\"Handling Retries\"](#handling-retries) for\nthe meaning of this particular option.\n\nSee also the LINE Developers API reference of thi smethod: [https://developers.line.biz/en/reference/messaging-api/#send-broadcast-message](https://developers.line.biz/en/reference/messaging-api/#send-broadcast-message)\n\n## `validate_signature($json, $signature)`\n\n    my $req = Plack::Request-\u003enew( ... );\n    unless ($bot-\u003evalidate_signature($req-\u003econtent, $req-\u003eheader('X-Line-Signature'))) {\n        die 'failed to signature validation';\n    }\n\n## `parse_events_from_json($json)`\n\nParse webhook event objects and build [LINE::Bot::API::Event](https://metacpan.org/pod/LINE%3A%3ABot%3A%3AAPI%3A%3AEvent) instances.\n\n    my $req = Plack::Request-\u003enew( ... );\n    my $events = $bot-\u003eparse_events_from_json($req-\u003econtent);\n    for my $event (@{ $events }) {\n        unless ($event-\u003eis_unfollow_event \u0026\u0026 $event-\u003eis_leave_event) {\n            # Get a reply_token\n            my $reply_token = $event-\u003ereply_token;\n        }\n        if ($event-\u003eis_user_event) {\n            # Get a user_id\n            my $user_id = $event-\u003euser_id;\n        }\n        if ($event-\u003eis_room_event) {\n            # Get a room_id\n            my $room_id = $event-\u003eroom_id;\n        }\n        if ($event-\u003eis_group_event) {\n            # Get a group_id\n            my $group_id = $event-\u003egroup_id;\n        }\n\n        if ($event-\u003eis_message_event) {\n            # Get a message id\n            my $message_id = $event-\u003emessage_id;\n        }\n    }\n\n## `leave_room($room_id)`\n\nBot leaves a room.\n\n    $bot-\u003eleave_room($room_id);\n\nYou can get a `room_id` by a [Webhook Event Object](https://developers.line.biz/en/reference/messaging-api/#webhook-event-objects).\nAnd see also `parse_events_from_json($json)` method's document.\n\n## `leave_group($group_id)`\n\nBot leaves a group.\n\n    $bot-\u003eleave_group($group_id);\n\nYou can get a `group_id` from a [webhook event object](https://developers.line.biz/en/reference/messaging-api/#webhook-event-objects).\nSee the documentation for the `parse_events_from_json($json)` method.\n\n## `get_message_content($message_id)`\n\nGet the original file which was sent by user.\n\n    my $ret = $bot-\u003eget_message_content($message_id);\n    if ($ret-\u003eis_success) {\n        my $filename = $ret-\u003efh-\u003efilename;\n        open my $fh, '\u003c', $file or die \"$!: $file\";\n        ...\n    }\n\nYou can get a `message_id` from a [webhook event object](https://developers.line.biz/en/reference/messaging-api/#webhook-event-objects).\nSee the documentation for the `parse_events_from_json($json)` method.\n\nYou can also see the online API reference documentation.\n\nSee also the LINE Developers API reference of this method: [https://developers.line.biz/en/reference/messaging-api/#get-content](https://developers.line.biz/en/reference/messaging-api/#get-content)\n\n## `get_target_limit_for_additional_messages`\n\nGets the target limit for additional messages in the current month.\n\nSee also the LINE Developers API reference of this method:  [https://developers.line.biz/en/reference/messaging-api/#get-quota](https://developers.line.biz/en/reference/messaging-api/#get-quota)\n\n## `get_number_of_messages_sent_this_month`\n\nGets the number of messages sent in the current month.\n\nSee also the LINE Developers API reference of this method:  [https://developers.line.biz/en/reference/messaging-api/#get-consumption](https://developers.line.biz/en/reference/messaging-api/#get-consumption)\n\n## `get_number_of_message_deliveries({ date =\u003e ... })`\n\nGet the number of messages sent from LINE official account on a specified day.\n\nSee also the LINE Developers API reference of this method: [https://developers.line.biz/en/reference/messaging-api/#get-number-of-delivery-messages](https://developers.line.biz/en/reference/messaging-api/#get-number-of-delivery-messages)\n\nThe argument is a HashRef with one pair of mandatory key-values;\n\n    { date =\u003e \"20191231\" }\n\nThe formate of date is \"yyyyMMdd\", that is, year in 4 digits, month in\n2 digits, and date-of-month in 2 digits.\n\nThe return value `$res` is a response object with the following read-only accessors\n(see the API documentation for the meaning of each.)\n\n    $res-\u003estatus();     #=\u003e Str\n    $res-\u003ebroadcast();  #=\u003e Num\n    $res-\u003etargeting();  #=\u003e Num\n\nNotice that the \"status\" does not mean HTTP status. To inspect actual\nHTTP status, invoke `$res-`http\\_status()\u003e.\n\n## `get_profile($user_id)`\n\nGet user profile information.\n\n    my $ret = $bot-\u003eget_profile($user_id);\n    if ($ret-\u003eis_success) {\n        say $ret-\u003edisplay_name;\n        say $ret-\u003euser_id;\n        say $ret-\u003epicture_url;\n        say $ret-\u003estatus_message;\n        say $ret-\u003elanguage;\n    }\n\nSee also the LINE Developers API reference of this method:  [https://developers.line.biz/en/reference/messaging-api/#get-profile](https://developers.line.biz/en/reference/messaging-api/#get-profile)\n\n## `get_friend_demographics`\n\nRetrieves the demographic attributes for a LINE Official Account's friends.\n\nSee also the LINE Developers API reference of this method: [https://developers.line.biz/en/reference/messaging-api/#get-demographic](https://developers.line.biz/en/reference/messaging-api/#get-demographic)\n\n## `get_group_member_profile($group_id, $user_id)`\n\nGet group user profile information.\n\n    my $ret = $bot-\u003eget_group_member_profile($group_id, $user_id);\n    if ($ret-\u003eis_success) {\n        say $ret-\u003edisplay_name;\n        say $ret-\u003euser_id;\n        say $ret-\u003epicture_url;\n    }\n\nSee also the LINE Developers API reference of this method:  [https://developers.line.biz/en/reference/messaging-api/#get-group-member-profile](https://developers.line.biz/en/reference/messaging-api/#get-group-member-profile)\n\n## `get_member_in_room_count($room_id)`\n\nGets the count of members in a room. You can get the member in room count even if the user hasn't added the LINE Official Account as a friend or has blocked the LINE Official Account.\n\n    my $ret = $bot-\u003eget_member_in_room_count($room_id);\n    if ($ret-\u003eis_success) {\n        say $ret-\u003ecount;\n    }\n\nSee also the LINE Developers API reference of this method:  [https://developers.line.biz/en/reference/messaging-api/#get-members-room-count](https://developers.line.biz/en/reference/messaging-api/#get-members-room-count)\n\n## `get_member_in_group_count($group_id)`\n\nGets the count of members in a group. You can get the member in group count even if the user hasn't added the LINE Official Account as a friend or has blocked the LINE Official Account.\n\n    my $ret = $bot-\u003eget_member_in_group_count($group_id);\n    if ($ret-\u003eis_success) {\n        say $ret-\u003ecount;\n    }\n\nSee also the LINE Developers API reference of this method:  [https://developers.line.biz/en/reference/messaging-api/#get-members-group-count](https://developers.line.biz/en/reference/messaging-api/#get-members-group-count)\n\n## `get_group_summary($group_id)`\n\nGets the group ID, group name, and group icon URL of a group where the LINE Official Account is a member.\n\n    my $ret = $bot-\u003eget_group_summary($group_id);\n    if ($ret-\u003eis_success) {\n        say $ret-\u003egroup_id;\n        say $ret-\u003egroup_name;\n        say $ret-\u003epicture_url;\n    }\n\nSee also the LINE Developers API reference of this method:  [https://developers.line.biz/en/reference/messaging-api/#get-group-summary](https://developers.line.biz/en/reference/messaging-api/#get-group-summary)\n\n## `get_room_member_profile($room_id, $user_id)`\n\nGet room user profile information.\nA room is like a group without a group name.\nThe response is similar to get\\_group\\_member\\_profile.\n\nSee also the LINE Developers API reference of this method:  [https://developers.line.biz/en/reference/messaging-api/#get-room-member-profile](https://developers.line.biz/en/reference/messaging-api/#get-room-member-profile)\n\n## `get_number_of_sent_reply_messages($date)`\n\nGets the number of messages sent with the `/bot/message/reply` endpoint.\n\nThe number of messages retrieved by this operation does not include\nthe number of messages sent from LINE@ Manager.\n\nThe `$date` parameter is \"yyyyMMdd\" format.\n\n## `get_number_of_sent_push_messages($date)`\n\nGets the number of messages sent with the `/bot/message/push` endpoint.\n\nThe number of messages retrieved by this operation does not include the number of messages sent from LINE@ Manager.\n\n- date\n\n    Date the messages were sent\n\n        Format: yyyyMMdd (Example: 20191231)\n        Timezone: UTC+9\n\n## `get_number_of_sent_multicast_messages($date)`\n\nGets the number of messages sent with the `/bot/message/multicast` endpoint.\n\nThe number of messages retrieved by this operation does not include the number of messages sent from LINE@ Manager.\n\n- date\n\n    Date the messages were sent\n\n        Format: yyyyMMdd (Example: 20191231)\n        Timezone: UTC+9\n\n## `get_number_of_send_broadcast_messages($date)`\n\nGets the number of messages sent with the `/bot/message/broadcast` endpoint.\n\nThe number of messages retrieved by this operation does not include the number of messages sent from LINE Official Account Manager.\n\n- date\n\n    Date the messages were sent\n\n        Format: yyyyMMdd (Example: 20191231)\n        Timezone: UTC+9\n\n## `create_rich_menu( $rich_menu_object )`\n\nThis method corresponds to the API of [Creating rich menu](https://developers.line.biz/en/reference/messaging-api/#create-rich-menu)\n\nOne argument is needed: `$rich_menu_object`, which is a plain HashRef representing [rich menu object](https://developers.line.biz/en/reference/messaging-api/#rich-menu-object)\n\n## `get_rich_menu( $rich_menu_id )`\n\nThis method corresponds to the API of [Get rich menu](https://developers.line.biz/en/reference/messaging-api/#get-rich-menu)\n\nOne argument is needed: $rich\\_menu\\_id -- which correspond to the\nrichMenuId property of the object returned by `create_rich_menu`\nmethod.\n\n## `delete_rich_menu( $rich_menu_id )`\n\nThis method corresponds to the API of [Delete rich menu](https://developers.line.biz/en/reference/messaging-api/#delete-rich-menu)\n\nOne argument is needed: $rich\\_menu\\_id -- which correspond to the\nrichMenuId property of the object returned by `create_rich_menu`\nmethod.\n\nThe return value is an empty RichMenu object -- only status code\nmatters. Upon successful deletion, status code 200 is returned.\n\n## `get_rich_menu_list`\n\nThis method corresponds to the API of [Get rich menu list](https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-list)\n\nNo arguments are needed.\n\n## `set_default_rich_menu( $rich_menu_id )`\n\nThis method corresponds to the API of [Set default rich menu](https://developers.line.biz/en/reference/messaging-api/#set-default-rich-menu)\n\nOne argument is needed: $rich\\_menu\\_id -- which correspond to the\nrichMenuId property of the object returned by `create_rich_menu`\nmethod.\n\n## `get_default_rich_menu_id`\n\nThis method corresponds to the API of [Get default rich menu ID](https://developers.line.biz/en/reference/messaging-api/#get-default-rich-menu-id)\n\nNo arguments are needed. The return value is a RichMenu object with only one property: richMenuId.\n\n## `cancel_default_rich_menu`\n\nThis method corresponds to the API of [Cancel default rich menu ID](https://developers.line.biz/en/reference/messaging-api/#cancel-default-rich-menu)\n\n## `link_rich_menu_to_user( $user_id, $rich_menu_id )`\n\nThis method corresponds to the API of [Link rich menu to user](https://developers.line.biz/en/reference/messaging-api/#link-rich-menu-to-user)\n\nBoth of `$user_id` and `$rich_menu_id` are required.\n\n## `link_rich_menu_to_multiple_users( $user_ids, $rich_menu_id )`\n\nThis method corresponds to the API of [Link rich menu to multiple users](https://developers.line.biz/en/reference/messaging-api/#link-rich-menu-to-users)\n\nBoth of `$user_ids` and `$rich_menu_id` are required. `$user_ids`\nshould be an ArrayRef of user ids, while `$rich_menu_id` should be a\nsimple scalar.\n\n## `get_rich_menu_id_of_user( $user_id )`\n\nThis method corresponds to the API of [Get rich menu ID of user](https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-id-of-user)\n\nThe argument `$user_id` is mandatory.  The return value is a RichMenu\nobject with only one property: richMenuId.\n\n## `unlink_rich_menu_from_user( $user_id )`\n\nThis method corresponds to the API of [Unlink rich menu from user](https://developers.line.biz/en/reference/messaging-api/#unlink-rich-menu-from-user)\n\nThe argument `$user_id` is mandatory. The return value is an empty object.\n\n## `unlink_rich_menu_from_multiple_users( $user_ids )`\n\nThis method corresponds to the API of [Unlink rich menu from multiple users](https://developers.line.biz/en/reference/messaging-api/#unlink-rich-menu-from-users)\n\nThe mandatory argument `$user_ids` is an ArrayRef of user ids. The return value is an empty object.\n\n## `validate_rich_menu_object( $rich_menu_object )`\n\nThis method corresponds to the API of [Validate rich menu object](https://developers.line.biz/en/reference/messaging-api/#validate-rich-menu-object)\n\nOne argument is needed: `$rich_menu_object`, which is a plain HashRef representing [rich menu object](https://developers.line.biz/en/reference/messaging-api/#rich-menu-object)\n\n## `issue_channel_access_token({ client_id =\u003e '...', client_secret =\u003e '...' })`\n\nThis method corresponds to the API of: [Issue Channel access token](https://developers.line.biz/en/reference/messaging-api/#issue-channel-access-token)\n\nThe argument is a HashRef with two pairs of mandatory key-values:\n\n    {\n        client_id =\u003e \"...\",\n        client_secret =\u003e \"...\",\n    }\n\nBoth pieces of information can be accquired from the [channel console](https://metacpan.org/pod/client_id).\n\nWhen a 200 OK HTTP response is returned, a new token is issued. In this case, you may want to store the values in \"access\\_token\", \"expires\\_in\", and \"token\\_type\" attributes of the response object for future use.\n\nOtherwise, you my examine the \"error\" attribute and \"error\\_description\" attribute for more information about the error.\n\n## `issue_channel_access_token_v2_1({ jwt =\u003e '...' })`\n\nThis method corresponds to the API of: [Issue Channel access token v2.1](https://developers.line.biz/en/reference/messaging-api/#issue-channel-access-token-v2-1)\n\nThe argument is a HashRef with a pair of mandatory key-values:\n\n    {\n        jwt =\u003e \"...\",\n    }\n\nThis method lets you use JWT assertion for authentication.\n\nWhen a 200 OK HTTP response is returned, a new token is issued. In this case, you may want to store the values in \"access\\_token\", \"expires\\_in\", \"token\\_type\" and \"key\\_id\" attributes of the response object for future use.\n\nOtherwise, you may examine the \"error\" attribute and \"error\\_description\" attribute for more information about the error.\n\n## `get_valid_channel_access_token_v2_1({ jwt =\u003e '...' })`\n\nThis method corresponds to the API of: [Get all valid channel access token key IDs v2.1](https://developers.line.biz/en/reference/messaging-api/#get-all-valid-channel-access-token-key-ids-v2-1)\n\nThe argument is a HashRef with a pair of mandatory key-values:\n\n    {\n        jwt =\u003e \"...\",\n    }\n\nThis method is for getting all valid channel access token key IDs.\n\nWhen a 200 OK HTTP response is returned, a new token is issued. In this case, you may want to store the values in \"key\\_ids\" attributes of the response object for future use.\n\nOtherwise, you may examine the \"error\" attribute and \"error\\_description\" attribute for more information about the error.\n\n## `revoke_channel_access_token({ access_token =\u003e \"...\" })`\n\nThis method corresponds to the API of: [Revoke channel access token](https://developers.line.biz/en/reference/messaging-api/#revoke-channel-access-token)\n\nThe argument is a HashRef with one pair of mandatory key-values;\n\n    { access_token =\u003e \"...\" }\n\nUpon successful revocation, a 200 OK HTTP response is returned. Otherwise, you my examine the \"error\" attribute and \"error\\_description\" attribute for more information about the error.\n\n## `get_number_of_followers({ date =\u003e \"...\" })`\n\nThis method corresponds to the API of: [Get number of followers](https://developers.line.biz/en/reference/messaging-api/#get-number-of-followers)\n\nThe argument is a HashRef with one pair of mandatory key-values;\n\n    { date =\u003e \"20191231\" }\n\nThe formate of date is \"yyyyMMdd\", that is, year in 4 digits, month in\n2 digits, and date-of-month in 2 digits.\n\nUpon successful invocation, a 200 OK HTTP response is\nreturned. Otherwise, you my examine the \"error\" attribute and\n\"error\\_description\" attribute for more information about the error.\n\nThe return value `$res` is a response object with the following read-only accessors\n(see the API documentation for the meaning of each.)\n\n    $res-\u003estatus();          #=\u003e Str, one of: \"ready\", \"unready\", \"out_of_service\"\n    $res-\u003efollowers();       #=\u003e Num\n    $res-\u003etargetedReaches(); #=\u003e Num\n    $res-\u003eblocks();          #=\u003e Num\n\nNotice that the \"status\" does not mean HTTP status. To inspect actual\nHTTP status, invoke `$res-`http\\_status()\u003e.\n\n## `get_user_interaction_statistics({ requestId =\u003e \"...\" })`\n\nReturns statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account.\n\nSee also the LINE Developers API reference of this method: [https://developers.line.biz/en/reference/messaging-api/#get-message-event](https://developers.line.biz/en/reference/messaging-api/#get-message-event)\n\n## `set_webhook_url({ 'endpoint' =\u003e \"https://example.com/webhook\" })`\n\nSets the webhook endpoint to te given `endpoint`, which should be an URL string.\n\nSee also the LINE Developer API reference of this method: [https://developers.line.biz/en/reference/messaging-api/#set-webhook-endpoint-url](https://developers.line.biz/en/reference/messaging-api/#set-webhook-endpoint-url)\n\n## `get_webhook_endpoint_information()`\n\nReturn the information about webhook endpoint as an response object with following accessors:\n\n    $res = $api-\u003eget_webhook_endpoint_information();\n\n    $res-\u003eendpoint(); # URL as a string\n    $res-\u003eactive();   # true or false\n\nSee also the LINE Developer API reference of this method: [https://developers.line.biz/en/reference/messaging-api/#get-webhook-endpoint-information](https://developers.line.biz/en/reference/messaging-api/#get-webhook-endpoint-information)\n\n## `test_webhook_endpoint({ 'endpoint' =\u003e \"https://example.com/webhook\" })`\n\nChecks if the configured webhook endpoint can receive a test webhook event.\n\nSee also the LINE Developer API reference of this method: [https://developers.line.biz/en/reference/messaging-api/#get-webhook-endpoint-information](https://developers.line.biz/en/reference/messaging-api/#get-webhook-endpoint-information)\n\n## `validate_reply_message_objects([ $message, ... ] )`\n\nValidates that an array of message objects is valid as a value for the messages property of the request body for the Send reply message endpoint.\n\nSee also the LINE Developer API reference of this method: [https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-reply-message](https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-reply-message)\n\n## `validate_push_message_objects([ $message, ... ] )`\n\nValidates that an array of message objects is valid as a value for the messages property of the request body for the Send push message endpoint.\n\nSee also the LINE Developer API reference of this method: [https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-push-message](https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-push-message)\n\n## `validate_multicast_message_objects([ $message, ... ] )`\n\nValidates that an array of message objects is valid as a value for the messages property of the request body for the Send multicast message endpoint.\n\nSee also the LINE Developer API reference of this method: [https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-multicast-message](https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-multicast-message)\n\n## `validate_narrowcast_message_objects([ $message, ... ] )`\n\nValidates that an array of message objects is valid as a value for the messages property of the request body for the Send narrowcast message endpoint.\n\nSee also the LINE Developer API reference of this method: [https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-narrowcast-message](https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-narrowcast-message)\n\n## `validate_broadcast_message_objects([ $message, ... ] )`\n\nValidates that an array of message objects is valid as a value for the messages property of the request body for the Send broadcast message endpoint.\n\nSee also the LINE Developer API reference of this method: [https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-broadcast-message](https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-broadcast-message)\n\n## `get_followers({ 'limit' =\u003e 100, 'start' =\u003e \"...\" })`\n\nGets the list of User IDs of users who have added LINE Official Account as a friend.\n\nSee also the LINE Developer API reference of this method: [https://developers.line.biz/en/reference/messaging-api/#get-follower-ids](https://developers.line.biz/en/reference/messaging-api/#get-follower-ids)\n\n# How to build a send message object\n\nSee the LINE Developers API reference about [Message objects](https://developers.line.biz/en/reference/messaging-api/#message-objects)\n\nWhen the `LINE::Bot::API::Builder::SendMessage` class is used, it is possible easily to build a send message object.\nThat class supports a fluent interface.\n\n    my $messages = LINE::Bot::API::Builder::SendMessage-\u003enew(\n    )-\u003eadd_text(\n        text =\u003e 'Closing the distance',\n    )-\u003eadd_image(\n        image_url   =\u003e 'http://example.com/image.jpg',\n        preview_url =\u003e 'http://example.com/image_preview.jpg',\n    );\n    $bot-\u003ereply_message($reply_token, $messages-\u003ebuild);\n\n## Text type\n\nBuild a text type object.\n\n    my $messages = LINE::Bot::API::Builder::SendMessage-\u003enew(\n    )-\u003eadd_text(\n        text =\u003e 'Closing the distance',\n    );\n    $bot-\u003ereply_message($reply_token, $messages-\u003ebuild);\n\nBuild a text message with emojis inside:\n\n    my $message = LINE::Bot::API::Builder::SendMessage-\u003enew();\n    $message-\u003eadd_text(\n        text =\u003e '$ LINE Emoji $',\n        emojis =\u003e [\n            +{\n                \"index\" =\u003e 0,\n                \"productId\" =\u003e \"5ac1bfd5040ab15980c9b435\",\n                \"emojiId\" =\u003e \"001\"\n            },\n            +{\n                \"index\" =\u003e 13,\n                \"productId\" =\u003e \"5ac1bfd5040ab15980c9b435\",\n                \"emojiId\" =\u003e \"002\"\n            }\n        ]\n    );\n\nSince 2020/04/16, text messages may contain LINE emojis. They are identified by (productId, emojiId). For more details about possible values as well as how to use these emojis, please read: [https://developers.line.biz/en/reference/messaging-api/#text-message](https://developers.line.biz/en/reference/messaging-api/#text-message) first.\n\n## Image type\n\nBuild an image type object.\n\n    my $messages = LINE::Bot::API::Builder::SendMessage-\u003enew(\n    )-\u003eadd_image(\n        image_url   =\u003e 'http://example.com/image.jpg',\n        preview_url =\u003e 'http://example.com/image_preview.jpg',\n    );\n    $bot-\u003ereply_message($reply_token, $messages-\u003ebuild);\n\n## Video type\n\nBuild a video type object.\n\n    my $messages = LINE::Bot::API::Builder::SendMessage-\u003enew(\n    )-\u003eadd_video(\n        video_url   =\u003e 'http://example.com/video.mp4',\n        preview_url =\u003e 'http://example.com/video_preview.jpg',\n    );\n    $bot-\u003ereply_message($reply_token, $messages-\u003ebuild);\n\n## Audio type\n\nBuild an audio type object.\n\n    my $messages = LINE::Bot::API::Builder::SendMessage-\u003enew(\n    )-\u003eadd_audio(\n        audio_url =\u003e 'http://example.com/image.m4a',\n        duration  =\u003e 3601_000, # msec\n    );\n    $bot-\u003ereply_message($reply_token, $messages-\u003ebuild);\n\n## Location type\n\nBuild a location type object.\n\n    my $messages = LINE::Bot::API::Builder::SendMessage-\u003enew(\n    )-\u003eadd_location(\n        title     =\u003e 'LINE Corporation.',\n        address   =\u003e 'Hikarie  Shibuya-ku Tokyo 151-0002',\n        latitude  =\u003e 35.6591,\n        longitude =\u003e 139.7040,\n    );\n    $bot-\u003ereply_message($reply_token, $messages-\u003ebuild);\n\n## Sticker type\n\nBuild a sticker type object.\n\n    my $messages = LINE::Bot::API::Builder::SendMessage-\u003enew(\n    )-\u003eadd_sticker(\n        package_id =\u003e '1',\n        sticker_id =\u003e '2',\n    );\n    $bot-\u003ereply_message($reply_token, $messages-\u003ebuild);\n\n## Imagemap type\n\nTo build a message of imagemap type, you may use a helper module.\n\n    my $imagemap = LINE::Bot::API::Builder::ImagemapMessage-\u003enew(\n        base_url    =\u003e 'https://example.com/bot/images/rm001',\n        alt_text    =\u003e 'this is an imagemap',\n        base_width  =\u003e 1040,\n        base_height =\u003e 1040,\n    )-\u003eadd_uri_action(\n        uri         =\u003e 'http://example.com/',\n        area_x      =\u003e 0,\n        area_y      =\u003e 0,\n        area_width  =\u003e 1040,\n        area_height =\u003e 520,\n    )-\u003eadd_message_action(\n        text        =\u003e 'message',\n        area_x      =\u003e 0,\n        area_y      =\u003e 520,\n        area_width  =\u003e 1040,\n        area_height =\u003e 520,\n    );\n\n    my $messages = LINE::Bot::API::Builder::SendMessage-\u003enew(\n    )-\u003eadd_imagemap($imagemap-\u003ebuild);\n    $bot-\u003ereply_message($reply_token, $messages-\u003ebuild);\n\nAn Imagemap message can contain a video area inside. Here is an example of one withe upper half being a video overlay:\n\n    my $imagemap_message = LINE::Bot::API::Builder::ImagemapMessage-\u003enew(\n        base_url    =\u003e 'https://example.com/bot/images/rm001',\n        alt_text    =\u003e 'this is an imagemap',\n        base_width  =\u003e 1040,\n        base_height =\u003e 1040,\n        video =\u003e {\n            originalContentUrl =\u003e \"https://example.com/video.mp4\",\n            previewImageUrl =\u003e \"https://example.com/video_preview.jpg\",\n            area =\u003e {\n                x =\u003e 0,\n                y =\u003e 0,\n                width =\u003e 1040,\n                height =\u003e 585\n            }\n        }\n    )-\u003ebuild;\n\nFor more detail about Imagemap message, see: [https://developers.line.biz/en/reference/messaging-api/#imagemap-message](https://developers.line.biz/en/reference/messaging-api/#imagemap-message)\n\n## Template type\n\nBuild a template type object.\nYou can use a helper module for the template type.\n\n### Buttons type\n\n    my $buttons = LINE::Bot::API::Builder::TemplateMessage-\u003enew_buttons(\n        alt_text  =\u003e 'this is a buttons template',\n        image_url =\u003e 'https://example.com/bot/images/image.jpg',\n        title     =\u003e 'buttons',\n        text      =\u003e 'description',\n    )-\u003eadd_postback_action(\n        label =\u003e 'postback',\n        data  =\u003e 'postback data',\n        text  =\u003e 'postback message',\n    )-\u003eadd_message_action(\n        label =\u003e 'message',\n        text  =\u003e 'message',\n    )-\u003eadd_uri_action(\n        label =\u003e 'uri',\n        uri   =\u003e 'http://example.com/',\n    )-\u003eadd_message_action(\n        label =\u003e 'message2',\n        text  =\u003e 'message2',\n    );\n\n    my $messages = LINE::Bot::API::Builder::SendMessage-\u003enew(\n    )-\u003eadd_template($buttons-\u003ebuild);\n    $bot-\u003ereply_message($reply_token, $messages-\u003ebuild);\n\n### Confirm type\n\n    my $confirm = LINE::Bot::API::Builder::TemplateMessage-\u003enew_confirm(\n        alt_text =\u003e 'this is a confirm template',\n        text     =\u003e 'confirm',\n    )-\u003eadd_postback_action(\n        label =\u003e 'postback',\n        data  =\u003e 'postback data',\n        text  =\u003e 'postback message',\n    )-\u003eadd_message_action(\n        label =\u003e 'message',\n        text  =\u003e 'message',\n    )-\u003eadd_uri_action(\n        label =\u003e 'uri',\n        uri   =\u003e 'http://example.com/',\n    );\n\n    my $messages = LINE::Bot::API::Builder::SendMessage-\u003enew(\n    )-\u003eadd_template($confirm-\u003ebuild);\n    $bot-\u003ereply_message($reply_token, $messages-\u003ebuild);\n\n### Carousel type\n\n    my $carousel = LINE::Bot::API::Builder::TemplateMessage-\u003enew_carousel(\n        alt_text =\u003e 'this is a carousel template',\n    );\n    for my $i (1..5) {\n        my $column = LINE::Bot::API::Builder::TemplateMessage::Column-\u003enew(\n            image_url =\u003e 'https://example.com/bot/images/item.jpg',\n            title     =\u003e \"carousel $i\",\n            text      =\u003e \"description $i\",\n        )-\u003eadd_postback_action(\n            label =\u003e 'postback',\n            data  =\u003e 'postback data',\n            text  =\u003e 'postback message',\n        )-\u003eadd_message_action(\n            label =\u003e 'message',\n            text  =\u003e 'message',\n        )-\u003eadd_uri_action(\n            label =\u003e 'uri',\n            uri   =\u003e 'http://example.com/',\n        );\n        $carousel-\u003eadd_column($column-\u003ebuild);\n    }\n\n    my $messages = LINE::Bot::API::Builder::SendMessage-\u003enew(\n    )-\u003eadd_template($carousel-\u003ebuild);\n    $bot-\u003ereply_message($reply_token, $messages-\u003ebuild);\n\n### Image Carousel type\n\n    my $carousel = LINE::Bot::API::Builder::TemplateMessage-\u003enew_image_carousel(\n        alt_text =\u003e 'this is a image carousel template',\n    );\n\n    my $column1 = LINE::Bot::API::Builder::TemplateMessage::ImageColumn-\u003enew(\n        image_url =\u003e 'https://example.com/bot/images/item1.jpg',\n    )-\u003eadd_postback_action(\n        label =\u003e 'postback',\n        data  =\u003e 'postback data',\n        text  =\u003e 'postback message',\n    );\n    $carousel-\u003eadd_column($column1-\u003ebuild);\n\n    my $column2 = LINE::Bot::API::Builder::TemplateMessage::ImageColumn-\u003enew(\n        image_url =\u003e 'https://example.com/bot/images/item2.jpg',\n    )-\u003eadd_message_action(\n        label =\u003e 'message',\n        text  =\u003e 'message',\n    );\n    $carousel-\u003eadd_column($column2-\u003ebuild);\n\n    my $column3 = LINE::Bot::API::Builder::TemplateMessage::ImageColumn-\u003enew(\n        image_url =\u003e 'https://example.com/bot/images/item3.jpg',\n    )-\u003eadd_uri_action(\n        label =\u003e 'uri',\n        uri   =\u003e 'http://example.com/',\n    );\n    $carousel-\u003eadd_column($column3-\u003ebuild);\n\n    my $messages = LINE::Bot::API::Builder::SendMessage-\u003enew(\n    )-\u003eadd_template($carousel-\u003ebuild);\n    $bot-\u003ereply_message($reply_token, $messages-\u003ebuild);\n\n## Handling Retries\n\nFor many methods that sends outgoing messages, the last parameter\n`$options` is a HashRef with certain key-value pairs.\n\nAt the moment, the key 'retry\\_key' is recognized. It shall be provided\nto retry without causing duplicates.\n\nFor example, here's a short snippet to attemp to retry a push\\_message\nwithout resending duplicate messages:\n\n    my $k = create_UUID_as_string();\n    my $res = $bot-\u003epush_message(\n        $user_id,\n        $message,\n        { 'retry_key' =\u003e $k }\n    );\n\n    unless ($res-\u003eis_success) {\n        while ($res-\u003ehttp_status ne '409') {\n            sleep(60);\n\n            $res = $bot-\u003epush_message(\n                $user_id,\n                $message,\n                { 'retry_key' =\u003e $k }\n            );\n        }\n    }\n\nThe value of 'retry\\_key' must be an UUID string. The example above\nuses the `create_UUID_as_string()` function provided by [UUID::Tiny](https://metacpan.org/pod/UUID%3A%3ATiny)\nand should just work.\n\nThe value of 'retry\\_key' is essentially value of an HTTP header name 'X-Line-Retry-Key'. Read more about retrying a failed push\\_message at: [https://developers.line.biz/en/reference/messaging-api/#retry-api-request](https://developers.line.biz/en/reference/messaging-api/#retry-api-request)\n\n# AUTHORS\n\nLINE Corporation.\n\n# COPYRIGHT\n\nCopyright 2016-2021\n\n# LICENSE\n\nThis Software Development Kit is licensed under The Artistic License 2.0.\nYou may obtain a copy of the License at\nhttps://opensource.org/licenses/Artistic-2.0\n\n# SEE ALSO\n\n[LINE::Bot::API::Event](https://metacpan.org/pod/LINE%3A%3ABot%3A%3AAPI%3A%3AEvent),\n[https://developers.line.biz/](https://developers.line.biz/),\n[https://at.line.me/](https://at.line.me/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fline%2Fline-bot-sdk-perl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fline%2Fline-bot-sdk-perl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fline%2Fline-bot-sdk-perl/lists"}