I'm trying to make a python POST request, based on data that I get from a separate GET request.
Get request functions properly, and I get a response that looks like:
{
"meta": {},
"linked": {}
"data": [
{
"date_on_hold": null,
"cc": [],
"agent": 8,
"person": 210
"fields": {
"1": {
"value": "nellson.dom",
"aliases": []
}
}
]
I put some of that data into a few lists (omitted) but when I try to perform a POST request like this:
data = {"subject": "Testing POST request", "person": 210, "agent": 8, "[fields][1][data]": "nellson.dom" }
data = json.dumps(data)
postResponse = requests.post(url=URL, headers=headers, data=data)
print(postResponse.status_code)
print(postResponse.text)
I get a 400 error code, with message: "Unexpected field names: "[fields][1][value]""
Am I doing something wrong here? How might I go about posting the data at [data][fields][1][value]?
I want to add, that if I got rid of that particular field in the data section so it would look like:
data = {"subject": "Testing POST request", "person": 210, "agent": 8}
Everything functions properly.