From db3eff619f08d7f35f822e14af6c20d9e4f07a53 Mon Sep 17 00:00:00 2001 From: Karthika Raman Date: Thu, 21 Jul 2022 16:41:29 -0700 Subject: [PATCH 1/8] First Draft for adding webhooks Issue ID #739 TFS ID 1438037 --- docs/api-ref.md | 182 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 179 insertions(+), 3 deletions(-) diff --git a/docs/api-ref.md b/docs/api-ref.md index 9832ac0ec..a3950d2d9 100644 --- a/docs/api-ref.md +++ b/docs/api-ref.md @@ -4700,19 +4700,195 @@ See [ViewItem class](#viewitem-class) --- +## Webhooks +Using the Tableau Server Client, you can create a new webhook, get a list of all the Webhooks or informaton about a specific webhook, or delete a webhook. The Webhook resource for Tableau Server and Tableau Cloud are defined in the WebhookItem class. The class corresponds to the Webhook resources you can access using the Tableau REST API. For example, you can gather information about a workbook, like the name of the Webbook, the event it is associated with, and the destination URL. +### WebhookItem class +The `WebhookItem` represents the Webhook resources on Tableau Server. This is the information that can be sent or returned in the response to a REST API request for Webhooks. -## Workbooks +**Attributes** +Name | Description +:--- | :--- +`id` | The identifier (*luid*) for the webhook. You need this value to query a specific Webhook with the `get_by_id` method or to delete a Webhook with the `delete` method. +`name` | The name of the webhook. You must specify this when you create an instance of the `WebhookItem`. +`url` | The destination URL for the webhook. The webhook destination URL must be https and have a valid certificate. You must specify this when you create an instance of the `WebhookItem`. +`event` | The name of the Tableau event that triggers your webhook.This is either `api-event-name` or `webhook-source-api-event-name`: one of this is required to create an instance of the `WebhookItem`.
The event name must be one of the supported events listed in the Trigger Events table. The event and webhook-source use different name values for the same event.  +`owner_id` | The identifier of the owner of the webhook. -Using the TSC library, you can get information about a specific workbook or all the workbooks on a site, and you can publish, update, or delete workbooks. +**Example** -The project resources for Tableau are defined in the `WorkbookItem` class. The class corresponds to the workbook resources you can access using the Tableau REST API. The workbook methods are based upon the endpoints for projects in the REST API and operate on the `WorkbookItem` class. +```py + import tableauserverclient as TSC + + # Create new Webhook_item + + new_webhook = TSC.WebhookItem() +``` +Source file: models/webhook_item.py + +
+
+ +### Webhook methods +The Tableau Server Client provides several methods for interacting with webhook resources, or endpoints. These methods correspond to endpoints in the Tableau REST API. + +Source file: server/endpoint/webhooks_endpoint.py + +
+
+ +#### webhook.get +```py +webhooks.create(webhook_item) + +``` +Creates a new webhook on a specified site. + +To create a webhook, you must first create a new instance of a `WebhookItem` and pass it to the create method. + +To specify the site to create the new webhook in, create a `TableauAuth` instance using the content URL for the site `(site_id)` and sign in to that site. For more information on how to specify a site, see the [TableauAuth class](#tableauauth-class). + +REST API: [Create Webhook](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_notifications.htm#create_webhook) +##### **Parmeters** +Name | Description +:--- | :--- +webhook_item | Specifies the properties for the webhook. The webhook_item is the request package. To create a request package, create a new instance of `WebhokItem`. The `WebhookItem` includes the `name`, destination `url`, and the `event` or `source`. The `event` or `source` specifies the Tableau event that should be associated with the webhook. + +**Returns** Returns the new webhook item. + +**Example** +```py +# import tableauserverclient as TSC +# server = TSC.Server('https://SERVER') +# sign in, etc +--- + # create a webhook item + new_webhook = TSC.WebhookItem() + new_webhook.name ='krtestWebhook' + new_webhook.event ="webhook-refresh-failed" + new_webhook.source ="webhook-source-event-workbook-refresh-failed" + new_webhook.url ="https://webhook.site/6e4c957d-dd40-422c-8fc6-7151afe7fc0b" + # create the webhook + new_webhook = server.webhooks.create(new_webhook) + print("Webhook created. ID: {}".format(new_webhook.id)) +``` +

+ +### webhook.delete +```py +webhooks.delete(webhook_id) +``` + +Deletes a webhook by ID. + +To specify the site, create a `TableauAuth` instance using the content URL for the site `(site_id)` and sign in to the site. For more information on how to specify a site, see the [TableauAuth class](#tableauauth-class). + +REST API: [Delete Webhook](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_notifications.htm#delete_webhook) + +**Parameters** +Name|Description +:---|:--- +`webhook_id`| The ID of the webhook to delete. + +**Exceptions** +Error|Description +:---|:--- +`Webhook ID undefined`| Raises an exception if a `webhook_id` is not provided. + +**Example** +```py +# import tableauserverclient as TSC +# server = TSC.Server('https://SERVER') +# sign in, etc +--- +# Delete the webhook +server.webhooks.delete('7d60d364-b9f5-4a9c-8aa5-4bdaa38c5dd3') +``` +
+
+ +#### webhook.get() +```py +webhooks.get() +``` +Returns a list of all the webhooks for a site. +To specify the site, create a `TableauAuth` instance using the content URL for the site `(site_id)`, and sign in to that site. For more information on how to specify a site, see the [TableauAuth class](#tableauauth-class). + +REST API: [List Webhooks](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_notifications.htm#list_webhooks_for_site) + + +**Parameters** +Name |Description +:---|:--- +`req_option`| (Optional) You can pass themthod oa request object that contains additional parameters to filter the request. For example, you could specify the name of the webhook or the name of the owner. For more information, see [Filter and Sort](filter-sort). + +**Returns** + +Returns a list of all `ProjectItem` objects and a `PagainationItem`. Use these values to iterate through the results. + +**Example** + +```py +# import tableauserverclient as TSC +# server = TSC.Server('https://SERVER') +# sign in, etc +--- +# get a list of all the webhooks on a site +all_webhook_items, pagination_item = server.webhooks.get() + print("\nThere are {} webhooks on site: ".format(pagination_item.total_available)) + print([webhook.name for webhook in all_webhooks]) + +``` + +#### webhook.get_by_id + +```py +webhooks.get_by_ide(webhook_id) +``` + +Returns information about the specified workbook for a site. + +To specify the site, create a `TableauAuth` instance using the content URL for the site `(site_id)`, and sign in to that site. For more information on how to specify a site, see the [TableauAuth class](#tableauauth-class). + +**Parameters** + +Name|Description +:---|:--- +`webhook_id`| The ID of the webhook. The ID is a *luid*. + +**Exceptions** +Error|Description +:---|:--- +`Webhook ID undefined`| Raises an exception if a `webhook_id` is not provided. + + +**Example** +```py +# import tableauserverclient as TSC +# server = TSC.Server('https://SERVER') +# sign in, etc +--- +webhook = server.webhooks.get_by_id ('7d60d364-b9f5-4a9c-8aa5-4bdaa38c5dd3') +print (webhook.name, webhook.url) + + +``` +
+
+ +--- +## Workbooks + +Using the TSC library, you can get information about a specific workbook or all the workbooks on a site, and you can publish, update, or delete workbooks. + +The project resources for Tableau are defined in the `WorkbookItem` class. The class corresponds to the workbook resources you can access using the Tableau REST API. The workbook methods are based upon the endpoints for projects in the REST API and operate on the `WorkbookItem` class. +
### WorkbookItem class From 589bab99e5a8239a50dee75bb6985273259bd861 Mon Sep 17 00:00:00 2001 From: Karthika Raman Date: Tue, 2 Aug 2022 12:51:58 -0700 Subject: [PATCH 2/8] Adding to TOC, making formatting changes, and updated sample code post testing --- Gemfile | 2 ++ _includes/docs_menu.html | 2 ++ docs/api-ref.md | 58 ++++++++++++++++++++++++++++------------ 3 files changed, 45 insertions(+), 17 deletions(-) diff --git a/Gemfile b/Gemfile index 775d954bf..58f84459c 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,5 @@ source 'https://rubygems.org' gem 'github-pages', group: :jekyll_plugins + +gem "webrick", "~> 1.7" diff --git a/_includes/docs_menu.html b/_includes/docs_menu.html index 012ad2cd5..b8026fc6f 100644 --- a/_includes/docs_menu.html +++ b/_includes/docs_menu.html @@ -81,6 +81,8 @@
  • Views +
  • + Webhooks
  • Workbooks diff --git a/docs/api-ref.md b/docs/api-ref.md index a3950d2d9..20078bc16 100644 --- a/docs/api-ref.md +++ b/docs/api-ref.md @@ -4701,18 +4701,29 @@ See [ViewItem class](#viewitem-class) --- ## Webhooks -Using the Tableau Server Client, you can create a new webhook, get a list of all the Webhooks or informaton about a specific webhook, or delete a webhook. The Webhook resource for Tableau Server and Tableau Cloud are defined in the WebhookItem class. The class corresponds to the Webhook resources you can access using the Tableau REST API. For example, you can gather information about a workbook, like the name of the Webbook, the event it is associated with, and the destination URL. +
    +
    +Using the Tableau Server Client (TSC), you can create a new webhook, get a list of all the Webhooks, get details about a specific webhook, or delete a webhook. +
    + +The Webhook resource for Tableau Server and Tableau Cloud are defined in the WebhookItem class. The class corresponds to the Webhook resources you can access using the Tableau REST API. For example, using REST API, you can gather information about a workbook, like the name of the Webbook, the event it is associated with, and the destination URL, and you can get the same information using TSC as well. +
    + +Tableau Webhook REST API endpoints are available in **REST API version 3.16** and later. +
    +
    ### WebhookItem class -The `WebhookItem` represents the Webhook resources on Tableau Server. This is the information that can be sent or returned in the response to a REST API request for Webhooks. +The `WebhookItem` represents the Webhook resources on Tableau Server or Tableau Cloud. This is the information that can be sent or returned in response to a REST API request for Webhooks. **Attributes** + Name | Description :--- | :--- `id` | The identifier (*luid*) for the webhook. You need this value to query a specific Webhook with the `get_by_id` method or to delete a Webhook with the `delete` method. `name` | The name of the webhook. You must specify this when you create an instance of the `WebhookItem`. `url` | The destination URL for the webhook. The webhook destination URL must be https and have a valid certificate. You must specify this when you create an instance of the `WebhookItem`. -`event` | The name of the Tableau event that triggers your webhook.This is either `api-event-name` or `webhook-source-api-event-name`: one of this is required to create an instance of the `WebhookItem`.
    The event name must be one of the supported events listed in the Trigger Events table. The event and webhook-source use different name values for the same event.  +`event` | The name of the Tableau event that triggers your webhook.This is either `api-event-name` or `webhook-source-api-event-name`: one of this is required to create an instance of the `WebhookItem`.
    The event name must be one of the supported events listed in the Trigger Events table. The event and webhook-source use different name values for the same event. `owner_id` | The identifier of the owner of the webhook. **Example** @@ -4737,7 +4748,7 @@ Source file: server/endpoint/webhooks_endpoint.py

    -#### webhook.get +#### webhook.create ```py webhooks.create(webhook_item) @@ -4756,21 +4767,22 @@ Name | Description :--- | :--- webhook_item | Specifies the properties for the webhook. The webhook_item is the request package. To create a request package, create a new instance of `WebhokItem`. The `WebhookItem` includes the `name`, destination `url`, and the `event` or `source`. The `event` or `source` specifies the Tableau event that should be associated with the webhook. -**Returns** Returns the new webhook item. +**Returns** +Returns the new webhook item. **Example** ```py # import tableauserverclient as TSC # server = TSC.Server('https://SERVER') -# sign in, etc +# sign in . For authentication examples, see https://github.com/tableau/server-client-python/blob/master/samples/login.py --- # create a webhook item + with server.auth.sign_in(tableau_auth): new_webhook = TSC.WebhookItem() - new_webhook.name ='krtestWebhook' - new_webhook.event ="webhook-refresh-failed" - new_webhook.source ="webhook-source-event-workbook-refresh-failed" + new_webhook.name ='testWebhook' + new_webhook.event ="workbook-refresh-failed" # alternately, you can also use new_webhook.source="webhook-source-event-workbook-refresh-failed" new_webhook.url ="https://webhook.site/6e4c957d-dd40-422c-8fc6-7151afe7fc0b" # create the webhook new_webhook = server.webhooks.create(new_webhook) @@ -4792,11 +4804,13 @@ To specify the site, create a `TableauAuth` instance using the content URL for t REST API: [Delete Webhook](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_notifications.htm#delete_webhook) **Parameters** + Name|Description :---|:--- `webhook_id`| The ID of the webhook to delete. **Exceptions** + Error|Description :---|:--- `Webhook ID undefined`| Raises an exception if a `webhook_id` is not provided. @@ -4805,10 +4819,11 @@ Error|Description ```py # import tableauserverclient as TSC # server = TSC.Server('https://SERVER') -# sign in, etc +# sign in . For authentication examples, see https://github.com/tableau/server-client-python/blob/master/samples/login.py --- # Delete the webhook -server.webhooks.delete('7d60d364-b9f5-4a9c-8aa5-4bdaa38c5dd3') +with server.auth.sign_in(tableau_auth): + server.webhooks.delete('7d60d364-b9f5-4a9c-8aa5-4bdaa38c5dd3') ```

    @@ -4824,6 +4839,7 @@ REST API: [List Webhooks](https://help.tableau.com/current/api/rest_api/en-us/RE **Parameters** + Name |Description :---|:--- `req_option`| (Optional) You can pass themthod oa request object that contains additional parameters to filter the request. For example, you could specify the name of the webhook or the name of the owner. For more information, see [Filter and Sort](filter-sort). @@ -4837,12 +4853,13 @@ Returns a list of all `ProjectItem` objects and a `PagainationItem`. Use these ```py # import tableauserverclient as TSC # server = TSC.Server('https://SERVER') -# sign in, etc +# sign in . For authentication examples, see https://github.com/tableau/server-client-python/blob/master/samples/login.py --- # get a list of all the webhooks on a site -all_webhook_items, pagination_item = server.webhooks.get() - print("\nThere are {} webhooks on site: ".format(pagination_item.total_available)) - print([webhook.name for webhook in all_webhooks]) +with server.auth.sign_in(tableau_auth): + all_webhooks, pagination_item = server.webhooks.get() +print("\nThere are {} webhooks on site: ".format(pagination_item.total_available)) +print(["Webhook Name:"+ webhook.name+ ";" + "ID:" + webhook.id for webhook in all_webhooks]) ``` @@ -4863,6 +4880,7 @@ Name|Description `webhook_id`| The ID of the webhook. The ID is a *luid*. **Exceptions** + Error|Description :---|:--- `Webhook ID undefined`| Raises an exception if a `webhook_id` is not provided. @@ -4872,9 +4890,10 @@ Error|Description ```py # import tableauserverclient as TSC # server = TSC.Server('https://SERVER') -# sign in, etc +# sign in . For authentication examples, see https://github.com/tableau/server-client-python/blob/master/samples/login.py --- -webhook = server.webhooks.get_by_id ('7d60d364-b9f5-4a9c-8aa5-4bdaa38c5dd3') +with server.auth.sign_in(tableau_auth): + webhook = server.webhooks.get_by_id ('7d60d364-b9f5-4a9c-8aa5-4bdaa38c5dd3') print (webhook.name, webhook.url) @@ -4882,6 +4901,11 @@ print (webhook.name, webhook.url)

    +### Additional Resources +- [REST API Endpoints](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_notifications.htm) +- [Webhooks Documentation](https://help.tableau.com/current/developer/webhooks/en-us/) +- [TSC webhooks samples](https://github.com/tableau/server-client-python/blob/master/samples/explore_webhooks.py) + --- ## Workbooks From 46dfc88e7ee97b4f6a6f1885bae93257b7c81714 Mon Sep 17 00:00:00 2001 From: Karthika <72409920+kramantab@users.noreply.github.com> Date: Wed, 3 Aug 2022 13:35:39 -0700 Subject: [PATCH 3/8] Delete Gemfile --- Gemfile | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 Gemfile diff --git a/Gemfile b/Gemfile deleted file mode 100644 index 58f84459c..000000000 --- a/Gemfile +++ /dev/null @@ -1,5 +0,0 @@ -source 'https://rubygems.org' -gem 'github-pages', group: :jekyll_plugins - - -gem "webrick", "~> 1.7" From af329637a4c64d182e6854dbcdace86fd91d8004 Mon Sep 17 00:00:00 2001 From: Karthika <72409920+kramantab@users.noreply.github.com> Date: Wed, 3 Aug 2022 13:44:21 -0700 Subject: [PATCH 4/8] Update api-ref.md --- docs/api-ref.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/api-ref.md b/docs/api-ref.md index 20078bc16..9f756e640 100644 --- a/docs/api-ref.md +++ b/docs/api-ref.md @@ -4723,17 +4723,17 @@ Name | Description `id` | The identifier (*luid*) for the webhook. You need this value to query a specific Webhook with the `get_by_id` method or to delete a Webhook with the `delete` method. `name` | The name of the webhook. You must specify this when you create an instance of the `WebhookItem`. `url` | The destination URL for the webhook. The webhook destination URL must be https and have a valid certificate. You must specify this when you create an instance of the `WebhookItem`. -`event` | The name of the Tableau event that triggers your webhook.This is either `api-event-name` or `webhook-source-api-event-name`: one of this is required to create an instance of the `WebhookItem`.
    The event name must be one of the supported events listed in the Trigger Events table. The event and webhook-source use different name values for the same event. +`event` | The name of the Tableau event that triggers your webhook.This is either `api-event-name` or `webhook-source-api-event-name`: one of these is required to create an instance of the `WebhookItem`.
    The event name must be one of the supported events listed in the Trigger Events table. The event and webhook-source use different name values for the same event. `owner_id` | The identifier of the owner of the webhook. **Example** ```py - import tableauserverclient as TSC +import tableauserverclient as TSC - # Create new Webhook_item +# Create new Webhook_item - new_webhook = TSC.WebhookItem() +new_webhook = TSC.WebhookItem() ``` Source file: models/webhook_item.py From 1750a7f8db70257c55f0923201319e9758fb5b64 Mon Sep 17 00:00:00 2001 From: Karthika <72409920+kramantab@users.noreply.github.com> Date: Wed, 3 Aug 2022 13:48:35 -0700 Subject: [PATCH 5/8] Update api-ref.md Removing --- from code blocks per Brain's review --- docs/api-ref.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/api-ref.md b/docs/api-ref.md index 9f756e640..d2b95116d 100644 --- a/docs/api-ref.md +++ b/docs/api-ref.md @@ -4776,8 +4776,6 @@ Returns the new webhook item. # server = TSC.Server('https://SERVER') # sign in . For authentication examples, see https://github.com/tableau/server-client-python/blob/master/samples/login.py ---- - # create a webhook item with server.auth.sign_in(tableau_auth): new_webhook = TSC.WebhookItem() @@ -4820,7 +4818,7 @@ Error|Description # import tableauserverclient as TSC # server = TSC.Server('https://SERVER') # sign in . For authentication examples, see https://github.com/tableau/server-client-python/blob/master/samples/login.py ---- + # Delete the webhook with server.auth.sign_in(tableau_auth): server.webhooks.delete('7d60d364-b9f5-4a9c-8aa5-4bdaa38c5dd3') @@ -4854,7 +4852,7 @@ Returns a list of all `ProjectItem` objects and a `PagainationItem`. Use these # import tableauserverclient as TSC # server = TSC.Server('https://SERVER') # sign in . For authentication examples, see https://github.com/tableau/server-client-python/blob/master/samples/login.py ---- + # get a list of all the webhooks on a site with server.auth.sign_in(tableau_auth): all_webhooks, pagination_item = server.webhooks.get() @@ -4891,7 +4889,7 @@ Error|Description # import tableauserverclient as TSC # server = TSC.Server('https://SERVER') # sign in . For authentication examples, see https://github.com/tableau/server-client-python/blob/master/samples/login.py ---- + with server.auth.sign_in(tableau_auth): webhook = server.webhooks.get_by_id ('7d60d364-b9f5-4a9c-8aa5-4bdaa38c5dd3') print (webhook.name, webhook.url) From 72b7f0ccd07a7f644499fc180bc830d2ce00c037 Mon Sep 17 00:00:00 2001 From: Karthika <72409920+kramantab@users.noreply.github.com> Date: Wed, 3 Aug 2022 13:55:26 -0700 Subject: [PATCH 6/8] Update api-ref.md Adding a space between "=" and adding a line before print statements --- docs/api-ref.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/api-ref.md b/docs/api-ref.md index d2b95116d..ee170c3c1 100644 --- a/docs/api-ref.md +++ b/docs/api-ref.md @@ -4779,11 +4779,12 @@ Returns the new webhook item. # create a webhook item with server.auth.sign_in(tableau_auth): new_webhook = TSC.WebhookItem() - new_webhook.name ='testWebhook' - new_webhook.event ="workbook-refresh-failed" # alternately, you can also use new_webhook.source="webhook-source-event-workbook-refresh-failed" - new_webhook.url ="https://webhook.site/6e4c957d-dd40-422c-8fc6-7151afe7fc0b" + new_webhook.name = 'testWebhook' + new_webhook.event = "workbook-refresh-failed" # alternately, you can also use new_webhook.source="webhook-source-event-workbook-refresh-failed" + new_webhook.url = "https://webhook.site/6e4c957d-dd40-422c-8fc6-7151afe7fc0b" # create the webhook new_webhook = server.webhooks.create(new_webhook) + print("Webhook created. ID: {}".format(new_webhook.id)) ``` @@ -4856,6 +4857,7 @@ Returns a list of all `ProjectItem` objects and a `PagainationItem`. Use these # get a list of all the webhooks on a site with server.auth.sign_in(tableau_auth): all_webhooks, pagination_item = server.webhooks.get() + print("\nThere are {} webhooks on site: ".format(pagination_item.total_available)) print(["Webhook Name:"+ webhook.name+ ";" + "ID:" + webhook.id for webhook in all_webhooks]) @@ -4892,6 +4894,7 @@ Error|Description with server.auth.sign_in(tableau_auth): webhook = server.webhooks.get_by_id ('7d60d364-b9f5-4a9c-8aa5-4bdaa38c5dd3') + print (webhook.name, webhook.url) @@ -5014,7 +5017,7 @@ tableau_auth = TSC.TableauAuth('username', 'password', site_id='site') server = TSC.Server('https://servername') with server.auth.sign_in(tableau_auth): - all_workbooks_items, pagination_item = server.workbooks.get() + all_workbooks_items, pagination_item = server.workbooks.get() # print names of first 100 workbooks print([workbook.name for workbook in all_workbooks_items]) From aba492bb0b514607f792d78b50fe17b5f99dafe9 Mon Sep 17 00:00:00 2001 From: Karthika Raman Date: Fri, 5 Aug 2022 13:30:29 -0700 Subject: [PATCH 7/8] adding spaces before print statement, lower case for webhook (consistency) and recommendation for using short event name --- Gemfile | 5 +++++ docs/api-ref.md | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 Gemfile diff --git a/Gemfile b/Gemfile new file mode 100644 index 000000000..d2403f18b --- /dev/null +++ b/Gemfile @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +source "https://rubygems.org" + +# gem "rails" diff --git a/docs/api-ref.md b/docs/api-ref.md index ee170c3c1..1bfcc1952 100644 --- a/docs/api-ref.md +++ b/docs/api-ref.md @@ -4703,27 +4703,27 @@ See [ViewItem class](#viewitem-class) ## Webhooks

    -Using the Tableau Server Client (TSC), you can create a new webhook, get a list of all the Webhooks, get details about a specific webhook, or delete a webhook. +Using the Tableau Server Client (TSC), you can create a new webhook, get a list of all the webhooks, get details about a specific webhook, or delete a webhook.
    -The Webhook resource for Tableau Server and Tableau Cloud are defined in the WebhookItem class. The class corresponds to the Webhook resources you can access using the Tableau REST API. For example, using REST API, you can gather information about a workbook, like the name of the Webbook, the event it is associated with, and the destination URL, and you can get the same information using TSC as well. +The webhook resource for Tableau Server and Tableau Cloud are defined in the `WebhookItem` class. The class corresponds to the webhook resources you can access using the Tableau REST API. For example, using REST API, you can gather information about a workbook, like the name of the Webbook, the event it is associated with, and the destination URL, and you can get the same information using TSC as well.
    -Tableau Webhook REST API endpoints are available in **REST API version 3.16** and later. +Tableau webhook REST API endpoints are available in **REST API version 3.16** and later.

    ### WebhookItem class -The `WebhookItem` represents the Webhook resources on Tableau Server or Tableau Cloud. This is the information that can be sent or returned in response to a REST API request for Webhooks. +The `WebhookItem` represents the webhook resources on Tableau Server or Tableau Cloud. This is the information that can be sent or returned in response to a REST API request for webhooks. **Attributes** Name | Description :--- | :--- -`id` | The identifier (*luid*) for the webhook. You need this value to query a specific Webhook with the `get_by_id` method or to delete a Webhook with the `delete` method. +`id` | The identifier (*luid*) for the webhook. You need this value to query a specific webhook with the `get_by_id` method or to delete a webhook with the `delete` method. `name` | The name of the webhook. You must specify this when you create an instance of the `WebhookItem`. `url` | The destination URL for the webhook. The webhook destination URL must be https and have a valid certificate. You must specify this when you create an instance of the `WebhookItem`. -`event` | The name of the Tableau event that triggers your webhook.This is either `api-event-name` or `webhook-source-api-event-name`: one of these is required to create an instance of the `WebhookItem`.
    The event name must be one of the supported events listed in the Trigger Events table. The event and webhook-source use different name values for the same event. +`event` | The name of the Tableau event that triggers your webhook.This is either `api-event-name` or `webhook-source-api-event-name`: one of these is required to create an instance of the `WebhookItem`. We recommend using the `api-event-name`.
    The event name must be one of the supported events listed in the [Trigger Events](https://help.tableau.com/current/developer/webhooks/en-us/docs/webhooks-events-payload.html) table. `owner_id` | The identifier of the owner of the webhook. **Example** @@ -4785,7 +4785,7 @@ Returns the new webhook item. # create the webhook new_webhook = server.webhooks.create(new_webhook) - print("Webhook created. ID: {}".format(new_webhook.id)) + print("Webhook created. ID: {}".format(new_webhook.id)) ```
    @@ -4857,7 +4857,7 @@ Returns a list of all `ProjectItem` objects and a `PagainationItem`. Use these # get a list of all the webhooks on a site with server.auth.sign_in(tableau_auth): all_webhooks, pagination_item = server.webhooks.get() - + print("\nThere are {} webhooks on site: ".format(pagination_item.total_available)) print(["Webhook Name:"+ webhook.name+ ";" + "ID:" + webhook.id for webhook in all_webhooks]) From 8631f406877b2235f38d1d00699df0f5818b9dcb Mon Sep 17 00:00:00 2001 From: Brian Cantoni Date: Fri, 5 Aug 2022 14:09:15 -0700 Subject: [PATCH 8/8] Restore original Gemfile --- Gemfile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index d2403f18b..37f5eaa42 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,2 @@ -# frozen_string_literal: true - -source "https://rubygems.org" - -# gem "rails" +source 'https://rubygems.org' +gem 'github-pages', group: :jekyll_plugins