I'm pushed into a peculiar situation where I'm not able to decide what is wrong and what is right.
I've a resource called Invoice. To get a JSON or XML representation I use below URI
somedomain.com/inovices/{InvoiceNumber} - Invoice number is numeric Accept: application/xml When I want a PDF of same resource I use below URI:
somedomain.com/inovices/{InvoiceNumber} - Invoice number is numeric Accept: application/pdf Both the above url's are served for authenticated requests. We also want to support same resource using a GUID for unauthenticated requests, hence we want to use below URL
somedomain.com/inovices/{GUID} Accept: application/pdf Above URL is like a permanent URL and anybody can access this URL any number of times. My confusion is whether providing URL as above is RESTful or not. Because in one URL I'm using invoice number which is numeric and for permanent URL I'm replacing it with GUID.
Reason why I felt this is wrong is same resource is represented with two different URI's (number and GUID) even though they are returning same resource. Or is it just my assumption that it is wrong? Is it against any REST cosntraint is what I'm not able to understand?