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