justeat/ZendeskApiClient

Handle 'Too Many Requests' http response while using ITicketResource.PostAsync

Opened this issue · 1 comments

I'm using ITicketResource to create tickets:
ITicketResource ticketResource = GetTicketResource(); ZendeskApi.Contracts.Models.Ticket ticket = CreateTicket(); var result = await ticketResource .PostAsync(new ZendeskApi.Contracts.Requests.TicketRequest {Item = ticket}).ConfigureAwait(false);

If Zendesk returns 'Too Many Requests' 429 response, this call throws HttpException.
But I can't find a way to get response header Retry-After which specifies time to wait before next retry.

Is there any way to get this info using ITicketResource, or should I handle http request/response with Zendesk myself ?

I'm using ZendeskApi.Client v. 2.0.28.

Hi @gmanvel, I have created a TODO card to investigate this. Our team has recently taken ownership of the repo so it will be integrated into our normal workflow for prioritisation.