Generating a new API token

Return to top
Have more questions? Submit a request

28 Comments

  • Nathan McClintock

    The Token Access slider is set to 'enabled'. I cannot for the life of me find the 'Add new token' button/URL. I am an administrator. Help! 

    Cheers

    1
  • Jacob J Christensen - Cloudhuset A/S
    Community Moderator

    Understandable, it is a very discreet looking plus sign below the slider(s).

    2
  • Gal Zohar

    Hi,

    Is the following statement correct: "An API token is connected to the user who created it. If that user is deleted, or demoted from an admin role, any external platform using this token will not have access anymore". 

    If this is correct, is there a way for an admin to create a token which is connected to another admin user (e.g. an integrations user who will never leave the company or get another role)?

    2
  • Gail L
    Zendesk Community Team

    Hi Gal,

    Yes, the token would still be valid if it was taken from a deleted user, so it should be possible to use it with another admin user.

     

    0
  • Heather Cook

    Hi Team,

    Is there a way to link a token to a user in Zendesk?

    Currently if a token is shared to a user for them to use and they are a Light Agent, they can use this to call the API. If that user realises that instead of using their log in name, but instead uses the log in name of an Admin then they can use that token and the admin log in name to use the API. This seems incredibly insecure...

    Is this our set up that we need to change? Or Zendesk set up in general?

    3
  • Dan Kondzela

    Thank you, Heather. 

    You are correct in that if a user is going to have access to a token attributed to a different user it would be insecure, as tokens are inherently private methods of authentication. It would be similar to sending passwords out, and we advise against sharing Tokens amongst agents for this reason.

    Light Agents still ought to be able to call basic endpoints with only their password as authentication, but if you need more scope you can utilize OAuth: https://support.zendesk.com/hc/en-us/articles/203663836-Using-OAuth-authentication-with-your-application

    Thanks!

    0
  • Michael Tiernan

    I have to say, we're trained (*cough*) to look for non grayed out items to click on.

    My apologies for sounding harsh but it is counter intuitive to click on something like one of these controls. I don't mean to sound viciously critical, just trying to encourage a fix. :)




    5
  • Jessie Schutz
    Zendesk team member

    Thanks for sharing that feedback, Michael!

    0
  • Ernest Prabhakar

    > select Channels > API

    We don't see "API" under Channels, only social.  Do we need to do something special get (back) access? I seem to remember we had this a year ago...

    https://nauto.zendesk.com/

     

    0
  • Brett - Community Manager
    Zendesk Community Team

    Hi Ernest,

    Can you confirm you're logged in as an Admin on the account? The API option should show up under the Widget option as shown in the screenshot below:

     

    I would also confirm whether or not other Admins on the account have access to this as well. If not, can you provide a screenshot of what you see on your end?

    Thanks!

    0
  • Andrei Sdasilva

    Hi guys,

    The tokens has an expirate date? 

    Thanks.

    0
  • Brett - Community Manager
    Zendesk Community Team

    Hi Andrei,

    API tokens do not have an expiration date.

    They can manually be revoked or deleted by another admin on the account.

    Cheers!

    2
  • Tarun Patel

    Can agent's have their own API token, or do they need to be converted to an Admin in order to get a token?

    0
  • Brett - Community Manager
    Zendesk Community Team

    Hey Tarun,

    Only Admins on the account can request an API token :)

    0
  • Sorin Vatasoiu

    Hi,

    I try to use the api's to get/create tickets and I have issues making calls through Postman. I'm an admin, I generated a token, encoded it, using the correct setup in GET call, but I get error: 

    {
    "error": "Couldn't authenticate you"
    }

    I try to use a GET call to https://nejm15xxxxxxxx.zendesk.com/api/v2/tickets.json and using "Authorization" header with a value of "Basic xxxxx" where xxxxx= encoded value for {email_address}/token:{api_token}.

    I tried the same call using curl, but I get the same error.

    Can you provide an working example for Postman, or do i miss anything else?

    1
  • Joey

    Hi Sorin-

    Using Postman you can simply select the 'Basic Auth' type under authorization and fill in the corresponding fields - don't forget to append /token to your email if using an API token. You shouldn't need to encode it beforehand.

    1
  • Sorin Vatasoiu

    thank you Joseph, it worked

    0
  • Yair Galler

    Hi, is it possible to generate an API key that is restricted in its permissions (i.e. limit to read-only calls)?

     

    Thanks,

    Yair.

    1
  • karmous ahmed

    HI i'm trying to make an api call with the token but i'm getting 

    {
    "error": "Couldn't authenticate you"
    }

    https://xxxxxxx.zendesk.com/api/v2/tickets.json?xxxxx.xxxxxx@xxxxxx.com/token:******************

     

    what i'm i doing wrong ? thx

    0
  • Mohammad ShabbirTaibani

    Hi , I am not able to see API under widget , when i login to Zendesk, 

    I want to get data from API using vba code, but as API Key is missing  , I am getting error : you must supply credential to complete this request 

     

     

    0
  • Brett - Community Manager
    Zendesk Community Team

    Hey Mohammad,

    Can you confirm you're an Admin on the account? Only Admins would have access to the API option under the Admin settings.

    If you are set up as an admin, can you provide a screenshot of what you see on your end?

    Thanks!

    0
  • Mohammad ShabbirTaibani

    Hi Brett, I got the API token , thanks for following up 

    0
  • Lnn K

    I just set up a sandbox but my account doesn't have admin on it- how do I get an admin account on a sandbox instance so I can get a token so I can test my code against my sandbox instance?

    0
  • Brett - Community Manager
    Zendesk Community Team

    Hey Linda,

    Agent's don't transfer over to the new Sandbox account. You'll want to log in with whatever agent account you created the Sandbox account with. Then, once you're logged in you can navigate to Admin>Manage>People and add your new admin to do some testing with.

    Let me know if the above doesn't make sense or if you continue to experience issues.

    Cheers!

    0
  • Harshit Beri

    Is there a way to programmatically create an API token using an older API token (or username/password)? I am trying to automate rotation of Zendesk API keys and need a programmatic way to create Zendesk API tokens

    0
  • Devan - Community Manager
    Zendesk Community Team

    Hello Harshit Beri,

    As our product currently stands, we don't have endpoints for token creation in the API. I've gone ahead and linked an article below that covers the API in more detail for your development needs. 

    Support API

    Best regards. 

    0
  • Cezar Vatafu

    Hello,

    For one of the brands we have an API integration to create new tickets  in Zendesk.  

    In administration we can see the number of API calls in the last 24 hours. 2 Questions here:

     

    1) Is there a way to separate successful-failure API calls ? also can we see the logs ?

     

     

    2) Is there a way to extend the timeframe ? from 24 hours to a custom value ?

     

     

    Thank you,

     

    Cezar

    0
  • Brett - Community Manager
    Zendesk Community Team

    Hey Cezar,

    1. There isn't a way to customize the information displayed on the admin page you're referencing. If you need additional information, we recommend implementing API logging on your side.

    2. There's no way of extending this time as it's hard coded into the system. However, you can set this up with your own API logging implementation if you choose to set one up.

    Let me know if you have any other questions!

    0

Please sign in to leave a comment.

Powered by Zendesk