@@ -673,6 +673,154 @@ def delete_liff_app(liff_id)
673
673
delete ( liff_endpoint , endpoint_path , credentials )
674
674
end
675
675
676
+ # Create an audience group by uploading user_ids
677
+ #
678
+ # Parameters are described here.
679
+ # https://developers.line.biz/en/reference/messaging-api/#create-upload-audience-group
680
+ #
681
+ # @param params [Hash] options
682
+ #
683
+ # @return [Net::HTTPResponse] This response includes an audience_group_id.
684
+ def create_user_id_audience ( params )
685
+ channel_token_required
686
+
687
+ endpoint_path = '/bot/audienceGroup/upload'
688
+ post ( endpoint , endpoint_path , params . to_json , credentials )
689
+ end
690
+
691
+ # Update an audience group
692
+ #
693
+ # Parameters are described here.
694
+ # https://developers.line.biz/en/reference/messaging-api/#update-upload-audience-group
695
+ #
696
+ # @param params [Hash] options
697
+ #
698
+ # @return [Net::HTTPResponse] This response includes an audience_group_id.
699
+ def update_user_id_audience ( params )
700
+ channel_token_required
701
+
702
+ endpoint_path = '/bot/audienceGroup/upload'
703
+ put ( endpoint , endpoint_path , params . to_json , credentials )
704
+ end
705
+
706
+ # Create an audience group of users that clicked a URL in a message sent in the past
707
+ #
708
+ # Parameters are described here.
709
+ # https://developers.line.biz/en/reference/messaging-api/#create-click-audience-group
710
+ #
711
+ # @param params [Hash] options
712
+ #
713
+ # @return [Net::HTTPResponse] This response includes an audience_group_id.
714
+ def create_click_audience ( params )
715
+ channel_token_required
716
+
717
+ endpoint_path = '/bot/audienceGroup/click'
718
+ post ( endpoint , endpoint_path , params . to_json , credentials )
719
+ end
720
+
721
+ # Create an audience group of users that opened a message sent in the past
722
+ #
723
+ # Parameters are described here.
724
+ # https://developers.line.biz/en/reference/messaging-api/#create-imp-audience-group
725
+ #
726
+ # @param params [Hash] options
727
+ #
728
+ # @return [Net::HTTPResponse] This response includes an audience_group_id.
729
+ def create_impression_audience ( params )
730
+ channel_token_required
731
+
732
+ endpoint_path = '/bot/audienceGroup/imp'
733
+ post ( endpoint , endpoint_path , params . to_json , credentials )
734
+ end
735
+
736
+ # Rename an existing audience group
737
+ #
738
+ # @param audience_group_id [Integer]
739
+ # @param description [String]
740
+ #
741
+ # @return [Net::HTTPResponse]
742
+ def rename_audience ( audience_group_id , description )
743
+ channel_token_required
744
+
745
+ endpoint_path = "/bot/audienceGroup/#{ audience_group_id } /updateDescription"
746
+ body = { description : description }
747
+ put ( endpoint , endpoint_path , body . to_json , credentials )
748
+ end
749
+
750
+ # Delete an existing audience group
751
+ #
752
+ # Parameters are described here.
753
+ # https://developers.line.biz/en/reference/messaging-api/#delete-audience-group
754
+ #
755
+ # @param audience_group_id [Integer]
756
+ #
757
+ # @return [Net::HTTPResponse]
758
+ def delete_audience ( audience_group_id )
759
+ channel_token_required
760
+
761
+ endpoint_path = "/bot/audienceGroup/#{ audience_group_id } "
762
+ delete ( endpoint , endpoint_path , credentials )
763
+ end
764
+
765
+ # Get audience group data
766
+ #
767
+ # Parameters are described here.
768
+ # https://developers.line.biz/en/reference/messaging-api/#get-audience-group
769
+ #
770
+ # @param audience_group_id [Integer]
771
+ #
772
+ # @return [Net::HTTPResponse]
773
+ def get_audience ( audience_group_id )
774
+ channel_token_required
775
+
776
+ endpoint_path = "/bot/audienceGroup/#{ audience_group_id } "
777
+ get ( endpoint , endpoint_path , credentials )
778
+ end
779
+
780
+ # Get data for more than one audience group
781
+ #
782
+ # Parameters are described here.
783
+ # https://developers.line.biz/en/reference/messaging-api/#get-audience-groups
784
+ #
785
+ # @param params [Hash] key name `page` is required
786
+ #
787
+ # @return [Net::HTTPResponse]
788
+ def get_audiences ( params )
789
+ channel_token_required
790
+
791
+ endpoint_path = "/bot/audienceGroup/list?" + URI . encode_www_form ( params )
792
+ get ( endpoint , endpoint_path , credentials )
793
+ end
794
+
795
+ # Get the authority level of the audience
796
+ #
797
+ # Parameters are described here.
798
+ # https://developers.line.biz/en/reference/messaging-api/#get-authority-level
799
+ #
800
+ # @return [Net::HTTPResponse]
801
+ def get_audience_authority_level
802
+ channel_token_required
803
+
804
+ endpoint_path = "/bot/audienceGroup/authorityLevel"
805
+ get ( endpoint , endpoint_path , credentials )
806
+ end
807
+
808
+ # Change the authority level of the audience
809
+ #
810
+ # Parameters are described here.
811
+ # https://developers.line.biz/en/reference/messaging-api/#change-authority-level
812
+ #
813
+ # @param authority_level [String] value must be `PUBLIC` or `PRIVATE`
814
+ #
815
+ # @return [Net::HTTPResponse]
816
+ def update_audience_authority_level ( authority_level )
817
+ channel_token_required
818
+
819
+ endpoint_path = "/bot/audienceGroup/authorityLevel"
820
+ body = { authorityLevel : authority_level }
821
+ put ( endpoint , endpoint_path , body . to_json , credentials )
822
+ end
823
+
676
824
# Fetch data, get content of specified URL.
677
825
#
678
826
# @param endpoint_base [String]
0 commit comments