Namespace: API

API

Methods

staticZOHO.CRM.API.addNotes(config){Promise}

Add Notes to a record
Name Type Description
config Object Configuration Object.
Name Type Description
Entity String SysRefName of the module.
RecordID Long RecordID to associate the notes.
Title String Notes Title.
Content String Notes Content.
Returns:
Type Description
Promise Resolved with notes creation status
Example
ZOHO.CRM.API.addNotes({Entity:"Leads",RecordID:"1475615000000292033",Title:"Notes Title",Content:"TitleContent"}).then(function(data){
 console.log(data);
});

//prints 
{
  "code": "SUCCESS",
  "details": {
    "created_time": "2017-01-12T04:56:33+05:30",
    "modified_time": "2017-01-12T04:56:33+05:30",
    "modified_by": {
      "name": "Naresh Babu Naresh Babu",
      "id": "1475615000000083003"
    },
    "id": "1475615000000484005",
    "created_by": {
      "name": "Naresh Babu Naresh Babu",
      "id": "1475615000000083003"
    }
  },
  "message": "record added",
  "status": "success"
}

staticZOHO.CRM.API.deleteRecord(){Promise}

To delete a record from a module
Returns:
Type Description
Promise Resolved with Response to update record
Example
ZOHO.CRM.API.deleteRecord({Entity:"Leads",RecordID: "1000000049031"})
.then(function(data){
    console.log(data)
})

//prints 
[
   {
        "data": [
           {
                "message": "record updated",
                "details": {
                    "created_by": {
                        "id": "4108880000086001",
                        "name": "Patricia Boyle"
                    },
                    "id": "4108880000478060",
                    "modified_by": {
                        "id": "4108880000086001",
                        "name": "Patricia Boyle"
                    },
                    "modified_time": "2016-04-28T17:59:21+05:30",
                    "created_time": "2016-04-28T17:59:21+05:30"
                },
                "status": "success",
                "code": "SUCCESS"
            }
        ]
    }
]            

staticZOHO.CRM.API.getRecord(config){Promise}

get all Details of a record
Name Type Description
config Object Configuration Object.
Name Type Description
Entity String SysRefName of the module.
RecordID String RecordID to associate the notes.
Returns:
Type Description
Promise Resolved with data of record matching with RecordID
Example
ZOHO.CRM.API.getRecord({Entity:"Leads",RecordID:"1000000030132"})
.then(function(data){
    console.log(data)
})

//prints 
[
  {
    "Owner": {
      "name": "asd devvv",
      "id": "1000000030132"
    },
    "Company": "zoho",
    "Email": "svembu@zohocorp.com",
    "Description": null,
    "$photo_id": null,
    "Website": null,
    "Twitter": null,
    "$upcoming_activity": null,
    "Salutation": "",
    "Last_Activity_Time": "2016-12-30T15:09:23+05:30",
    "First_Name": null,
    "Full_Name": "sridhar",
    "Lead_Status": null,
    "Industry": null,
    "Modified_By": {
      "name": "asd devvv",
      "id": "1000000030132"
    },
    "Skype_ID": null,
    "$process_flow": false,
    "$converted": false,
    "Phone": null,
    "Street": null,
    "Zip_Code": null,
    "id": "1000000049009",
    "Email_Opt_Out": false,
    "$approved": true,
    "Designation": null,
    "$approval": {
      "delegate": false,
      "approve": false,
      "reject": false
    },
    "Modified_Time": "2016-12-30T15:09:23+05:30",
    "Created_Time": "2016-12-30T06:09:44+05:30",
    "$converted_detail": {
      
    },
    "$followed": false,
    "City": null,
    "No_of_Employees": 0,
    "Mobile": "+16692317086",
    "Last_Name": "sridhar",
    "State": null,
    "$status": "cmv_1-1",
    "Lead_Source": null,
    "Country": null,
    "Created_By": {
      "name": "asd devvv",
      "id": "1000000030132"
    },
    "Fax": null,
    "Annual_Revenue": 0,
    "Secondary_Email": null
  }
]

staticZOHO.CRM.API.insertRecord(config){Promise}

Insert record to a modue
Name Type Description
config Object Configuration Object.
Name Type Description
Entity String SysRefName of the module.
APIData Object RecordID to associate the notes.
Returns:
Type Description
Promise Resolved with response data
Example
var recordData = {
        "Company": "Zylker",
        "Last_Name": "Peterson"
  }
ZOHO.CRM.API.insertRecord({Entity:"Leads",APIData:recordData}).then(function(data){
	console.log(data);
	});

//prints
[
  {
    "code": "SUCCESS",
    "details": {
      "created_time": "2017-01-19T17:10:40+05:30",
      "modified_time": "2017-01-19T17:10:40+05:30",
      "modified_by": {
        "name": "asd devvv",
        "id": "1000000030132"
      },
      "id": "1000000070210",
      "created_by": {
        "name": "asd devvv",
        "id": "1000000030132"
      }
    },
    "message": "record added",
    "status": "success"
  }
]

staticZOHO.CRM.API.updateRecord(config){Promise}

To update a record in a module
Name Type Description
config Object Configuration Object.
Name Type Description
Entity String SysRefName of the module.
APIData String Update Record Data.
Returns:
Type Description
Promise Resolved with data of update Record Response
Example
var config={
  Entity:"Leads",
  APIData:{
        "id": "1000000049031",
        "Company": "Zylker",
        "Last_Name": "Peterson"
  }
}
ZOHO.CRM.API.updateRecord(config)
.then(function(data){
    console.log(data)
})

//prints 
[
   {
        "data": [
           {
                "message": "record updated",
                "details": {
                    "created_by": {
                        "id": "4108880000086001",
                        "name": "Patricia Boyle"
                    },
                    "id": "4108880000478060",
                    "modified_by": {
                        "id": "4108880000086001",
                        "name": "Patricia Boyle"
                    },
                    "modified_time": "2016-04-28T17:59:21+05:30",
                    "created_time": "2016-04-28T17:59:21+05:30"
                },
                "status": "success",
                "code": "SUCCESS"
            }
        ]
    }
]