Start Work on Service Appointment

Purpose

To start work on a dispatched service appointment.

Request URL

https://fsm.zoho.com/fsm/v1/Service_Appointments/<record_id>/actions/blueprint

Request Method

PUT

Scope

scope=ZohoFSM.modules.serviceappointments.UPDATE

Mandatory Parameters

NameDescriptionType
transition_idThe ID for the transition Start Work that can be obtained from the record using the List Transitions API.String

Optional Parameters

To start the timesheet for a specific service resource, and specific service line item, provide the following details in the $Time_Sheets JSON Object.

NameData TypeDescription
Service_Resource

String

 

The ID of the service resource for whom you want to create the timesheet. The ID can be obtained from the $Service_Resources key in the response of Get a Service Appointment API.
Service_Appointment (optional)StringThe ID of the appointment
Start_Date_TimeStringThe date and time at which you want to start the appointment
Service_Line_ItemsArrayInclude the IDs of the service line items for which you want to create the timesheet. The ID can be obtained from the Service_Line_Item key in the response of Get a Service Appointment API.
Service_Tasks_Line_Items(optional)ArrayInclude the IDs of the service task line items for which you want to create the timesheet. The ID can be obtained from the Service_Task_Line_Item key in the response of Get a Service Appointment API.

Sample Request

Copiedcurl --request PUT 'https://fsm.zoho.com/fsm/v1/Service_Appointments/2287000000440090/actions/blueprint' \
--header 'Authorization: Zoho-oauthtoken 1000.26xxxxxxxxxx.xxxxxxxxxx0' \
--header 'content-type: application/json' \
--data "{"field1":"value1","field2":"value2"}"

Sample Input

Copied{
    "blueprint": [
        {
            "transition_id": "2287000000169057",
            "data": {}
        }
    ]
}

Sample Input (with Optional Data)

Copied//To start the timesheet for a specific service resource, and specific service line item.
{
 "blueprint": [
   {
     "transition_id": "1003000000240063",
     "data": {
       "$Time_Sheets": {
         "Service_Resource": "1003000000208159",
         "Service_Appointment": "1003000001226523",
         "Start_Date_Time": "2023-12-22T09:00:53+05:30",
         "Service_Line_Items": [
           "1003000001226503"
         ],
         "Service_Tasks_Line_Items": [
           "1003000001226508"
         ]
       }
     }
   }
 ]
}

Sample Response

Copied{
    "code": "SUCCESS",
    "debug": {
        "forward": {
            "status": "error"
        },
        "backward": {
            "data": [
                {
                    "is_successfull": true,
                    "rule_trigger": {
                        "module": "Service_Appointments",
                        "id": "1003000000677660"
                    },
                    "info": "No rule exists"
                }
            ]
        }
    },
    "details": {},
    "message": "transition updated successfully",
    "actions": {
        "before": {},
        "after": {}
    },
    "status": "success"
}

Sample Error Response

Copied{
    "code": "BP_ACTION_ERROR",
    "details": {
        "action": "initiate_timesheet",
        "error": {
            "code": "TIMESHEET_ALREADY_OPEN",
            "details": {
                "Time_Sheets": [
                    {
                        "End_Date_Time": null,
                        "Start_Date_Time": "2023-12-21T11:44:17+05:30",
                        "Service_Appointment": {
                            "id": "1003000001222160",
                            "Name": "AP-26"
                        },
                        "id": "1003000001222227",
                        "Service_Resource": {
                            "id": "1003000000208159",
                            "Name": "Marianne Sheehan"
                        },
                        "Name": "TS36"
                    }
                ]
            },
            "message": "A Time sheet is already in progress. Complete exisiting timesheet to create new.",
            "status": "error"
        }
    },
    "message": "Error occured while processing blueprint actions",
    "status": "error"
}