Create a Service Appointment
Purpose
To insert a new service appointment record.
Request URL
https://fsm.zoho.com/fsm/v1/Service_Appointments
Request Method
POST
Scope
scope=ZohoFSM.modules.ServiceAppointments.CREATE
Input JSON Parameters
Name | Description | Type | Mandatory |
Summary | A summary for the service appointment | String | Yes |
Scheduled_Start_Date_Time | The scheduled start date time for the appointment | String | Yes |
Scheduled_End_Date_Time | The scheduled end date time for the appointment | String | Yes |
$Service_Line_Items | Include the IDs of the service line items in the work order for which you want to create an appointment | Array | Yes |
$Service_Tasks_Line_Items | Include the IDs of the service task line items in the work order for which you want to create an appointment. Mandatory if service tasks are present in the work order. | Array | |
Territory | Include the ID of the territory assigned to the work order | String | Yes, if there are multiple territories in the organization |
$Service_Resources | Include the IDs of the service resources you want to assign to the appointment. Use the id in the Service_Resources key present in the List Users API response. | Array | |
Lead | Provide an ID from those included in the $Service_Resources key. Mandatory if you provide more than one ID for the $Service_Resources key. | String | |
$allow_overlapping | If the transaction setting Allow Overlapping Appointments is enabled With Warning, setting $allow_overlapping to true will create an overlapping appointment. | Boolean |
Sample Request
Copiedcurl --location --request POST 'https://fsm.zoho.com/fsm/v1/Service_Appointments' \
--header 'Authorization: Zoho-oauthtoken 1000.26xxxxxxxxxx.xxxxxxxxxx0' \
--header 'content-type: application/json' \
--data "{"field1":"value1","field2":"value2"}"
Sample Input
Copied{
"data": [
{
"Summary": "Sample",
"Scheduled_Start_Date_Time": "2024-02-28T09:00:00-05:00",
"Scheduled_End_Date_Time": "2024-02-28T10:00:00-05:00",
"Territory": "6191000000227288",
"$Service_Tasks_Line_Items": [
"6191000000425243"
],
"$Service_Line_Items": [
"6191000000425238"
],
"$Service_Resources": [
"6191000000227293",
"6191000000299042"
],
"Lead": "6191000000227293",
"$allow_overlapping": false
}
]
}
Sample Success Response
Copied{
"result": "success",
"code": "SUCCESS",
"data": [
{
"UID": "Service_Appointments_0",
"Modified_Time": "2024-02-26T05:05:24-05:00",
"Modified_By": {
"name": "Alicia Florrick",
"id": "6191000000227001"
},
"Created_Time": "2024-02-26T05:05:24-05:00",
"id": "6191000000426111",
"Created_By": {
"name": "Alicia Florrick",
"id": "6191000000227001"
},
"TabName": "ServiceAppointments"
}
],
"status": "success"
}
Sample Error Response
Copied{
"code": "SERVICE_RESOURCE_NOT_AVAILABLE",
"details": {
"availability_check": [
{
"Time_Off": [],
"Service_Appointments": [],
"Crew_Members": [],
"is_available": false
},
{
"Time_Off": [],
"Service_Appointments": [],
"Crew_Members": [],
"is_available": false
}
]
},
"message": "Service Resource is not available",
"status": "error"
}