Sketchfab Forum

Patch API issue


(Klaasnienhuis) #1

Hi,
I've experienced an issue with the api when I patch a model which has categories. When I patch a model with categories and keep the exact same information in the categories I get an error back. This is the unmodified categories information which I patch back

"categories": [{
    "slug": "cars-vehicles",
    "name": "Cars & vehicles",
    "uid": "22a2f677efad4d7bbca5ad45f9b5868e"
}, {
    "slug": "products-technology",
    "name": "Products & Technology",
    "uid": "d7cebaeca8604ebab1480e413404b679"
}]

And this is the error I get

{"detail":{"categories":["Enter a list of values."]}}

When I replace this information when patching with just the ID's of the categories, it works. Like so

"categories": [
    "22a2f677efad4d7bbca5ad45f9b5868e",
    "d7cebaeca8604ebab1480e413404b679"
]

Data API v3 - models / post problems
(Tribble42) #2

Hello,

Yes that is the expected behavior. Are you using the new V3 API ? It's still in beta so some of the errors aren't probably the most user friendly you could expect.

We'll update this error :slight_smile:

Best

Fred


(Klaasnienhuis) #3

This is still the V2 API