Open APIs

Expand all | Collapse all

Partial data in response (not paging)

  • 1.  Partial data in response (not paging)

    TM Forum Member
    Posted 6 days ago
    Hi community!
    I have a question about partial data in responses:

    Supouse I have an Open API (Product Inventory Management for example) that feeds from two data services which manage informtion of different types of products.
    In case one of these data services fails to respond, is it admissible for the Open API to generate a partial data response considering the client asked for all productos?
    And in that case, how should the response be structured? (which HTTP code should be used? how should the Open API inform the client that the response contains partial data?)

    I've been reading the documentation but couldn't find a concrete answer to this yet.

    thanks!

    ------------------------------
    Natalia Fabbro
    Claro Argentina
    ------------------------------


  • 2.  RE: Partial data in response (not paging)

    TM Forum Member
    Posted 5 days ago
    Hi Natalia
    See a recent post of mine here, where I explain the difference between an API (interface) and its implementation.
    In your case, the Product Inventory API TMF637 contract knows nothing of how the API is implemented, whether there is one, two, or 76 data stores that ultimately feed the result set.
    Even with a single underlying data service, there could be any number of error conditions that would cause the response to be incomplete.
    It's up to you as an implementer to decide whether to return an error status (4xx) or a success (200), depending on your business needs. You could add to the response body (before the array of Product) a dedicated resource to give feedback to the consumer, and your consumers would have to be aware of this possibility of an incomplete result set and handle it.
    Hope it helps

    ------------------------------
    Jonathan Goldberg
    Amdocs Management Limited
    Any opinions and statements made by me on this forum are purely personal, and do not necessarily reflect the position of the TM Forum or my employer.
    ------------------------------