Hi
New to this....I've got an API issue... I'm trying to upload some data but getting stumped with the format.
I can GET data and authorisation works with no problem... I can even upload certain fields at the basic level, but getting stuck using the Download Tool Payload where the required attribute is a lower 'subset'.
The URL requires PATCH to upload the data and this works:
I believe this is the same as :
{
"sku": "R0412GRY10L",
"description": "6204.69.2810"
}
This worked with no errors.
However, I want to be able to upload the following:
{
"sku": "R0412GRY10L",
"description": "6204.69.2810",
"classifications":[{"codes": ["6204.69.2810"],"region": "US"}]
}
I cant get the 'region' & 'codes' to work... my error is saying 400 "Unknown Attributes"
I've tried naming the attributes in different ways see here:
Is there a specific way to reach the "Classifications" sublevel? Should I be doing it on a separate URL?
Thanks
Solved! Go to Solution.
If you had this,
'{
"sku": "R0412GRY10L",
"description": "6204.69.2810",
"classifications":[{"codes": ["6204.69.2810"],"region": "US"}]
}'
in a Formula Tool (called, say "my_payload") and used that field in Take Query String/Body from Field in the payload tab of the Download Tool, does it work?
Hi. I did yes
I get the same Unknown Attribute error... but I think this one is failing the whole script as unknown... looking at the error text more closely
whereas previously 'sku' & 'description' worked fine as an attribute
And this is with all other fields unchecked in the Payload? I'm stumped then.
It is yes...
Yep me too!
@Colin_Dawes in case it makes a difference, when you use @PhilipMannering 's suggestion about the payload can you also add a header to set the Content-Type to application/json
@Colin_Dawesinteresting. I think the Accept header and Content-Type header are 2 separate things.
@patrick_digan @PhilipMannering It worked!!
and also putting the Payload in as a string from the Formula tool.. excellent thank you both!
Woop woop. Good, this was bugging me.
Yeah, Content-Type and Accept refer to the format of what you send and what you receive respectively. Thanks @patrick_digan Glad it worked.