Kaizen #38 - Calls #API

Kaizen #38 - Calls #API

Hello everyone! 
Welcome back to another post in the Kaizen series!
This week, we will discuss adding, updating, and deleting Calls via an API.

What are Calls in Zoho CRM?
The Log a Call functionality helps you to register the inbound calls (received from leads and customers) and outbound calls (dialed to leads and customers) with call details such as call duration, date and time of calls, notes, etc. Users who frequently make calls or receive calls in an organization can use this functionality in Zoho CRM.

Let us now see how you can work with Calls using APIs.

1. Inserting a Call Record
Use the Insert Records API to insert a record in the Calls module.

Request URL: {{api-domain}}/crm/v2/Calls
Request method: POST

Sample Input

{
    "data": [
        {
            "Subject": "Call from +13012670261",
            "Call_Purpose": "Prospective",
            "Who_Id": "3652397000000649013",
            "Call_Start_Time": "2020-06-25T10:30:00+05:30",
            "Call_Type": "Outbound",
            "$se_module": "Accounts",
            "What_Id": "3652397000000624046"
        }
    ]
}

Input JSON

Key
Data Type
Description
Subject
String
Subject of the call.
Call_Purpose
String
Purpose of the call. Use the Field Metadata API to get the values of this field. As this field is a picklist, when you specify a new value, the new value gets added to list of options in this picklist.
Who_Id
String
Record ID of the contact the call is related to.
Call_Start_Time
DateTime in ISO8601
The date and time when the call starts, in the ISO8601 format. This key is mandatory.
Call_Type
String
The type of call. The possible values are "Inbound", "Outbound", and "Missed". This key is mandatory.
What_Id
String
Record ID of the account or any other module the contact is associated with. 
If you want to create a call for a lead, specify the lead's record ID here.
$se_module
String
The API name of the parent module of the associated contact.
In case the What_Id, is a lead's ID, the value for this key will be "Leads".
Call_Duration
String
The duration that the call lasted for, in the hh:mm format. This key is mandatory for completed calls.

Things of Note
  • Who_Id is always a contact's record ID.
  • If you want to create a call for a lead, specify the lead's record ID in the What_Id key and the value of $se_module as Leads.
  • If the Call_Start_Time is in the past (not current time), it is considered as a completed call, and Call_Duration becomes mandatory.
  • For a missed call, if you specify Call_Duration, the system ignores the call duration.
Sample Response


2. Updating a Call
Use the Update Specific Record API or Update Records API to update the call(s).
The input keys are similar to the ones mentioned in the Insert Call section.
 
Request URL: {{api-domain}}/crm/v2/Calls/3652397000002171008
Request method: PUT

Errors common to inserting and updating a call

Error code
Reasons
Handling
INVALID_DATA
1. The call_start_time is empty.
2. The value of the call_start_time key is in an incorrect format.
3. For a completed call, the call_duration is empty.
4. The value for the call_type key is incorrect.
5. You are trying to update the Call_Type.
6. You are trying to update the Owner of a completed call.
7. You have provided an incorrect Call_Start_Time for a completed call.
1. You must specify the call_start_time.
2. The value for the call_start_time key must be in the ISO8601 format.
3. You must specify the call_duration for a completed call.
4. Specify the correct value for the call_type key.
5. You cannot update the Call_Type key through the PUT request.
6. You cannot update the Owner of a completed call.
7. For a completed call, the sum of the Call_Start_Time and the call duration must not exceed the current time.
MANDATORY_NOT_FOUND
While updating multiple calls, you have not specified the record IDs in the request body.
Specify the record ID of the calls that you want to update in the request body.


3. Deleting a Call
Use the Delete Specific Record API or Delete Records API to delete the call(s).

Request URL: {{api-domain}}/crm/v2/Calls/3652397000002172001
or {{api-domain}}/crm/v2/Calls?ids=3652397000002172001,3652397000002171002
Request method: DELETE

Note: You can pass a maximum of 100 record IDs in the ids parameter.

Sample response




We hope you found this post useful. 
Write to us at support@zohocrm.com if you have any questions, or let us know in the comment section.

Cheers!







    Access your files securely from anywhere

        Zoho Developer Community







                                  Zoho Desk Resources

                                  • Desk Community Learning Series


                                  • Digest


                                  • Functions


                                  • Meetups


                                  • Kbase


                                  • Resources


                                  • Glossary


                                  • Desk Marketplace


                                  • MVP Corner


                                  • Word of the Day



                                      Zoho Marketing Automation


                                              Manage your brands on social media



                                                    Zoho TeamInbox Resources

                                                      Zoho DataPrep Resources



                                                        Zoho CRM Plus Resources

                                                          Zoho Books Resources


                                                            Zoho Subscriptions Resources

                                                              Zoho Projects Resources


                                                                Zoho Sprints Resources


                                                                  Qntrl Resources


                                                                    Zoho Creator Resources



                                                                        Zoho Campaigns Resources


                                                                          Zoho CRM Resources

                                                                          • CRM Community Learning Series

                                                                            CRM Community Learning Series


                                                                          • Kaizen

                                                                            Kaizen

                                                                          • Functions

                                                                            Functions

                                                                          • Meetups

                                                                            Meetups

                                                                          • Kbase

                                                                            Kbase

                                                                          • Resources

                                                                            Resources

                                                                          • Digest

                                                                            Digest

                                                                          • CRM Marketplace

                                                                            CRM Marketplace

                                                                          • MVP Corner

                                                                            MVP Corner





                                                                              Design. Discuss. Deliver.

                                                                              Create visually engaging stories with Zoho Show.

                                                                              Get Started Now