Importing users with the Zendesk API

Have more questions? Submit a request

41 Comments

  • Unibet
    Comment actions Permalink

    Looks like an error with how you setup authorization 

    This article might help

    https://develop.zendesk.com/hc/en-us/community/posts/360004389168-Zendesk-API-throwing-401-Unauthorized-error

    0
  • Maria Skilbred
    Comment actions Permalink

    Thank you! I will take a look.

    0
  • Maria Skilbred
    Comment actions Permalink

    Thank you! That worked! It sounds like Zendesk may have made some changes to the use of the password when connecting to the API. The use of the token resolved that issue.

    0
  • Unibet
    Comment actions Permalink

    Great. There are different strategies in using tokens vs passwords but I dont think displaying an admin password sits well with me especially if you intend having someone else maintain your code

    0
  • Maria Skilbred
    Comment actions Permalink

    I agree, thanks, Gary! By any chance, do you happen to know if there is a notification that can be set up in Zendesk after uploading the file? Even though the Python script is coded to log a success/error message, it would be nice to also get a notification from Zendesk. 

    0
  • Unibet
    Comment actions Permalink

    The server response already confirms a successful upload and you can start searching for any clients within a minute from experience.

    I've created a log file and update it with the server response to confirm when I last did a successful import with the following bit of code:

    I import the time module
     
    create a time stamp
    time_stamp = time.asctime()
     
    Then add the server response and time stamp to the log:
     
        #adds an entry to import log in csv saved to zendesk_import_log
        with open(zendesk_import_log, "a", newline='') as csvfile:
            log_write_row = csv.writer(csvfile)
            log_write_row.writerow([server_response, time_stamp])
     
    0
  • Maria Skilbred
    Comment actions Permalink

    Thank you, Gary! Your responses and Charles', as well as this article in general, have been quite useful! Have a great day!

    0
  • Unibet
    Comment actions Permalink

    No problem. This is all Charles though. I'm just a learner programmer

    0
  • Gary Kester
    Comment actions Permalink

    Hi Charles Nadeau. Just checking if the limit is still set to 2000 users per minute?

    If I create / update 2000 users, does this take some time to index before I can search against it?

    0
  • Charles Nadeau
    Comment actions Permalink

    Hi Gary,

    The 2000-user limit mentioned in the article refers to the feature in the Zendesk admin interface for bulk importing users (see https://support.zendesk.com/hc/en-us/articles/203661996). It's an alternative to using the API. It lets you import one CSV file of 2,000 users or less at a time. 

    The API rate limit varies depends on your plan level and other factors. See Usage limits in the reference docs.

    Because the Create Many Users endpoint creates a job to create records instead of creating the records directly, there will be a delay before you can search for them. You can use the Job Status API to monitor the status of the job. Confirm that the status of the job returns "completed" before searching for the users.

    Thanks.

     

    0
  • Gary Kester
    Comment actions Permalink

    Thanks Charles. The job ID is very useful and I've updated my code to pull that so I can check if I need to. It's pretty descriptive with the error's as well,

    0

Please sign in to leave a comment.

Powered by Zendesk