Failing to add product from python

#1

I’m sending this POST request with python (which works when using the endpoint test interface from PD’s documentation):

image

But I keep getting this error:

Any ideas?

#2

Hi Michael,
the format of the body is correct.

I’m not a Python expert, but from a quick search it looks like you probably just need to change this:
response = requests.post(url, data = body)
to this
response = requests.post(url, json = body)

Let me know if it works :slight_smile:

2 Likes
#3

Great catch! Thanks!

1 Like