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

(401) Unauthorized "error":"invalid_token" #214

Closed
aliparlar opened this issue Mar 20, 2016 · 3 comments
Closed

(401) Unauthorized "error":"invalid_token" #214

aliparlar opened this issue Mar 20, 2016 · 3 comments

Comments

@aliparlar
Copy link

Hello,

I managed to get the API to work by using email&password authentication. I am trying to switch to using a token but my requests fail (401) Unauthorized.Error content: {"error":"invalid_token"

Am I missing something?

Dim requester As New ZendeskApi_v2.Models.Tickets.Requester
requester.Email = "john@doe.com"

    Dim zencomment As New ZendeskApi_v2.Models.Tickets.Comment
    zencomment.Body = "test comment"

    Dim ticket As New ZendeskApi_v2.Models.Tickets.Ticket
    ticket.Requester = requester
    ticket.Comment = zencomment
    ticket.Subject = "test subject"

    Dim zendesk As New ZendeskApi("https://help___.zendesk.com/api/v2", "TOKEN_STRING_HERE")
    zendesk.Tickets.CreateTicket(ticket)
@CKCobra
Copy link

CKCobra commented Mar 23, 2016

Your example above will try to use an OAuthToken and I think you're trying to use an ApiToken. Try the following:
Dim zendesk As New ZendeskApi("https://help___.zendesk.com/api/v2", "USERNAME", Nothing, "APITOKEN_STRING_HERE", Nothing)

@aliparlar
Copy link
Author

Thank you for the pointer, it worked like this:

Dim zendesk As New ZendeskApi("https://__help.zendesk.com/api/v2", "user@email.com", Nothing, "API_TOKEN_HERE", Nothing, Nothing)

@mozts2005
Copy link
Member

issue has been fixed I am going to close

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

No branches or pull requests

3 participants