Looking for advices for REST API

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Maya1234
    New Member
    • Apr 2013
    • 1

    Looking for advices for REST API

    I'm working on a web application and designing an API as REST API (However, sticking to the REST rules exactly isn't mandatory).

    The application has a customers list.

    My questions:

    1. How to deal with several GET methods for one resource? For example, I have the address api/customers, and the API clients want to receive different information from it every time. A regular GET request to api/customers will get the customers list, but what if they want other information? List name, list status...?

    2. Which HTTP method should I use for advancing to the next customer? Since this action is not idempotent, I can't use PUT. Would POST be a good way to do it? Or PATCH? Should it be in a different address? Such as api/customers/next, and then a POST method to this address will advance to the next customer?

    Thank you
Working...