Pretty much title says all, I was able to get the snippet within test = {} to work within salesforce workbench. Would love some guidance on what I am doing wrong as individual "non-bulk" requests work.
test = {
"allOrNone" : "false",
"records" : [{
"attributes" : {"type" : "Sensor_Reading__e"},
"id__c": "679",
"power__c": "15.00",
"temperature__c": "72.6",
"captureTime__c": "2019-05-20"
}]
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer '+str(response.json()['access_token'])
}
response = requests.post('https://na50.my.salesforce.com/services/data/v45.0/composite/sobjects', headers=headers,data=test)
print(response.text)
Error:
[{"message":"Unexpected character ('r' (code 114)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') at [line:1, column:2]","errorCode":"JSON_PARSER_ERROR"}]
{}
tool to format your code, rather than posting a screenshot?