I'm working on an API and am wondering if there are any advantages/disadvantages of accessing a record by passing the ID through the URL vs. as a parameter.
Example: Getting info of a message of ID 1
You could do this with example.com/messages/1
which would return the message of ID 1 in JSON format.
Or you could do example.com/messages?id=1
.
Are there any reasons to choose one over the other or would it just be personal preferences?