Open APIs

 View Only
  • 1.  Filtering in DELETE

    TM Forum Member
    Posted May 15, 2018 08:50
    in TMF630_REST_API_Design_Guidelines_3.0_Part_1 _R17.5.1.pdf ch 7. Delete Resource Pattern

    Is  it applicable to implement deleting resource by criteria defined in filter (filtering described in "Query Resources with attribute filtering and Iterators")

    for example:
    Request:
    DELETE /api/car?car_number=ARF487

    will find auto by car_number and delete it.

    I understand that I can use:
    GET /api/car?car_number=ARF487
    find id in responce and after it
    DELETE /api/auto/<id>

    But DELETE with filter - is shorter and faster.




  • 2.  RE: Filtering in DELETE

    Posted May 16, 2018 02:12
    If I understand the RFC correctly nothing speaks against using query parameters on HTTP DELETE requests. Just be aware that you might be deleting multiple resources instead of just one (depending on how to the filter method is implemented on the back-end). Due to this reason I would argue against using query parameters for HTTP DELETE methods. But if you are 100% sure of what is executed on the back-end, then nothing speaks against your proposal.

    ------------------------------
    Frank Lazzarini
    Post Group
    ------------------------------



  • 3.  RE: Filtering in DELETE

    TM Forum Member
    Posted May 17, 2018 04:06
    Design guidelines don't promote update (PUT / PATCH) and delete (DELETE) operations proceeding blindly, and such operations especially operate on top of identified id and don't support query as applies to read (GET) only.

    ------------------------------
    Christophe MICHEL
    Amdocs Management Limited
    ------------------------------