Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create anonymous requests from end users #236

Open
anti-matter opened this issue Jul 2, 2020 · 1 comment
Open

Cannot create anonymous requests from end users #236

anti-matter opened this issue Jul 2, 2020 · 1 comment

Comments

@anti-matter
Copy link

When creating a request (i.e. end users create tickets), there is no way to supply the required requester object as described in the Zendesk documentation. The result is that the request fails if the end user is not already known in the system.

Example:

var request = await client.Requests.CreateAsync(new Request
                {
                    Comment = ticketComment,
                    CreatedAt = DateTime.UtcNow,
                    Description = description,
                    Subject = subject,
                    CustomFields = customFields
                });

Here is how I create the client:

private ZendeskClient CreateZendeskClient(string email)
        {
            var httpClient = ServiceLocator.Current.GetInstance<IHttpClientFactory>();
            var options = new ZendeskOptions
            {
                EndpointUri = ZendeskEndpoint,
                Username = email,
                Token = ApiToken
            };

            var optionsWrapper = new OptionsWrapper<ZendeskOptions>(options);

            return new ZendeskClient(new ZendeskApiClientFactory(optionsWrapper, httpClient), _log);
        }

There is the ability to supply a requester_id, but it is unclear how to obtain this id when the end user is new.

What am I missing? Any help would be appreciated.

Thanks in advance!

@mikerogers123
Copy link
Contributor

Hi @anti-matter, I have had a brief look and it doesn't seem like the API currently support anonymous requests for this endpoint. It seems that we need to add the Requester object as an option on the Request object.

I also notice that, even for anonymous requests where auth is not necessary, we still require username/token when instantiating the ZendeskApiClient. We will have a look into having a more natural solution for anonymous requests like this.

Our team has recently taken ownership of this repository so we should get round to it. I have created a TODO card as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants