CMS Development

karien
Participant

404 when trying to disassociate activity from contact record

import requests
import os

from dotenv import load_dotenv
import os

load_dotenv('/home/karien/PycharmProjects/VDVTEST/secretsSandbox.env')

# Replace YOUR_API_KEY with your actual API key
OAUTH = os.environ["OAUTH"]

# Replace ACTIVITY_ID and CONTACT_ID with the actual IDs
contact_id='56195'
activity_id='33169041831'



url = f"https://api.hubapi.com/engagements/v1/engagements/{activity_id}/associations/contact"
headers = {"Authorization": "Bearer {OAUTH}".format(OAUTH=OAUTH)}
data = {"id": contact_id}



response = requests.delete(url, headers=headers, json=data)
print(response.text)

if response.status_code == 204:
print("Activity disassociated successfully.")
else:
print("Error: Unable to disassociate activity.")

returns 404

 

0 Upvotes
1 Reply 1
Jaycee_Lewis
Community Manager
Community Manager

404 when trying to disassociate activity from contact record

Hey, @karien 👋 One question, can you link me to the specific endpoint documentation page, please? For example, it might be:

Thanks for clarifying!

 

Best,

Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes