Deleting a Content Item’s Vanity URL
Problem
You need to remove the vanity URL from a content item.
Solution
Use the unique identifier of the content item to delete the vanity URL. The content will remain available at the default Dashboard URL.
from posit import connect
= connect.Client()
client
= "154bd2af-e8fa-4aa4-aab8-dcef701f4af9"
CONTENT_GUID
f"/v1/content/{CONTENT_GUID}/vanity") client.delete(
A successful response returns a 204 HTTP status code with an empty response.
<Response [204]>
library(connectapi)
<- connect()
client
<- "154bd2af-e8fa-4aa4-aab8-dcef701f4af9"
CONTENT_GUID
<- content_item(client, CONTENT_GUID)
content delete_vanity_url(content)
A successful response prints the following output.
:
Posit Connect Content: 154bd2af-e8fa-4aa4-aab8-dcef701f4af9
Content GUID: https://rsc.radixu.com/connect/#/apps/154bd2af-e8fa-4aa4-aab8-dcef701f4af9/
Content URL: Example Content
Content Title
content_item(client, guid = "154bd2af-e8fa-4aa4-aab8-dcef701f4af9")