Skip to content

Latest commit

 

History

History
57 lines (35 loc) · 1.91 KB

Bitly_Delete_a_Bitlink.md

File metadata and controls

57 lines (35 loc) · 1.91 KB



Template request | Bug report | Generate Data Product

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

Author: Florent Ravenel

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

References:

Input

Import libraries

import requests

Setup Variables

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

Model

Delete Bitlink

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())