Open APIs

 View Only
  • 1.  purpose of href field in the APIs

    Posted Oct 18, 2017 20:03
    Edited by Andrew Larmour Oct 24, 2017 01:29
    Hi all,

    Looking at the APIs, I am wondering why when the "href" field in many of the APIs refers to "Hyperlink reference to this REST resource" , why is it there? 

    In some instances,  the "href" field is referring to "Hyperlink reference to the corresponding association specification"... this make much more sense to me. Using the field to establish a connection with the related entities. 

    What I don't get is the first href type - why include a reference to THIS resource? If you've used this API, then don't you already know how to get to this resource? 

    Can someone help me understand please?

    ------------------------------
    Andrew Larmour
    DGIT
    ------------------------------


  • 2.  RE: purpose of href field in the APIs

    Posted Oct 23, 2017 14:07
    Hi Andrew,

    Including a self-referential URI is pretty standard in the Level2/Level3 REST APIs that I have seen. The intention is to indicate the standard URI at which the resource can be found because API gateways or intervening proxy servers can sometimes redirect the request to some other temporary endpoint.

    In addition, the "self" URI acts as a confirmation that the client got what it asked for.

    doug

    ------------------------------
    Douglas Beeson
    Cogeco Communications Inc.
    ------------------------------



  • 3.  RE: purpose of href field in the APIs

    Posted Oct 24, 2017 01:30
    Thanks Douglas

    ------------------------------
    Andrew Larmour
    DGIT
    ------------------------------