A django application that allows users to sign up and once the user clicks on the account activation link, Zoho CRM is receiving the data and a contact is created in the CRM section. Olansi Air Purifier
I am currently working on an absolute masterpiece - the ZOHO API. I am struggling to set up the native Python code that uses POST/GET requests. Regarding the zcrmsdk 3.0.0, I have completely given up on this solution unless somebody can provide a fully functional example. The support simply blames my code.
The documentation I consulted:
Since the post request in postman API works fine I do not understand why it does not work in python code
The permsissions scope I am using is: ZohoCRM.modules.contacts.ALL, ZohoCRM.users.ALL, ZohoCRM.modules.deals.ALL, ZohoCRM.modules.attachments.ALL, ZohoCRM.settings.ALL, AAAserver.profile.ALL
def authenticate_crm(): """ access to response object id: response_object.get('data')[0].get('details').get('id') """ url = 'https://accounts.zoho.com/oauth/v2/token' headers = { 'Content-Type': 'application/x-www-form-urlencoded' } # one time self-client token here - request_body = { "code": "1000.aa8abec144835ab79b8f9141fa1fb170.8ab194e4e668b8452847c7080c2dd479", "redirect_uri": "http://example.com/yourcallback", "client_id": "1000.H95VDM1H9KCXIADGF05E0E1XSVZKFQ", "client_secret": "290e505ec52685fa62a640d874e6560f2fc8632e97", " grant_type": "authorization_code" } response = requests.post(url=url, headers=headers, data=json.dumps(request_body).encode('utf-8')) if response is not None: print("HTTP Status Code : " + str(response.status_code)) print(response.json())
I am essentially struggling to convert the Postman API request to a Python request to get the token as part of the workflow. What am I doing wrong here?
The documentation states: Note: For security reasons, pass the below parameters in the body of your request as form-data. (access-refresh link) but passing it in postman as form-data breaks the call completely.
According to their own documentation (which is convoluted, contradictory and full of outdated screenshots) the authentication key is needed only once. Once the request from above runs, I would take the response in the third image and use the refresh key to add the contact. I am also open to a solution with the SDK 3.0.0, if anybody can help.
Writer is a powerful online word processor, designed for collaborative work.