API per partner › Impostazioni Abilitare o disabilitare i webhook della filiale POST /api/crm/v2/webhooks_subscriptions.update_settingsv2
operationId: webhooksSubscriptions.updateSettings
Abilita o disabilita i webhook della filiale. Alla prima attivazione viene creato un segreto di firma, quindi la risposta restituisce le impostazioni della filiale.
Autorizzazione api-token + language + role
Parametri della richiesta branch_id integer obbligatorio
Esempio: 8412
Corpo della richiesta application/json object
enabled boolean obbligatorio
Disattiva immediatamente tutte le sottoscrizioni della filiale
Esempio: true
Risposte 200
object
status string obbligatorio
Valori: successerror
Esempio: success
data object
settings object (WebhooksBranchSettings)
secret string può essere nullo
null, finché la rete non ha creato il segreto
Esempio: 9f2c…
enabled boolean obbligatorio
Esempio: true
curl PHP JavaScript Python Copiare
curl -X POST 'https://foodsoul.pro/api/crm/v2/webhooks_subscriptions.update_settings?branch_id=8412' \
-H 'Authorization: Bearer fs_api_YOUR_TOKEN' \
-H 'language: it' \
-H 'role: partner' \
-H 'Content-Type: application/json' \
-d '{"enabled":true}' <?php
$client = new \GuzzleHttp\Client ();
$response = $client -> request ( 'POST' , 'https://foodsoul.pro/api/crm/v2/webhooks_subscriptions.update_settings?branch_id=8412' , [
'headers' => [
'Authorization' => 'Bearer fs_api_YOUR_TOKEN' ,
'language' => 'it' ,
'role' => 'partner' ,
],
'json' => [
'enabled' => true ,
],
]);
$data = json_decode (( string ) $response -> getBody (), true ); const response = await fetch ( "https://foodsoul.pro/api/crm/v2/webhooks_subscriptions.update_settings?branch_id=8412" , {
method : "POST" ,
headers : {
"Authorization" : "Bearer fs_api_YOUR_TOKEN" ,
"language" : "it" ,
"role" : "partner" ,
"Content-Type" : "application/json"
},
body : JSON . stringify ({
"enabled" : true
}),
})
const data = await response . json () import requests
response = requests . request (
"POST" ,
"https://foodsoul.pro/api/crm/v2/webhooks_subscriptions.update_settings?branch_id=8412" ,
headers ={
"Authorization" : "Bearer fs_api_YOUR_TOKEN" ,
"language" : "it" ,
"role" : "partner" ,
},
json ={
"enabled" : True ,
},
)
data = response . json () Risposta 200
{
"status" : "success" ,
"data" : {
"settings" : {
"secret" : "9f2c…" ,
"enabled" : true
}
}
} Le richieste vengono inviate a foodsoul.pro, che è l’host di questo portale; non è possibile sceglierne un altro.