URL - https://api.pocketmath.com/v2/orders.json
500 Internal Server Error
If you are the administrator of this website, then please read this web application's log file and/or the web server's log file to find out what went wrong.
I tried converting to JSON because the non-JSON data didn't work and I read on some blogs that converting to JSON may resolve errors. So I was just trying with a different way.
input_object = {'campaign_id': 123456,'name': 'order2333','total_budget': 100.0,'cpm': 0.5,
'schedules': [{'start_at': '2017-07-21T08:04:00.000Z','end_at': '2017-07-25T08:04:00.000Z'}],
'creative_id': 123456,'country_code': 'US'}
headers = {'Content-Type': 'application/json; charset=utf-8','Accept': 'application/json',
'Authorization': 'Token token=XXXXXXXXXXXXXXXXXXXXXXXX'}
r = requests.post('https://api.pocketmath.com/v2/orders.json',params=input_object,headers=headers)Keep getting 422.
Thanks
input_object = {'campaign_id': 1111111,'name': 'order2333','total_budget': 100.0,'cpm': 1,
'schedules': [{'start_at': '2017-07-21T08:04:00.000Z','end_at': '2017-07-25T08:04:00.000Z'}],
'creative_id': 1111111,'country_code': 'US', 'exchanges':['OpenX'] }
headers = {'Content-Type': 'application/json',
'Authorization': 'Token token=XXXXXXXXXXXXXXXXXXXXXx'}
input_data = json.dumps(input_object)
r = requests.post('https://api.pocketmath.com/v2/orders.json',data=input_data,headers=headers)