title: Pros/cons of passing a record ID through the URL vs. a parameter
body: <p>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.</p>
  
  <p>Example: Getting info of a message of ID 1</p>
  
  <p>You could do this with <code>example.com/messages/1</code> which would return the message of ID 1 in JSON format.</p>
  
  <p>Or you could do <code>example.com/messages?id=1</code>.</p>
  
  <p>Are there any reasons to choose one over the other or would it just be personal preferences?</p>