title: When to use pathParams or QueryParams
body: <p>Is there a rule of thumb as to when one should use path parameters for a URL versus when you should use query parameters?</p>
  
  <p>Say I've got a table Invoice with the fields company(PK),InvoiceNo(PK), Invoiceline, invoiceValue, noOfLines, salesPerson</p>
  
  <p>My current thinking is that your URL should be along the lines of </p>
  
  <pre><code>/Invoice/
  </code></pre>
  
  <p>Which would display all invoices</p>
  
  <pre><code>/Invoice/{company}
  </code></pre>
  
  <p>Which would display all invoices for the company.</p>
  
  <pre><code>/Invoice/{company}/{InvoiceNo}
  </code></pre>
  
  <p>Displays that specific invoice and </p>
  
  <pre><code>/Invoice/{company}/{InvoiceNo}?invoiceLineNo=23
  </code></pre>
  
  <p>displays only line 23.</p>
  
  <p>The way I'm thinking is that Primary key fields should be part of the path and any other fields that you would filter on are part of the query parameter.</p>
  
  <p>Does this sound like a reasonable way of distinguishing between the two?</p>