الحجوزات›ترتيب الفنّيين لإدراج طارئ من فئة P0

ترتيب الفنّيين لإدراج طارئ من فئة P0

تُرجع الفنّيين الذين يمكنهم تولّي العمل الطارئ في وقت البدء المطلوب، مرتّبين حسب الأسرع وصولًا أولًا (الوصول يتقدّم على كفاءة المسار في حالة P0). تحمل الاستجابة أيضًا `crew_recommendation` تاريخيًا (الحجم الوسيط للطاقم في أعمال مكتملة مماثلة + إخلاء مسؤولية إلزامي — AC-2). الفنّيون المحجوزون يظلّون مرشّحين — يحمل كل مدخل معاينة الإزاحة (أي الأعمال الأدنى أولوية التي ستُدفع، لكل يوم) التي سيسبّبها الالتزام بهم؛ total_moves=0 يعني خانة حرّة. أعمال P0 لا تُزاح أبدًا؛ وP1 لا يُزاح إلا بواسطة P0. يُقدَّر وقت الوصول من موقع بدء الفنّي (بلا GPS مباشر). مرّر technician_id المختار إلى emergency/preview + emergency/commit. الخطوات التالية عند 409: EMERGENCY_RESCHEDULE_NOT_ELIGIBLE — لا يمكن إدراج العمل كطارئ (ليس P0، أو بدأ/اكتمل/أُرشِف بالفعل، أو غير مسعّر): صحّح حالة العمل أو استخدم تأكيدًا عاديًا. EMERGENCY_RESCHEDULE_CREW_UNSUPPORTED — أعمال الطاقم لا يمكنها استخدام مسار الطوارئ (الإصدار v1): وفّر الطاقم عبر confirm/reassign بدلًا من ذلك. EMERGENCY_RESCHEDULE_NO_WORKING_DAY — التاريخ المختار لا يتضمّن ساعات عمل: اختر يوم عمل. EMERGENCY_RESCHEDULE_IN_PAST — وقت البدء مضى بالفعل: اختر وقتًا في المستقبل.

المعاملات

after_hours_overridebooleanbodyاختياري
Place this P0 outside working hours / approved time-off — you have phoned the technician and they agreed. Drops the non-working-day rejection; the response then carries an AFTER_HOURS warning. Double-booking, service area, required skills and the lead-tier rule still reject.
emergency_job_idstringbodyاختياري
UUID of the P0 job to place. Send this OR `job`, never both and never neither.
▾jobobjectbodyاختياري
A job that does not exist yet — the wizard's read-only preview before anything is written. Send this OR `emergency_job_id`.
▾addressobjectbodyاختياري
Service address for a caller who does not exist yet. Geocoded when it carries no coordinates.
citystringbodyاختياري
countrystringbodyاختياري
formattedstringbodyاختياري
latitudenumberbodyاختياري
linestringbodyاختياري
line2stringbodyاختياري
longitudenumberbodyاختياري
postal_codestringbodyاختياري
statestringbodyاختياري
customer_idstringbodyاختياري
UUID of an existing customer — their stored address is used. Send this OR `address`.
demobilization_minutesintegerbodyاختياري
Demobilization minutes after the work — same rules as mobilization_minutes.
job_duration_minutesintegerbodyاختياري
Hands-on work minutes. Optional when the job type carries a default.
job_type_idstringbodyاختياري
UUID of the job type: supplies default_duration_minutes when job_duration_minutes is omitted. Optional — omitted, the business's default job type applies.
mobilization_minutesintegerbodyاختياري
Mobilization minutes before the work — same fallback rules as quoteJobRequest.
skill_idsarray<string>bodyاختياري
UUIDs of skills the work needs. Optional; up to 20.
limitintegerbodyاختياري
الحد الأقصى للمرشّحين المُرجَعين (الافتراضي 5، الحد الأقصى 10).
modeenumbodyمطلوب
Cascade mode each candidate's displacement preview assumes: overtime = displaced jobs stay same-day; next_day = overflow rolls to the next working day.
start_atstringbodyمطلوب
Desired start — business-local wall clock. Seconds may be omitted and a space may replace the T; an offset is accepted only when it agrees with the business timezone (a disagreeing one is refused with JOB_REQUEST_INVALID_INPUT rather than guessed). Must be in the future.
POST/v1/job-requests/emergency/candidates
curl -X POST "https://api.crisphive.com/v1/job-requests/emergency/candidates" \
  -H "Authorization: Bearer chsk_test_4eC8xQ9mZ2pL7Ka0rT" \
  -H "Content-Type: application/json" \
  -d '{
  "after_hours_override": true,
  "emergency_job_id": "9b2f6c3e-1a4d-4f0a-8f2e-7c5d1b3a9e01",
  "job": {
    "address": {
      "city": "San Francisco",
      "country": "US",
      "formatted": "123 Market Street, San Francisco, CA 94103",
      "latitude": 1,
      "line": "123 Market Street",
      "line2": "Suite 200",
      "longitude": 1,
      "postal_code": "94103",
      "state": "CA"
    },
    "customer_id": "9b2f6c3e-1a4d-4f0a-8f2e-7c5d1b3a9e01",
    "demobilization_minutes": 15,
    "job_duration_minutes": 90,
    "job_type_id": "9b2f6c3e-1a4d-4f0a-8f2e-7c5d1b3a9e01",
    "mobilization_minutes": 15,
    "skill_ids": [
      "9b2f6c3e-1a4d-4f0a-8f2e-7c5d1b3a9e01"
    ]
  },
  "limit": 1,
  "mode": "overtime",
  "start_at": "2030-06-14T09:00:00"
}'
نص الطلب
{
"after_hours_override": ,
"emergency_job_id": ,
"job": {
"address": {
"city": ,
"country": ,
"formatted": ,
"latitude": ,
"line": ,
"line2": ,
"longitude": ,
"postal_code": ,
"state":
},
"customer_id": ,
"demobilization_minutes": ,
"job_duration_minutes": ,
"job_type_id": ,
"mobilization_minutes": ,
"skill_ids": [
]
},
"limit": ,
"mode": ,
"start_at":
}

الاستجابات