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

NameDescriptionType
Summary
(mandatory)
A summary for the service appointmentString
Scheduled_Start_Date_Time
(mandatory)                                        
The scheduled start date time for the appointmentString
Scheduled_End_Date_Time
(mandatory)
The scheduled end date time for the appointmentString
$Service_Line_Items
(mandatory)
Include the IDs of the service line items in the work order for which you want to create an appointmentArray
$Service_Tasks_Line_ItemsInclude 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
TerritoryInclude the ID of the territory assigned to the work orderString
$Service_ResourcesInclude 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
LeadProvide an ID from those included in the $Service_Resources key. Mandatory if you provide more than one ID for the $Service_Resources key.String

*This field will be mandatory depending on the sync type for the FSM-Invoice/Books integration

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"
        }
    ]
}

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"
}