Azure-docs: Requirements for the API implementing paged results

Created on 7 May 2019  Â·  7Comments  Â·  Source: MicrosoftDocs/azure-docs

There appears to be no description of the requirements on how to support pagination from the perspective of the API that is being invoked by Logic Apps.
Now, we are getting an "InvalidPageResponse", related to a property 'value' missing in the result body.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 cxp logic-appsvc product-question triaged

All 7 comments

Hi @Heer-Boaz Thank you for your feedback! We will review and update as appropriate.

@ecfan Just checking if we need to define this.

I've got it working by trial and error.
Unfortunately, the out-of-the-box support for paging has some limits (e.g. only the rows in value are part of the task output).

Requirements for returning paginated responses (JSON)

JSON-body of the response needs to include the properties:

  • nextLink: the URI that contains the next paged result. This property should only be present in the body when there are more pages available. Otherwise, this property should not be present in the body.
  • value: an array containing the results of the requested page. The objects that are returned in the response body are aggregated.

The HTTP-response code is 200.

Example paginated API responses

Response #1

{
  "property": "Hello",
  "nextLink": "http://localhost:7071/api/PaginationFunction?pagetoken=Boem",
  "value": [
    {
      "Name": "name1",
      "Description": "desc1"
    },
    {
      "Name": "name11",
      "Description": "desc11"
    }
  ]
}

Response #2

{
  "property": "Hello Boem",
  "nextLink": "http://localhost:7071/api/PaginationFunction?pagetoken=Klaar",
  "value": [
    {
      "Name": "name3",
      "Description": "desc3"
    }
  ]
}

Response #3

{
  "property": "Hello Klaar",
  "value": [
    {
      "Name": "name2",
      "Description": "desc2"
    },
    {
      "Name": "name22",
      "Description": "desc22"
    }
  ]
}

Example logic app task output

{
  "value": [
    {
      "Name": "name1",
      "Description": "desc1"
    },
    {
      "Name": "name11",
      "Description": "desc11"
    },
    {
      "Name": "name3",
      "Description": "desc3"
    },
    {
      "Name": "name2",
      "Description": "desc2"
    },
    {
      "Name": "name22",
      "Description": "desc22"
    }
  ]
}

@Heer-Boaz I am glad that the issue is resolved. For now will proceed to close this thread. If there are further questions regarding this matter, please tag me in your reply. We will gladly continue the discussion and we will reopen the issue.

@Heer-Boaz & @DixitArora-MSFT, thanks for raising this issue. I think adding this info would be useful, so I'll open a work item. Thanks again!

Any progress on this? Pagination only works if the Payload results have "value".

My API (OKTA) returns rel="next" url in the RESPONSE HEADER.
Is this supported?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ianpowell2017 picture ianpowell2017  Â·  3Comments

bityob picture bityob  Â·  3Comments

spottedmahn picture spottedmahn  Â·  3Comments

JamesDLD picture JamesDLD  Â·  3Comments

jamesgallagher-ie picture jamesgallagher-ie  Â·  3Comments