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" |
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 | |
''' | |
-> {{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 | |
''' |
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 | |
url = "https://www.zohoapis.in/crm/v2/invoice_items" | |
payload = json.dumps({ | |
"data": [ | |
{ | |
"Name": "00000000000000000003", | |
"Total_Months": 2, |
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
{ | |
"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]", |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
/* example of clients table */ | |
/* without use of json_object */ | |
SELECT table2.* FROM ( SELECT 'Name', 'added_on', 'phone_no', 'local_id' , 'Email', 'clients_user_id' UNION ALL ( select company_name as Name,CONCAT(replace(DATE_FORMAT(added_on,'%Y-%m-%d %T'),' ','T'),"+05:30") as added_on,(select case when ifnull(phone_no,'') <> 0 then phone_no else '' end) as phone_no,id as local_id,email as Email,user_id as clients_user_id from clients ) ) table2; | |
set @json_file2 = ( | |
select group_concat(table1.data1, table1.data2 ) from | |
( | |
select concat('{"','clients_user_id','"',':','"',user_id,'",') as data1 ,concat('"','Name','"',':','"',company_name,'"}',char(10)) as data2 from clients |
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
/* | |
create a test db | |
use that db | |
to test and export sql dump | |
*/ | |
/* create a table clients */ | |
CREATE TABLE clients ( |
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
ALTER TABLE invoice_info CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; | |
/* errors - - - - address field not validated */ | |
set @json_ob_8 = ( | |
select REGEXP_REPLACE( | |
GROUP_CONCAT(json_object ( | |
'Name',CAST(id as CHAR), | |
'Address' ,Address, | |
'Email' ,Email , |
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
/* leads charset fixation */ | |
ALTER TABLE leads CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; | |
/* create a view to write out table of requirement*/ | |
/* -------------------------------------------------- */ | |
CREATE VIEW `leadsJsonView_2` AS | |
select | |
concat( | |
'{', | |
'"', |