Authentication for API requests

Have more questions? Submit a request

8 Comments

  • Shlomi Cohen

    The example only talk about username password . but more relevant is the format of the username/token:password , which is not that straight forward in basic auth.

    0
  • Dwight Bussman

    Hi Shiomi,

    I believe what you're asking about is covered by the second part of the answer which starts "If using an API-token to perform that authentication..."

    Please let me know if I'm failing to understand your comment correctly so that I can help improve this article.

    Thanks!

    0
  • Shlomi Cohen

    you are right , but i thought an example of such should be here as well. 

    for example for me it didn't work at the beginning just because my browser also sent the cookies and probably zendesk authenticated me through that.

    also , i started to wonder which part should be base64 encoded , eventually got  it but it was nice if it was clearer for example Authorization: Basic (base64encode(user@domain/token:token_value))

     

    0
  • Dwight Bussman

    Thanks Shlomi!

    Our Developer Docs now include additional information about base-64 encoding this auth info:

    https://developer.zendesk.com/rest_api/docs/core/introduction#security-and-authentication

    Please let me know if this is clearer or if it could still use improvement.

    0
  • Tomer Ben Arye

    Can you add this example of how to send it properly?

    Add an example of sending requests:

    session = requests.Session()
    session.headers = {'Content-Type': 'application/json', 'Authorization': 'Basic Basic_64_encoded_code'}

     

    0
  • Dwight Bussman

    Hi Tomer,

    Sure - good suggestion! I was trying to keep this as language-agnostic as possible, but having an example in Python could be useful as many folks use that for scripting.

    0
  • Matt Berry

    If I log into Zendesk with Google authentication, not my own Zendesk username and password, can I still use the API?

    0
  • Dwight Bussman

    Hi Matt,

    You'll need to create Zendesk credentials in order to authenticate API requests (or use an API/Oauth token). Google authentication will not work with the API.

    0

Please sign in to leave a comment.

Powered by Zendesk