[英]Azure Data Factory - REST API Call Pagination
I'm making a call for data in Data Factory and struggling to call the url in the "next_page" item.我正在调用数据工厂中的数据并努力在“next_page”项中调用 url。
This is an example of what the first API call returns:这是第一个 API 调用返回的示例:
{
"items": [
{
"title_one": "TTL-55924",
"id": "CPT-TTL-64577_TTL-55924",
"title_id": "TTL-64577"
},
{
"title_one": "TTL-69015",
"id": "CPT-TTL-79755_TTL-69015",
"title_id": "TTL-79755"
}
],
"next_page": "http://api.com/api/info?offset=5000&key=XXXxxxXXXxxx"
} }
I'm not sure which options to use in the Pagination Rules of my Copy activity.我不确定在我的复制活动的分页规则中使用哪些选项。
Currently I'm trying the option "AbsoluteURL" with the value "$['next_page']" but this just returns an error.目前我正在尝试使用值为“$['next_page']”的选项“AbsoluteURL”,但这只会返回一个错误。
If your API response contains the next page URL property, then the “ AbsoluteUrl “ pagination rule is the correct option to load the next page in the Azure data factory.如果您的 API 响应包含下一页 URL 属性,则“ AbsoluteUrl ”分页规则是在 Z3A580F142203677F13ZF0BC30898F63F 数据工厂中加载下一页的正确选项。
The supported values for pagination rules are mentioned in this MS document .此MS 文档中提到了分页规则支持的值。
As mentioned in the example from the above document, Facebook Graph API returns the response as,如上述文档中的示例所述,Facebook Graph API 返回响应为,
{
"data": [
…
…
],
"paging": {
…
…
},
"previous": "https://graph.facebook.com/me/albums?limit=25&before=NDMyNzQyODI3OTQw",
"next": "https://graph.facebook.com/me/albums?limit=25&after=MTAxNTExOTQ1MjAwNzI5NDE="
}
}
Note : Pagination value of a JSON path expression starts with “ $ ”.注意: JSON 路径表达式的分页值以“ $ ”开头。
Your pagination in REST copy activity looks like this:您在 REST 复制活动中的分页如下所示:
In your API, the pagination should look like在您的 API 中,分页应如下所示
I have a similar issue.我有一个类似的问题。 I am trying to copy shopify data from the rest API and was able to get the 1st page of data, however i cannot figure out how to set the pagination.我正在尝试从 rest API 复制 shopify 数据,并且能够获得第一页数据,但是我不知道如何设置分页。 THe pagination is coming in the header response like this:分页出现在 header 响应中,如下所示:
I have it set to this but this returns an error:我将其设置为此,但这会返回错误:
ADF ERROR: Failure happened on 'Source' side. ADF 错误:“源”端发生故障。 ErrorCode=RestSourceCallFailed,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=The HttpStatusCode 404 indicates failure. ErrorCode=RestSourceCallFailed,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=HttpStatusCode 404 表示失败。 Request URL: https://joyfolie.myshopify.com/admin/api/2021-07/%3Chttps://joyfolie.myshopify.com/admin/api/2021-07/products.json?limit=50&page_info=eyJsYXN0X2lkIjo0NjI0ODcyMjEwNDkwLCJsYXN0X3ZhbHVlIjoiKk5FVyogQmFlIFNraXJ0IGluIE9jaHJlIiwiZGlyZWN0aW9uIjoibmV4dCJ9%3E;%20rel=%22next%22 Response payload:{"errors":"Not Found"},Source=Microsoft.DataTransfer.ClientLibrary,' Source Pipeline Copy Shopify Products Request URL: https://joyfolie.myshopify.com/admin/api/2021-07/%3Chttps://joyfolie.myshopify.com/admin/api/2021-07/products.json?limit=50&page_info=eyJsYXN0X2lkIjo0NjI0ODcyMjEwNDkwLCJsYXN0X3ZhbHVlIjoiKk5FVyogQmFlIFNraXJ0IGluIE9jaHJlIiwiZGlyZWN0aW9uIjoibmV4dCJ9% 3E;%20rel=%22next%22响应负载:{"errors":"Not Found"},Source=Microsoft.DataTransfer.ClientLibrary,' 源管道副本 Shopify 产品
THis is how the link looks in the response header这是响应 header 中链接的外观
https://joyfolie.myshopify.com/admin/api/2022-01/products.json?limit=50&page_info=eyJsYXN0X2lkIjo0NjI0ODcyMjEwNDkwLCJsYXN0X3ZhbHVlIjoiKk5FVyogQmFlIFNraXJ0IGluIE9jaHJlIiwiZGlyZWN0aW9uIjoibmV4dCJ9 ; https://joyfolie.myshopify.com/admin/api/2022-01/products.json?limit=50&page_info=eyJsYXN0X2lkIjo0NjI0ODcyMjEwNDkwLCJsYXN0X3ZhbHVlIjoiKk5FVyogQmFlIFNraXJ0IGluIE9jaHJlIiwiZGlyZWN0aW9uIjoibmV4dCJ9 ; rel="next"相对=“下一个”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.