module 'zcrmsdk' has no attribute 'ZCRMRestClient'

Viewed 443

I am unable to get the following working:

    import zcrmsdk
    
    config = {
    "apiBaseUrl":"https://www.zohoapis.com",
    "apiVersion":"v2",
    "currentUserEmail":"sample@gmail.com",
    "sandbox":"False",
    "applicationLogFilePath":"./log",
    "client_id":"1000.1xxxxxxxxxxxxxxxxxxxxxxxxxxxC",
    "client_secret":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "redirect_uri":"http://localhost:800/some_path",
    "accounts_url":"https://accounts.zoho.com",
    "token_persistence_path":"",
    "access_type":"online"
    }
    
    zcrmsdk.ZCRMRestClient.initialize(config)
    oauth_client = zcrmsdk.ZohoOAuth.get_client_instance()
    grant_token = "1000.xxxxxxxxxxxxx.....xxxxxxxx...x.x.x"
    oauth_tokens = oauth_client.generate_access_token(grant_token)
    
    print(oauth_tokens)

I get the AttributeError: module 'zcrmsdk' has no attribute 'ZCRMRestClient'

I know I am missing something. What am I missing? Can someone please help?

1 Answers

Had the same issue. I think it has to do with the version you are using.Version zcrmsdk==2.0.12 has this attribute available.

Related