Azure Data Factory REST API relative URL with Parameter

Nelia Townsend 1 Reputation point
2022-02-01T15:14:16.113+00:00

I am building an incremental load in ADF caling a REST API and using the max date created loaded into my Azure SQL table to retrieve only the records added after that date.

I'm not familiar with API query parameter syntax and struggling with the string query in the relative URL
When I use the literal epoch date the relative URL works but I cant get a parameter to work.

This worked without the parameter
https://api.xxxxx.com/xxxx?limit=200&created_at=%7B%22%3E%22%3A%20"1641382428"%2C%20%22%3C%22%3A%20"9999999999"%7D

The API supplier said the syntax should be this: ?created_at={"gte":"1502039307"}

Ive tried to concatenate but the result is extra characters
@markus.bohland@hotmail.de ('xxxx?limit=200&created_at={"gt":',activity('Lookup_max_created').output.value,'}')

Can someone please advise how I insert a parameter to replace the eopch time of "1502039307"

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,196 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. svijay-MSFT 5,226 Reputation points Microsoft Employee
    2022-02-02T13:58:34.377+00:00

    Hello @Nelia Townsend ,

    Welcome to the Microsoft Q&A platform.

    Can you please clarify - what character are you seeing extra?

    If you want to encode the string - like mentioned in the first part of string :

    @encodeUriComponent(concat('xxxx?limit=200&created_at={"gt":activity('Lookup_max_created').output.value,'}'))  
    

    Also, can you should the out of the Lookup activity.

    170576-image.png

    activity('Lookup_max_created').output.value  
    

    Ensure it is string. If not You can use dot operator to access one level down. for instance activity('Lookup_max_created').output.value.lastcreated

    In my case to access id I use

    activity('Lookup1').output.firstRow.user.id  
    
    1 person found this answer helpful.

  2. Nelia Townsend 1 Reputation point
    2022-02-03T07:41:20.15+00:00

    Thank you so much. I needed the access to one level down to insert the parameter value correctly.

    0 comments No comments