Zoho CRM API:Python基于请求的POST或GET身份验证+;触点插入 任务##
django应用程序允许用户注册,一旦用户单击帐户激活链接,Zoho CRM将接收数据,并在CRM部分创建联系人 问题 我目前正在创作一部绝对的杰作——ZohoAPI。 我正在努力设置使用POST/GET请求的本机Python代码。 关于zcrmsdk 3.0.0,我已经完全放弃了这个解决方案,除非有人能够提供一个完整的功能示例。支持人员只是责怪我的代码 我查阅的文件: , 由于PostManAPI中的post请求工作正常,我不理解为什么它在python代码中不工作 我的方法Zoho CRM API:Python基于请求的POST或GET身份验证+;触点插入 任务##,python,django,api,crm,zoho,Python,Django,Api,Crm,Zoho,django应用程序允许用户注册,一旦用户单击帐户激活链接,Zoho CRM将接收数据,并在CRM部分创建联系人 问题 我目前正在创作一部绝对的杰作——ZohoAPI。 我正在努力设置使用POST/GET请求的本机Python代码。 关于zcrmsdk 3.0.0,我已经完全放弃了这个解决方案,除非有人能够提供一个完整的功能示例。支持人员只是责怪我的代码 我查阅的文件: , 由于PostManAPI中的post请求工作正常,我不理解为什么它在python代码中不工作 我的方法 在以下位置生成自
response = requests.post(url=url, headers=headers, data=json.dumps(request_body).encode('utf-8'))
在此基础上,添加了一些返回语句:
payload = '1000.6d9411488dcac999f02304d1f7843ab2.e14190ee4bae175debf00d2f87143b19&' \
'redirect_uri=http%3A%2F%2Fexample.com%2Fyourcallback&' \
'client_id=1000.H95VDM1H9KCXIADGF05E0E1XSVZKFQ&' \
'client_secret=290e505ec52685fa62a640d874e6560f2fc8632e97&'\
'grant_type=authorization_code'
response = requests.request(method="POST", url=url, headers=headers, data=payload)
if response is not None:
print("HTTP Status Code : " + str(response.status_code))
# print(response.text)
print(response.json())
# catch access and refresh token
at = response.json().get('access_token')
rt = response.json().get('refresh_token')
return at, rt
我不明白为什么这是不同的,但它修复了它,我可以从ZOHO检索钥匙
payload = '1000.6d9411488dcac999f02304d1f7843ab2.e14190ee4bae175debf00d2f87143b19&' \
'redirect_uri=http%3A%2F%2Fexample.com%2Fyourcallback&' \
'client_id=1000.H95VDM1H9KCXIADGF05E0E1XSVZKFQ&' \
'client_secret=290e505ec52685fa62a640d874e6560f2fc8632e97&'\
'grant_type=authorization_code'
response = requests.request(method="POST", url=url, headers=headers, data=payload)
if response is not None:
print("HTTP Status Code : " + str(response.status_code))
# print(response.text)
print(response.json())
# catch access and refresh token
at = response.json().get('access_token')
rt = response.json().get('refresh_token')
return at, rt