Skip to content

Instantly share code, notes, and snippets.

View dubeyji10's full-sized avatar
💭
Cogito, ergo sum

Abhishek Dubey dubeyji10

💭
Cogito, ergo sum
View GitHub Profile
@dubeyji10
dubeyji10 / cleaned_clients_json_example.json
Created May 19, 2022 12:17
example - json schema of clients
{
"id": 14,
"contact_person1": "Ajay Laddha",
"contact_person2": "",
"company_name": "Neha Collection",
"company_grade": "D",
"phone_no": null,
"mobile_no1": "7567369544",
"mobile_no2": null,
"email": "[email protected]",
@dubeyji10
dubeyji10 / insert_InvoiceItems.py
Created May 18, 2022 10:58
to insert invoice items using api
import requests
import json
url = "https://www.zohoapis.in/crm/v2/invoice_items"
payload = json.dumps({
"data": [
{
"Name": "00000000000000000003",
"Total_Months": 2,
@dubeyji10
dubeyji10 / sampleInsert_withNewAuthor.py
Created May 18, 2022 10:56
insert data but with different user
import requests
import json
'''
in this payload has a created by field in json with neccessary fields
so creation is done by that user
"Created_By": {
"name": "your-user-name",
@dubeyji10
dubeyji10 / insertInvoiceInfo.py
Created May 17, 2022 11:18
for inserting data into invoice info
import requests
import json
'''
-> {{custom-module-name-2}} corressponds to invoice_info in postman client
dummy data insert into new custom module named invoice info
this is an auto increment field on invoice id
'''
@dubeyji10
dubeyji10 / insertConversation.py
Created May 17, 2022 07:34
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"
@dubeyji10
dubeyji10 / refreshToken.py
Created May 16, 2022 11:09
generating new access tokens from refresh token
import requests
'''
16 may 2022
create new client for new tokens
-> try new scopes for insert
-> tokens expire after 1hr so refresh and create new access tokens
'''
url = "https://accounts.zoho.in/oauth/v2/token?"
payload={
import requests
import pprint
import json
'''
Note : add https:// to the url it wont work without it
and for indian region use .in for accounts-domain(or accounts-url)
, and for api-domain
to get conversation from zoho crm
url = https://www.zohoapis.in/crm/v2/custom-module-name
@dubeyji10
dubeyji10 / header.json
Created May 16, 2022 10:58
custom module data fetch from zoho crm
{"scope":["ZohoCreator.report.READ"],
"expiry_time":"auto-generated",
"client_id":"add-your-client-secret",
"client_secret":"add-your-client-secret",
"code":"code-add-from-client",
"grant_type":"authorization_code"
}
@dubeyji10
dubeyji10 / sampleInsert.py
Created May 16, 2022 10:54
# for insertion of lead to zoho crm using v2 api
from pprint import pprint
import requests
import json
url = "https://www.zohoapis.in/crm/v2/Leads"
# trying to insert a lead using api and requests
'''
this is just a sample dummy input to the crm
'''
@dubeyji10
dubeyji10 / zoho_crm_postman_environment.json
Last active May 16, 2022 10:55
postman environment for zoho crm apis
{
"id": "dd809867-e207-43b8-ae65-2e9cd14903f7",
"name": "dubey_zoho_env_2",
"values": [
{
"key": "accounts-url",
"value": "https://accounts.zoho.in",
"enabled": true
},
{