KNOWLEDGE BASE

Creating Events AdminPromoted & AdminDemoted events using Tableau Server Client throws error "Deserialization problem: unexpected element"


Published: 29 Nov 2023
Last Modified Date: 30 Nov 2023

Issue

AdminPromoted & AdminDemoted events can't be created using the Tableau Server Client.

Environment

  • Tableau Server
  • Tableau Server Client
  • Tableau Cloud

Resolution

Use CURL or the Tableau REST API to create a Webhook event using AdminPromoted and AdminDemoted.  See Webhooks Events and Payload for more information.

 

Cause

Tableau Server Clinet adds "webhook-source-event" string in every request 

For example:

   new_webhook.event = "user-promoted-admin"  / Here we are  creating  AdminPromoted event 
   new_webhook = server.webhooks.create(new_webhook)

ServerResponseError: 
    400000: Bad Request
        Deserialization problem: unexpected element (uri:"", local:"webhook-source-event-user-promoted-admin"). 

Tableau Server Client tries to fetch webhook-source-event-user-promoted-admin but it should request webhook-event-user-promoted-admin (webhook-source-event-user-promoted-admin) to create the webhook for AdminPromoted because the webhook event source name is webhook-event-user-promoted-admin

Due to this issue, Tableau Server Client can not create tAdminPromoted & AdminDemoted webhook events.



 

Additional Information

Starting in Tableau 2020.3, the `event` attribute of the webhook is the preferred place to specify the triggering event. `webhook-source` can also be used or omitted, as long as there is no conflict between the event described in the two elements. 

Below are the working and non-working request bodies while using the REST API.

Sample API request body for  working and non working conditions :

Non-working:

{
"webhook": {
"webhook-destination": {
"webhook-destination-http": {
"method": "POST",
"url": ""
}
},
"event": "webhook-event-user-promoted-admin",
"name": ""
}
}


Working :

{
"webhook": {
"webhook-destination": {
"webhook-destination-http": {
"method": "POST",
"url": ""
}
},
"event": "AdminPromoted",
"name": ""
}
}
 

Webhooks Events and Payloads

Create a Webhook

Tableau Webhooks Assets

 

Did this article resolve the issue?