With Recycle Bin enabled in a site, deleting content items of the supported content types (workbook, data source) now, by default, no longer permanently deletes the item. Instead, the content item is now placed in the Recycle Bin. Consequently, the content item continues to exist in the system until it is permanently deleted after the number of days the content can be stored in the Recycle Bin, which can be configured to 1, 7 or 30 days. Since the content item still exists, it retains its original content URL for this retention period. Thus, publishing another content item of the same type (e.g. workbook) with the same name will necessarily result in the new item being assigned a different content URL. This is the standard behavior encountered when publishing content with already existing names, but users may encounter this behavior more frequently given that content items are retained in the system after deleting.
Scripts should always consult the REST API response when publishing a workbook or data source to determine the content URL assigned to the newly created item. Scripts should not assume that the content URL will be the same for an identically named item since the content URL may already be assigned to an item in the Recycle Bin.
Example: Publishing a workbook POST /api/api-version/sites/site-id/workbooks
Request body:
--boundary-string
Content-Disposition: name="request_payload"
Content-Type: text/xml
<tsRequest>
<workbook name="workbook-name" showTabs="show-tabs-flag" description="workbook-description" thumbnailsUserId="user-luid">
<connections>
<connection serverAddress="server-address" serverPort="port-number">
<connectionCredentials name="connection-username" password="connection-password"
embed="embed-flag" />
</connection>
</connections>
<project id="project-id"/>
</workbook>
</tsRequest>
--boundary-string
Content-Disposition: name="tableau_workbook"; filename="workbook-file-name"
Content-Type: application/octet-stream
content-of-workbook-file
--boundary-string--
Response body:
<tsResponse>
<workbook
id="workbook-id"
name="workbook-name"
contentUrl="site-content-url"
webpageUrl="server-address"
showTabs="show-tabs-flag"
size="num-size"
createdAt="workbook-publish-date-time"
updatedAt="workbook-update-date-time"
encryptExtracts="encryptExtracts" >
<project id="project-id" name="project-name"/>
<owner id="workbook-owner-id"/>
<tags/>
<views>
<view
id="view-id"
name="view-name"
contentUrl="view-content-url"
createdAt="view-publish-date-time"
updatedAt="view-update-date-time" >
<tags/>
</view>
<materializedViewsEnablementConfig materializedViewsEnabled="materialized-views-enabled-flag"/>
</workbook>
</tsResponse>
The workbook’s correct content URL is included in the REST API response.
Another approach is to identify why content is being deleted and then almost immediately being restored. If the intent is to maintain the content URL of the item, then consider not deleting it and instead publish a new version of the item. This can be achieved by using the overwrite flag in the REST API POST /api/api-version/sites/site-luid/datasources?overwrite=overwrite-flag
This is the correct way to retain an item’s content URL since this is publishing a new version of an existing item.
004577009

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.