Getting a response status code of 404 with no status text.
import requestsimport jsonfilename = "C:\\Salient\\SalientETL\\Projects\\Glorious\Output\\NS_PAYLOAD_Deals.txt"with open(filename) as f: content = f.readlines()for line in content: headers = { 'accept': "application/json", 'content-type': "application/json" } url = "https://api.hubapi.com/crm/v3/objects/deals" querystring = {"idProperty":"dealname","hapikey": "xxx"} payload = json.loads(line) ##print(payload) response = requests.request("PATCH", url, data=payload, headers=headers, params=querystring) print(response.text) print(response.status_code)
I want to be abe to update records by the dealname property if possible. This would be much easier and preferred over supplying the DealID. Is there a reason why the dealname property is not allowed? Does the field need to be defined as a unique field? This is a hs defined field, so I can’t edit the field. Can you please explain how we can use the idProperty with the PATCH method?
------------------------------------------------------------------
Source data:
“{\“properties\”:{\“dealname\”:\“Green Pharm - 2021-06-30\”,\“dealstage\”:\“closedwon\”,\“amount\”:\“2600.00\”,\“closedate\”:\“2021-06-30\”,\“market\”:\“Medical\”,\“leaflink_order_no\”:\“9543be86\”}}”
“{\“properties\”:{\“dealname\”:\“Green Pharm - Bay City - AU - 2021-06-30\”,\“dealstage\”:\“closedwon\”,\“amount\”:\“3250.00\”,\“closedate\”:\“2021-06-30\”,\“market\”:\“Adult Use\”,\“leaflink_order_no\”:\“9543be96\”}}”
------------------------------------------------------------------
405
Process finished with exit code 0