Siirry sisältöön

Ero sivun ”Journeys API” versioiden välillä

137 merkkiä lisätty ,  17. heinäkuuta 2014 kello 01.07
Rivi 98: Rivi 98:
<pre>
<pre>
{
{
     "headers" : {
     "status" : "success",
        "startIndex" : 0,
    "data" : {
        "pageSize" : 10,
        "headers" : {
        "moreData" : false
            "paging" : {
 
                "startIndex" : 0,
    },
                "pageSize" : 1,
    "data" : [
                "moreData" : false
      ...
            }
     ]
        },
        "body": [
            ...
        ]
     }
}
}
</pre>
</pre>


The response has headers and data elements. Data element contains the actual response data, and its content varies depending on the request made by the client. Headers contain metadata-like information about the response. StartIndex tells the index of the first returned element, pageSize tells how many items were returned and moreData tells if the client should make another request to fetch the additional data. This approach is called "paging". The client can specify startIndex parameter to the request URL to specify the starting index of an entity list, for example:
The response has headers and data elements. Data element contains the actual response data, and its content varies depending on the request made by the client. Headers contain metadata-like information about the response. startIndex tells the index of the first returned element, pageSize tells how many items were returned and moreData tells if the client should make another request to fetch the additional data. This approach is called "paging". The client can specify startIndex parameter to the request URL to specify the starting index of an entity list, for example:


<pre>
<pre>
http://example.com/journeys/api/lines?startIndex=10
http://data.itsfactory.fi/journeys/api/1/lines?startIndex=10
</pre>
</pre>


0

muokkausta