I am designing a REST API but came across some difficulties while naming it. I have an API like this:
GET .../users/{userId}/categories/count
GET .../users/{userId}/categories/{categoryId}/count
GET .../users/{userId}/categories/{categoryId}/tickets
It seems like the API is about users' categories, but actually the usages are:
Get the number of tickets for each available ticket categories for specified user
Get the number of tickets for the specified ticket category for specified user
Get all the tickets under the specified ticket category for specified user
For the first 2 APIs, I might change this to:
.../users/{userId}/tickets/categories/count
.../users/{userId}/tickets/categories/{categoryId}/count
But for the last one, I am not sure how to design the API path. Is it weird if I change it to:
.../users/{userId}/tickets/categories/{categoryId}/tickets