public async Task OnWebhookEvent()

in Common/ConnectorSDK/EventApiClient.cs [53:82]


        public async Task OnWebhookEvent(string tenantId, string jobId, string timeStamp, string itemId, string change)
        {
            Log($"Calling event API for change, jobId:{jobId}, itemId:{itemId}, change:{change}");
            DateTime unixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, 0);
            
            NativeConnetorEvent e = new NativeConnetorEvent()
            {
                Id = itemId,
                ChangeType = change,
                TimeStamp = unixEpoch.AddSeconds(Double.Parse(timeStamp))
            };
            NativeConnetorEventList list = new NativeConnetorEventList
            {
                entry = new List<NativeConnetorEvent> { e }
            };
            string token = await auth.GetTokenAsync(tenantId);
            HttpRequestMessage request = new HttpRequestMessage()
            {
                Method = HttpMethod.Post,
                Headers =
                {
                    {
                        "Authorization", "Bearer " + token
                    }
                },
                RequestUri = new Uri(baseUrl + "api/event/nativeconnector/" + "?jobId=" + jobId),
                Content = new StringContent(JsonConvert.SerializeObject(list), Encoding.UTF8, "application/json")
            };
            await httpClient.SendAsync(request);
        }