From 340fab3a81dbf86f57590f7e62f779b5028e06e1 Mon Sep 17 00:00:00 2001 From: Aaron Schuman Date: Fri, 4 Mar 2022 08:50:06 -0800 Subject: [PATCH 1/2] adds tag list docs --- docs/index.rst | 1 + docs/tag_lists.rst | 76 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 docs/tag_lists.rst diff --git a/docs/index.rst b/docs/index.rst index 8056020..d011e4e 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -66,6 +66,7 @@ Contents: named_user.rst reports.rst static_lists.rst + tag_lists.rst exceptions.rst examples.rst create_and_send.rst diff --git a/docs/tag_lists.rst b/docs/tag_lists.rst new file mode 100644 index 0000000..df26ed3 --- /dev/null +++ b/docs/tag_lists.rst @@ -0,0 +1,76 @@ +Tag Lists +========= + +Bulk add and/or remove tags by uploading a CSV file of Airship users. For more +information about the use of this endpoint, incluiding CSV file formatting requirements +please see `the Airship Tag Lists API documentation +`__ + + +Create List +----------- + +Add tags to your contacts by creating a list and uploading CSV file with user identifiers. +The body of the request contains the name, description, and optional metadata for the +list. After you define a list, you populate it with a call to the Upload Tag List method. + +.. code-block:: ruby + + require 'urbanairship' + UA = Urbanairship + airship = UA::Client.new(key: 'app_key', secret: 'master_secret') + tags = {'tag_group_name': ['tag1', 'tag2']} + + tag_list = UA::TagList.new(client: airship) + tag_list.name = 'ua_tags_list_name' + tag_list.create(description: 'description', extra: {'key': 'value'}, add: tags) + + +Upload List +----------- + +Upload a CSV that will set tag values on the specified channels or named users. See `the +Airship API documentation `__ for CSV formatting requirements. Set +the optional `gzip` parameter to `true` if your file is gzip compressed. + +.. code-block:: ruby + + require 'urbanairship' + UA = Urbanairship + airship = UA::Client.new(key: 'app_key', secret: 'master_secret') + + tag_list = UA::TagList.new(client: airship) + tag_list.name = 'ua_tags_list_name' + tag_list.upload(csv_file: 'file_content', gzip: true) + + +Dowload List Errors +------------------- + +During processing, after a list is uploaded, errors can occur. Depending on the type +of list processing, an error file may be created, showing a user exactly what went wrong. + +.. code-block:: ruby + + require 'urbanairship' + UA = Urbanairship + airship = UA::Client.new(key: 'app_key', secret: 'master_secret') + + tag_list = UA::TagList.new(client: airship) + error_csv = tag_list.errors + + +Retrieve All Tag Lists +---------------------- + +Retrieve information about all tag lists. This call returns a list of metadata that +will not contain the actual lists of users. + +.. code-block:: ruby + + require 'urbanairship' + UA = Urbanairship + airship = UA::Client.new(key: 'app_key', secret: 'master_secret') + + tag_list = UA::TagList.new(client: airship) + list_response = tag_list.list \ No newline at end of file From 5bba4682e6f16a3787322add1496827def5a07e0 Mon Sep 17 00:00:00 2001 From: Aaron Schuman Date: Fri, 4 Mar 2022 09:21:27 -0800 Subject: [PATCH 2/2] typo fix --- docs/tag_lists.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tag_lists.rst b/docs/tag_lists.rst index df26ed3..51d904c 100644 --- a/docs/tag_lists.rst +++ b/docs/tag_lists.rst @@ -2,7 +2,7 @@ Tag Lists ========= Bulk add and/or remove tags by uploading a CSV file of Airship users. For more -information about the use of this endpoint, incluiding CSV file formatting requirements +information about the use of this endpoint, incluiding CSV file formatting requirements please see `the Airship Tag Lists API documentation `__