0👍
✅
Apparently, it’s not possible to authenticate with a Private-Token
while requesting deletion via APIClient()
. But instead, the good old requests
library can be used:
import requests
HEADERS = {'PRIVATE-TOKEN': <TOKEN>}
res = ...
if "api_link" in res.data:
requests.delete(res.data["api_link"], headers=HEADERS)
Source:stackexchange.com