I’m facing an issue where I need to check wether creating a category with a given name is possible with the API — in other words, if a category slug is not already taken.
Right now, I check it by fetching
/c/foobar.json and interpreting it (404 means available).
User wants to create
foobar) → checking if
But if the user wants to create
Foo Bar (slug
foobar too) it will raise an error because the slug already exists from another category (
I’d need either:
- To call an endpoint made for that (e.g.
/category-available/name.json) but I think it’s too specific.
- To specify the slug as a parameter of the category creation endpoint.
- To dry-run the API category creation process. This could be extended to other creation endpoints.
What do you guys think?