简体   繁体   English

Azure 数据工厂 - REST API 调用分页

[英]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.

相关问题 Azure 数据工厂中的分页 - Pagination in Azure Data Factory Azure 数据工厂 REST 调用将所有日期时间值显示为 null - Azure Data Factory REST call shows all datetime values as null Azure 数据工厂 rest api 到 Z9778840A0100CB30C982876741B0 导致违规服务器错误 - Azure Data Factory rest api to SQL causing server violation error Azure 数据工厂 - REST 到 Azure Z9778840A0100CB30C9828 带过滤器7B27B767 - Azure Data Factory - REST to Azure SQL with filter 如何使用数据工厂将 JSON 数据从 REST API 映射到 Azure SQL - How to Map JSON data from a REST API to Azure SQL using Data Factory 带有 Rest API 的 Azure 数据工厂 V2 复制活动为嵌套的 JSON 提供一行 - Azure Data Factory V2 Copy Activity with Rest API giving one row for nested JSON 如何使用 Azure 数据工厂在 Rest API 参数中传递日期值 - How to pass date value in Rest API parameter using Azure Data factory Azure 数据工厂 - 尝试将参数添加到 REST API 请求正文中的动态内容 - Azure Data Factory - attempting to add params to dynamic content in the body of a REST API request 如何在Azure Data Factory V2上的Json中为此REST_API编写文件路径 - How to write a file path in Json for this REST_API on Azure Data Factory V2 Azure 数据工厂 - 使用 Rest 的复制任务 API 仅在执行时返回第一行 - Azure Data Factory - copy task using Rest API is only returning first row upon execution
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM