curl PHP JavaScript Python Kopírovat
curl -X POST 'https://foodsoul.ru/api/crm/v2/additional_sales.add?branch_id=1' \
-H 'Authorization: Bearer fs_api_YOUR_TOKEN' \
-H 'language: cs' \
-H 'role: partner' \
-H 'Content-Type: application/json' \
-d '{"link_type":"item","link_id":1,"related_item_ids":[1],"related_item_parameter_ids":[1],"related_category_ids":[1]}' <?php
$client = new \GuzzleHttp\Client ();
$response = $client -> request ( 'POST' , 'https://foodsoul.ru/api/crm/v2/additional_sales.add?branch_id=1' , [
'headers' => [
'Authorization' => 'Bearer fs_api_YOUR_TOKEN' ,
'language' => 'cs' ,
'role' => 'partner' ,
],
'json' => [
'link_type' => 'item' ,
'link_id' => 1 ,
'related_item_ids' => [
1 ,
],
'related_item_parameter_ids' => [
1 ,
],
'related_category_ids' => [
1 ,
],
],
]);
$data = json_decode (( string ) $response -> getBody (), true ); const response = await fetch ( "https://foodsoul.ru/api/crm/v2/additional_sales.add?branch_id=1" , {
method : "POST" ,
headers : {
"Authorization" : "Bearer fs_api_YOUR_TOKEN" ,
"language" : "cs" ,
"role" : "partner" ,
"Content-Type" : "application/json"
},
body : JSON . stringify ({
"link_type" : "item" ,
"link_id" : 1 ,
"related_item_ids" : [
1
],
"related_item_parameter_ids" : [
1
],
"related_category_ids" : [
1
]
}),
})
const data = await response . json () import requests
response = requests . request (
"POST" ,
"https://foodsoul.ru/api/crm/v2/additional_sales.add?branch_id=1" ,
headers ={
"Authorization" : "Bearer fs_api_YOUR_TOKEN" ,
"language" : "cs" ,
"role" : "partner" ,
},
json ={
"link_type" : "item" ,
"link_id" : 1 ,
"related_item_ids" : [
1 ,
],
"related_item_parameter_ids" : [
1 ,
],
"related_category_ids" : [
1 ,
],
},
)
data = response . json () Odpověď 200
{
"status" : "success" ,
"data" : {
"description" : "Successfully added"
}
} Žádosti jsou odesílány na foodsoul.ru — to je hostitel tohoto portálu, jiný vybrat nelze.