Introduction
Les webhooks Métier permettent de manipuler une entité (client, contact, ...) à partir de l'extérieur via un appel de type http.
Les webhooks Métier implémentent une structure commune de leur contrat JSON.
Entête
Structure
Le JSON lors de l'appel au webHook devra contenir les éléments suivants :
...
Bloc de code |
---|
|
"verb": DEFINITION
"parameters":
{
"baseculture_id": "value" // (optional) Culture to use to return labels. If not given, the LanguageCode of the header will be used by default.
} |
Réponse
Structure
Bloc de code |
---|
|
{
"label": "Webhook xxx", //name of the called webhook
"codeScript": "Webhookxxx", //script called by the webhook
"resultType": "JSON",
"result":
{
"common":
{
"resultCode": "0", // 0 if ok otherwise specific error of the webhook
"errorMessage": "" // if resultCode <> 0, text of the error in english
},
"response":
{
// depends of the webhook
}
},
"statistics":
{
"durationMs": xx, // duration of execution time
"consumedTimeOnDatabaseMs": xx, // DB time used
"selectQueryCount": xx, // number of select query done
"insertQueryCount": xx, // number of insert query done
"updateQueryCount": xx, // number of update query done
"deleteQueryCount": xx, // number of delete query done
"readTokenCount": xx,
"executedFunctionCount": xx, // number of function called
"translatorHitCount": xx, // number of translations done
"languageHitCount": xx
}
} |
...