justeat / ZendeskApiClient

C# Client for working with the Zendesk API
Other
65 stars 86 forks source link

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

Open gmanvel opened 5 years ago

gmanvel commented 5 years ago

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.

mikerogers123 commented 2 years ago

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.