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

invalid token #225

Closed
tofutim opened this issue Jun 15, 2016 · 2 comments
Closed

invalid token #225

tofutim opened this issue Jun 15, 2016 · 2 comments
Labels

Comments

@tofutim
Copy link

tofutim commented Jun 15, 2016

Hi, when I use curl, my email address and the api token, it works. However using the following

        var api = new ZendeskApi("https://xxx.zendesk.com/api/v2", "m9...g5k");
        var response = api.Tickets.CreateTicket(new Ticket()
        {
            Requester = new Requester() { Email = email, Name = "name" },
            Subject = "feedback",
            Comment = new Comment() { Body = description },
            CustomFields = new List<CustomField> { new CustomField() { Id = 33530487, Value = sbExtraInfo.ToString() } },
            Via = new ZendeskApi_v2.Models.Shared.Via() { Channel = project }
        });

I get

The remote server returned an error: (401) Unauthorized.Error content: {"error":"invalid_token","error_description":"The access token provided is expired, revoked, malformed or invalid for other reasons."}

I'm also guessing my url can be just xxx.zendesk.com but why does the token not work?

@tofutim
Copy link
Author

tofutim commented Jun 15, 2016

I ghink I should be using this instead var api = new ZendeskApi_v2.ZendeskApi("https://csharpapi.zendesk.com/api/v2", Settings.Email, "", Settings.ApiToken, "en-us", null);

@mozts2005
Copy link
Member

looks as you answered the question if not please ask for help on gitter

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

No branches or pull requests

2 participants