apiazure-data-factorydynamic-content

Data Factory Dynamic Content in REST API Call


I'm making an API call, where once I'm authorised I have to use a security token as part of subsequent calls. I'm using the variable "SecurityToken" to store the token.

Also as part of the call I need to pass a date parameter, which is the date from 14 days ago in YYYY-MM-DD format.

I've built this formula but it will not run, it stops the whole pipeline from running

Dynamic Content: @concat('https://MyAPIUrl/api/daily/UK?key=',variables('SecurityToken'),'&date=formatDateTime(addDays(utcnow(),-14),'yyyy-MM-dd')'&currency_type=GBP&use_website_rounding=FALSE')

Error: {"code":"BadRequest","message":null,"target":"pipeline//runid/8990bb14-27f8-43e5-b7c0-1741204ff645","details":null,"error":null}


Solution

  • Can you try this

    @concat('https://MyAPIUrl/api/daily/UK?key=',variables('SecurityToken'),'&date=',formatDateTime(addDays(utcnow(),-14),'yyyy-MM-dd'),'&currency_type=GBP&use_website_rounding=FALSE')