The app will be ready to be initialized after defining the OAuth configuration file.įor self client apps, the self-authorized grant token should be generated from the Zoho Developer Console ( ) The SDK raises an exception if user_email is not set in any of the above mentioned methods. If you do not set the user email in current thread, then the SDK expects it from the configuration_dictionary. setattr('current_user_email',' can use the above method for single user authentication too, but it is recommended to set the email ID in the configuration_dictionary 'currentUserEmail':' work with multi-user authentication, set the user Email ID in current thread as an attribute. If your application needs only single user authentication then you have to set the user Email ID in the configuration_dictionary as below. To make API calls to sandbox account, set sandbox value in the configuration_dictionary. This file is to log the exceptions during the usage of the SDK. Include the absolute path in configuration_dictionary for the key applicationLogFilePath to store the logs. Persistence happens through file only.īased on your domain(EU, CN), change the value of accounts_url. If this is set, then there is no need of database for persistence. Token_persistence_path is the path to store the OAuth related tokens in file. 'persistence_handler_path': '/Users/Zoho/Desktop/PythonSDK/CustomPersistance.py'īased on the preferred persistence, add all mandatory keys in the configuration dictionary.Ĭlient_id, client_secret and redirect_uri are your OAuth client’s configurations that you get upon registering your Zoho client.Īccess_type must be set to offline, as online OAuth client is not supported by the SDK as of now. Use the below keys for custom DB persistence ![]() Use the below keys for MySQL DB persistence 'token_persistence_path':'/Users/Zoho/Desktop/PythonSDK/FilePersistence', Pip install -upgrade zcrmsdk Configurationīelow is a sample configuration dictionary containing all keys, which needs to be passed to ZCRMRestClient.initialize() on starting up your application. Run this command to upgrade the SDK to the latest version. This command installs the SDK and creates a package named zcrmsdk in the installation directory of python (ex. ![]() Run the following command to install the SDK: Please refer to the document below to install pip. If Custom DB implementation is used to persist tokens, then "persistence_handler_class" and "persistence_handler_path" keys must be added in configuration_dictionary Installation of SDK through pip In this case, MySQL is not required.Ĭreate an empty file with name zcrm_oauthtokens.pkl in the mentioned token_persistence_path If token_persistence_path is provided in configuration_dictionary file, then persistence happens in file only. There must be a table "oauthtokens" with the columns "useridentifier"(varchar(100)), "accesstoken"(varchar(100)), "refreshtoken"(varchar(100)), "expirytime"(bigint). MySQL should run in the same machine, either serving at the default port 3306 or a custom port which needs to be configured in mysql_port in configuration_dictionary.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |