Skip to Content

Passing Dynamic Date parameter in HTTP Request

Dear Experts-

I am working on scenarios in which am using GET functionality of HTTP request to retrieve the data using an API endpoint. I have successfully retrieved historical data but now have I need to get the data for every day which means need to pass a dynamic parameter to the HTTP GET request so that every day am getting the data for that current day. I have used content modifier step and have provided a expression using the date format ${date:now:yyyy-MM-dd} and have provided the same in the HTTP request. The result is 422 error. Please let me know if there are any other ideas that can be implemented so that I can retrieve everyday data.

Any help is appreciated.

Regards


HS

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    May 23 at 05:34 PM

    I got this to work! The issue was with the format. Appreciate your input. Yes, I agree that API provider will not see the dynamic parameter but they will just see the dates. So I think need to figure out a way to send the date. I apologize not being more descriptive.

    I have not replaced entire string but have replaced only the date factor. My string looks like {"day":["between","${date:now:yyyy-MM-dd}","${date:now:yyyy-MM-dd}"]}. This value is maintained in con1 value in exchange property as content

    Please find the screenshot of my configuration below. Before sending the HTTP request I have a content modifier step to send the property.

    Thanks for support.

    Regards

    HS

    Add comment
    10|10000 characters needed characters exceeded

  • May 21 at 10:04 PM

    Hi Hari

    Based on the HTTP status 422 alone, it sounds like your request could be correctly formatted, but still not make sense to the server. Like a date interval with the lower bound being greater than the upper bound.

    I'd suggest that you do all your testing in Postman, until you have a request that works, and then implement that in Cloud Integration. That way you can more easily isolate any problems you encounter.

    Regards,

    Morten

    Add comment
    10|10000 characters needed characters exceeded