Add APIs that use unique slug instead of ID #458

Closed
opened 2025-12-29 16:22:21 +01:00 by adam · 2 comments
Owner

Originally created by @dqminh on GitHub (Sep 30, 2016).

I dont feel like uniquely generated ID is the right abstraction for restful API given that most entities already have unique human-readable name (i.e. slug/name etc.). I think being able to use slug as part of the queries to identify resources instead of IDs would improve the API.

Since we already have API with ids, wdyt about adding api_prefix/slug/<slug> for this ?

Originally created by @dqminh on GitHub (Sep 30, 2016). I dont feel like uniquely generated ID is the right abstraction for restful API given that most entities already have unique human-readable name (i.e. slug/name etc.). I think being able to use slug as part of the queries to identify resources instead of IDs would improve the API. Since we already have API with ids, wdyt about adding `api_prefix/slug/<slug>` for this ?
adam closed this issue 2025-12-29 16:22:21 +01:00
Author
Owner

@jeremystretch commented on GitHub (Oct 4, 2016):

Adding entry points for slugs duplicates much of the API. This also leads to inconsistencies as not all objects have slugs. Slugs were only implemented in the web UI to make the URLs a bit easier to understand at a glance.

@jeremystretch commented on GitHub (Oct 4, 2016): Adding entry points for slugs duplicates much of the API. This also leads to inconsistencies as not all objects have slugs. Slugs were only implemented in the web UI to make the URLs a bit easier to understand at a glance.
Author
Owner

@dqminh commented on GitHub (Oct 5, 2016):

@jeremystretch thanks. Duplicating the api is certainly one valid reason. This is not too important now actually so i will close the issue.

@dqminh commented on GitHub (Oct 5, 2016): @jeremystretch thanks. Duplicating the api is certainly one valid reason. This is not too important now actually so i will close the issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#458