Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
jupyter-naas
GitHub Repository: jupyter-naas/awesome-notebooks
Path: blob/master/Bitly/Bitly_Delete_a_Bitlink.ipynb
2973 views
Kernel: Python 3

Bitly.png

Bitly - Delete a Bitlink

Give Feedback | Bug report

Tags: #bitly #api #delete #bitlink #hash #unedited

Last update: 2023-04-12 (Created: 2023-02-24)

Description: This notebook will show how to delete an unedited hash Bitlink.

Input

Import libraries

import requests

Setup Variables

token = "<YOUR_TOKEN_HERE>" bitlink = "<YOUR_BITLINK_HERE>"

Model

This function will delete an unedited hash Bitlink.

def delete_bitlink(token, bitlink): url = f"https://api-ssl.bitly.com/v4/bitlinks/{bitlink}" headers = {"Authorization": f"Bearer {token}"} response = requests.delete(url, headers=headers) return response

Output

Display result

response = delete_bitlink(token, bitlink) print(response.status_code) print(response.json())