Python SDK import endpoint "file-like object"

Please include the following information in your post:

  • Which SDK this is regarding: auth0-python
  • SDK Version: 3.13.0
  • Platform Version: python 3.9.5

The import endpoint requires a “file-like object”. Does anyone know what that means? Is this just a dictionary formatted per the docs for user import?

    def import_users(self, connection_id, file_obj, upsert=False, send_completion_email=True, external_id=None):
        """Imports users to a connection from a file.
        Args:
.
.
.
            file_obj (file): A file-like object to upload. The format for
                this file is explained in: https://auth0.com/docs/bulk-import.

Hi @markd,

The SDK is calling the POST/api/v2/jobs/users-imports endpoint in that method and so it’s expecting a JSON file.

https://auth0.com/docs/users/bulk-user-imports#request-bulk-user-import

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.