Created
May 17, 2022 07:34
-
-
Save dubeyji10/0ba30824b4535c6d37301c97c0e12e3c to your computer and use it in GitHub Desktop.
insert using api into custom module named conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
success response to insert api for custom module ( conversation in this case )