简体   繁体   English

如何使用 Azure 数据工厂在 Rest API 参数中传递日期值

[英]How to pass date value in Rest API parameter using Azure Data factory

I have a API Url which having one of the parameter with TIMESTAMP.The Url will be like我有一个 API Url 有一个带有 TIMESTAMP 的参数。Url 会像

Actual Url: https://mtplace.api.onoc.com/V2/products/00vkxX?app_id=adm12&access_mdm=computer&TIMESTAMP=2020-07-17T11%3A09%3A25Z&hash_code=O2cnasnajsaBz4qMdKDV3xw2mniiiRQasCuEv65auvjCs%3D Actual Url: https://mtplace.api.onoc.com/V2/products/00vkxX?app_id=adm12&access_mdm=computer&TIMESTAMP=2020-07-17T11%3A09%3A25Z&hash_code=O2cnasnajsaBz4qMdKDV3xw2mniiiRQasCuEv65auvjCs%3D

and time stamp value is 2020-07-17T11%3A09%3A25Z.时间戳值为 2020-07-17T11%3A09%3A25Z。 I want to avoid timestamp value to become expire and for that i created a parameter TS with value utcNow().我想避免时间戳值过期,为此我创建了一个值为 utcNow() 的参数 TS。 And using that parametr in urllike并在 urllike 中使用该参数

https://mtplace.api.onoc.com/V2/products/00vkxX?app_id=adm12&access_mdm=computer&TIMESTAMP=dataset().TS&hash_code=O2cnasnajsaBz4qMdKDV3xw2mniiiRQasCuEv65auvjCs%3D https://mtplace.api.onoc.com/V2/products/00vkxX?app_id=adm12&access_mdm=computer&TIMESTAMP=dataset().TS&hash_code=O2cnasnajsaBz4qMdKDV3xw2mniiiRQasCuEv65auvjCs%3D

am using this Url to connect rest api service as source in ADF.我正在使用此 Url 连接 rest api 服务作为 ADF 中的源。 I am trying to replace Timestampvalue with a parameter value utcNow().我正在尝试用参数值 utcNow() 替换 Timestampvalue。 But i am failing with error Expected EOF, found ':' at 6.但我因错误预期 EOF 失败,在 6 处找到“:”。

Can you help me how can i replace timestamp value from 2020-07-1217T11%3A09%3A25Z to system to avoid timevalue expiration.你能帮助我如何将时间戳值从 2020-07-1217T11%3A09%3A25Z 替换到系统以避免时间值过期。

Store these values in variables and then concatenate.将这些值存储在变量中,然后连接起来。

Timestamp parameter needs URL encoding.时间戳参数需要 URL 编码。 I could not find any inbuilt function for encoding.我找不到任何用于编码的内置 function。 So alternative way is to use a dataflow and column derivation with replace function ( replace ':' with '%3A' and space with 'T').因此,另一种方法是使用数据流和列派生替换 function(将“:”替换为“%3A”,空格替换为“T”)。 You may need some more transformations.您可能需要更多的转换。

Then, timestamp '2020-07-19 19:50:40.851' can be passed as '2020-07-19T19%3A50%3A40Z'然后,时间戳 '2020-07-19 19:50:40.851' 可以传递为 '2020-07-19T19%3A50%3A40Z'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用数据工厂将 JSON 数据从 REST API 映射到 Azure SQL - How to Map JSON data from a REST API to Azure SQL using Data Factory 如何使用 Azure 数据工厂将一批对象从整个 JSON 文件发布到 REST API - How to POST a batch of objects from a whole JSON file to REST API using Azure Data Factory Azure 数据工厂 - REST API 调用分页 - Azure Data Factory - REST API Call Pagination Azure 数据工厂 - 使用 Rest 的复制任务 API 仅在执行时返回第一行 - Azure Data Factory - copy task using Rest API is only returning first row upon execution Azure 数据工厂 rest api 到 Z9778840A0100CB30C982876741B0 导致违规服务器错误 - Azure Data Factory rest api to SQL causing server violation error 如何在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 到 Azure Z9778840A0100CB30C9828 带过滤器7B27B767 - Azure Data Factory - REST to Azure SQL with filter 如何在 Blob 存储上使用 JSON 作为 Azure 数据工厂的参数? - How to use JSON on Blob Storage as parameter for Azure Data Factory? 如何使用HttpClient将Json数据作为参数传递给web api - How to pass Json data as parameter to web api using HttpClient 如何将 JSON 数据传递到 Express REST API - How to Pass JSON Data into Express REST API
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM