Skip to content

Instantly share code, notes, and snippets.

@dubeyji10
Created May 17, 2022 07:34
Show Gist options
  • Save dubeyji10/0ba30824b4535c6d37301c97c0e12e3c to your computer and use it in GitHub Desktop.
Save dubeyji10/0ba30824b4535c6d37301c97c0e12e3c to your computer and use it in GitHub Desktop.
insert using api into custom module named conversation
import requests
import json
'''
{{accounts-domain}}/crm/v2/{{custom-module-name}}
in this case conversation
'''
url = "https://www.zohoapis.in/crm/v2/conversation"
payload = json.dumps({
"data": [
{
"msg": "message-you-want-to-insert",
"Owner": {
"name": "{{user-name}}",
"id": "{{user-id}}",
"email": "{{user-email}}"
},
"$currency_symbol": "₹",
"$field_states": None,
"with_email": "email-insert-here",
"$review_process": {
"approve": False,
"reject": False,
"resubmit": False
},
"Name": "title-of-sample-conversation",
"Last_Activity_Time": None,
"Record_Image": None,
"$review": None,
"$state": "save",
"Unsubscribed_Mode": None,
"$process_flow": False,
"$approved": True,
"$approval": {
"delegate": False,
"approve": False,
"reject": False,
"resubmit": False
},
"s_n": your-serial-num-int-11,
"Created_Time": "",
"Unsubscribed_Time": None,
"$editable": True,
"followup_on": "",
"$orchestration": False,
"user_id": "{{ user-id }}",
"$in_merge": False,
"Tag": [],
"$approval_state": "approved"
}
],
"trigger": [
"approval",
"workflow",
"blueprint"
]
})
headers = {
'Authorization': 'your-access-token',
'Content-Type': 'application/json',
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
@dubeyji10
Copy link
Author

success response to insert api for custom module ( conversation in this case )

success_insert_conversation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment