tumbling window trigger with zendesk api

Ahsan 20 Reputation points
2023-11-29T07:31:21.3433333+00:00

I am trying to use tumbling window trigger. I have a copy activity and am using zendesk api endpoint to get the data. I am trying to get all the data from 10/1/23 to 10/31/23, running for once a day. I have created a trigger and have a url like this:

https://example.zendesk.com/api/v2/search.json?query=type:ticket+created_at>=@{linkedService().startDate}&created_at<=@{linkedService().endDate}


in my linked service, I have 2 parameters: startDate and endDate. the goal is to pull data between the start date and end date using the created_at column in zendesk.

In my copy activity I have 2 parameters, startdate and enddate which are: trigger().outputs.windowStartTime and trigger().outputs.windowEndTime

I am getting this error:

Failure happened on 'Source' side. ErrorCode=RestCallFailedWithClientError,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Rest call failed with client error, status code 422 422, please check your activity settings.

Request URL: https://example.zendesk.com/api/v2/search.json?query=type:ticket+created_at%3E=trigger().outputs.windowStartTime&created_at%3C=trigger().outputs.windowEndTime.

Response: {"error":"invalid","description":"Invalid search: Illegal value "trigger" for "created". Expected date as yyyy-mm-dd, ISO time such as yyyy-mm-ddThh:mm:ss+05:00, or relative time such as 2hours."},Source=Microsoft.DataTransfer.ClientLibrary,'

I believe that the issue is that the created_at column is in the following format: 2023-10-01T00:00:00Z, and windowstarttime and windowendtime are not in the same format. I have tried using the expression builder in the copy activity to convert it using formatDateTime, but have not been successful.

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

1 answer

Sort by: Most helpful
  1. Subashri Vasudevan 11,226 Reputation points
    2023-11-29T09:08:08.6966667+00:00

    Hi

    https://example.zendesk.com/api/v2/search.json?query=type:ticket+created_at%3E=trigger().outputs.windowStartTime&created_at%3C=trigger().outputs.windowEndTime.

    In the above URL for the created_at parameter, the string 'trigger().outputs.windowsStartTime' is being passed. That is why you see this error Invalid search: Illegal value "trigger" for "created".

    What you can do is, you can use a set variable activity to frame your URL dynamically instead of directly using the trigger() on the api url in copy source. (Before copy activity, get the URL framed with actual timestamp, using set variable)

    Please try that and let us know.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.