WebHook Intervention Request

Résumé

Manipulation de l'entité InterventionRequest (Demandes d'interventions) en lecture/écriture/suppression via un objet métier depuis une application externe.

Tables

Les tables utilisées sont :

  • sw_data_interventionrequest : Table des demandes d'interventions

Les tables liées sont :

  • sw_data_interventionrequestequipment : Table des Ă©quipements d'une demande d'intervention

Critères d'activation

WHK_Request est défini dans la gestion des webhooks du studio.

Fonctionnement

verb: GET
resultType: simple

"interventionrequest": { "codeinterventionrequest": "EXT00000001", "customeraddress_ID": "C0000001-BDX", "customer_ID": "C0000001", "label": "Fuite gaz", "requestDate": "2021-06-04 11:03:50", "generictype_ID_source": "PHONE", "generictype_ID_type": "INCIDENT", "generictype_ID_status": "NEW" }

verb: GET
resultType: extended

"interventionrequest": { "codeinterventionrequest": "EXT00000001", "customeraddress_ID": "C0000001-BDX", "customer_ID": "C0000001", "label": "Fuite gaz", "requestDate": "2021-06-04 11:03:50", "generictype_ID_source": "PHONE", "generictype_ID_type": "INCIDENT", "generictype_ID_status": "NEW", "contactName": "Igor Grannienski", "contactEmail": "igra@soc.com", "contactPhoneNumber": "06....", "description": "Forte odeur de gaz sur l'échappement du brûleur", "baseuser_ID_internalRequest": "BERNARD", "customercontact_ID_externalRequest": "", "customercontact_ID": "C0000001-IG", "interventionrequestpriority_ID": "BLOCKING", "requestInterventionDate": "2021-06-04 00:00:00", "contract_ID_equipment": "", "equipmentwarrantytype_ID": "", "symptom_ID": "A", "externalID": "", "orderheader_ID": "" }

verb: GET
resultType: extendedRelated
en complément du résultat pour resultType: extended on aura le détail pour les tables customeraddress, customer, generictype_type, generictype_source, generictype_status, interventionrequestpriority, customercontact, baseuser_internalRequest, customercontact_externalRequest et symptom

"related":[ { "customeraddress":{ "codecustomeraddress":"C0000001-BDX", "customer_ID":"C0000001", "name":"ENTREPÔT GUICHARD", "site":"1", ... }, "customer":{ "codecustomer":"C0000001", "name":"ENTREPRISE DIJON GUICHARD", ... }, "generictype_type": { "codegenerictype": "INTERVENTION_REQUEST_TYPE-INCIDENT", "label": "Incident", "originalCode": "INCIDENT", "dataType": "INTERVENTION_REQUEST_TYPE", "description": "", "translationKey": "GenType_INTERVENTION_REQUEST_TYPE-INCIDENT", "generictype_ID_parent": "", "tag": "", "orderNumber": "" }, "generictype_source": { "codegenerictype": "INTERVENTION_REQUEST_SOURCE-PHONE", "label": "Phone", "originalCode": "PHONE", "dataType": "INTERVENTION_REQUEST_SOURCE", "description": "", "translationKey": "GenType_INTERVENTION_REQUEST_SOURCE-PHONE", "generictype_ID_parent": "", "tag": "", "orderNumber": "" }, "generictype_status": { "codegenerictype": "INTERVENTION_REQUEST_STATUS-NEW", "label": "New", "originalCode": "NEW", "dataType": "INTERVENTION_REQUEST_STATUS", "description": "", "translationKey": "GenType_INTERVENTION_REQUEST_STATUS-NEW", "generictype_ID_parent": "", "tag": "NEW", "orderNumber": "0" }, "interventionrequestpriority": { "codeinterventionrequestpriority": "BLOCKING", "label": "Blocking", "orderNumber": "3", "generictype_ID_style": "BO-STYLE-label-warning", "urgent": "1" }, "customercontact": { "codecustomercontact":"C0000001-IG", "customer_ID":"C0000001", "lastName":"Grannienski", "firstName":"Igor", "generictype_ID_civility":"Monsieur", ... }, "baseuser_internalRequest": { "codebaseuser": "1", "lastName": "BERNARD", "firstName": "Dominique", "initials": "BC", ... }, "customercontact_externalRequest": { "codecustomercontact": "", "customer_ID": "", "generictype_ID_civility": "", "lastName": "", "firstName": "", ... }, "symptom": { "codesymptom": "A", "label": "Défaut général", "equipmentkind_ID": "", "equipmenttype_ID": "", "interventionDuration": "", "externalLink": "", "endDate": "", "symptom_ID_parent": "", "resolution": "", "internalUse": "" } }]

verb: PUT

{ "interventionrequest": { "codeinterventionrequest": "EXT00000001", /* Code globalement unique de la demande d'intervention (Varchar (255))*/ "customer_ID": "C0000001", /* Code client (ForeignKey () - sw_data_customer.codecustomer)*/ "customeraddress_ID": "C0000001-BDX", /* Code adresse client (ForeignKey () - sw_data_customeraddress.codecustomeraddress)*/ "generictype_ID_source": "INTERVENTION_REQUEST_SOURCE-PHONE", /* Code source de la demande d'intervention (ForeignKey () - sw_data_generictype.codegenerictype avec datatype = INTERVENTION_REQUEST_SOURCE)*/ "generictype_ID_type": "INTERVENTION_REQUEST_TYPE-INCIDENT", /* Code type de demande d'intervention (ForeignKey () - sw_data_generictype.codegenerictype avec datatype = INTERVENTION_REQUEST_TYPE)*/ "requestDate": null, /* Date de la demande. Si vide on la positionne lors d'une création (Date/Heure courante par défaut) (DateTime ())*/ "label": "Fuite gaz", /* Libellé (Varchar (255))*/ "description": "Forte odeur de gaz sur l'échappement du brûleur", /* Description (Text (65535)) "baseuser_ID_internalRequest": "1", /* Code demandeur interne (ForeignKey () - sw_data_baseuser.codebaseuser)*/ "customercontact_ID_externalRequest": null, /* Code demandeur externe (ForeignKey () - sw_data_customercontact.codecustomercontact)*/ "customercontact_ID": "C0000001-IG", /* Code contact (ForeignKey () - sw_data_customercontact.codecustomercontact)*/ "contactName": "Igor Grannienski", /* Nom du contact (Varchar (255))*/ "contactEmail": "igra@soc.com", /* Email du contact (Varchar (255))*/ "contactPhoneNumber": "06....", /* N° de téléphone du contact (Varchar (255))*/ "interventionrequestpriority_ID": "BLOCKING", /* Code priorité (ForeignKey () - sw_data_interventionrequestpriority.codeinterventionrequestpriority)*/ "requestInterventionDate": "2021-05-26", /* Date d'intervention souhaitée (DateTime ())*/ "symptom_ID": "A", /* Code symptôme général (ForeignKey () - sw_data_symptom.codesymptom)*/ "externalID": "" /* Code externe (Varchar (255))*/ }, "interventionrequestequipment": [ { "codeinterventionrequestequipment": "EXT00000001-BAL01", /* Code globalement unique d'un équipement dans une demande d'intervention. Composé : codedemandeintervention + "-" + codeequipment (Varchar(255))*/ "interventionrequest_ID": "EXT00000001", /* Code demande d'intervention. Reprendre le code intervention du bloc json "interventionrequest" (ForeignKey () - sw_data_interventionrequest.codeinterventionrequest)*/ "equipment_ID" : "BAL01", /* Code de l'équipement. Doit avoir été créé avant la création de la demande d'intervention (ForeignKey () - sw_data_equipment.codeequipment)*/ "symptom_ID": "" /* Code symptôme lié à l'équipement (ForeignKey () - sw_data_symptom.codesymptom)*/ }, { "codeinterventionrequestequipment": "EXT00000001-BAL02", /* Code globalement unique d'un équipement dans une demande d'intervention. Composé : codedemandeintervention + "-" + codeequipment (Varchar(255))*/ "interventionrequest_ID": "EXT00000001", /* Code demande d'intervention. Reprendre le code intervention du bloc json "interventionrequest" (ForeignKey () - sw_data_interventionrequest.codeinterventionrequest)*/ "equipment_ID" : "BAL02", /* Code de l'équipement. Doit avoir été créé avant la création de la demande d'intervention (ForeignKey () - sw_data_equipment.codeequipment)*/ "symptom_ID": "" /* Code symptôme lié à l'équipement (ForeignKey () - sw_data_symptom.codesymptom)*/ } ] }

verb: LIST
resultType: simple, extended reprendre les définitions du GET

"filters:" { "codeInterventionRequest": "value", filter is equal "label": "value", filter is contains "codeCustomer": "value", filter is equal "codeCustomerAddress": "value", filter is equal "requestDate": "value", filter is greater or equal to "requestDateBetween": "value1|value2", filter is between value1 and value2 "requestInterventionDate": "value", filter is greater or equal to "requestInterventionDateBetween": "value1|value2", filter is between value1 and value2 "codeStatus": "value", filter is equal "codeType": "value", filter is equal "codeSource": "value" filter is equal }, "orderBy": "value"

Valeurs possibles pour le tri "orderBy" :

  • requestDateDesc : par date de demande descendant

  • requestDateAsc : par date de demande ascendant

  • requestInterventionDateDesc : par date d'intervention souhaitĂ©e descendant

  • requestInterventionDateAsc : par date d'intervention souhaitĂ©e ascendant

verb: DELETE
Une suppression d'une demande d'intervention (sw_data_interventionrequest) va supprimer en cascade les éléments dans les tables liées sw_data_interventionrequestequipment et sw_data_interventionrequestdocument.