curl --request POST \
--url https://api.avest.fr/v1/external-integration/match/{matchId}/offer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"offerDate": "2023-11-07T05:31:56Z",
"sellPrice": 123,
"agencyCommission": 123,
"feeResponsibility": "<string>",
"financing": "<string>",
"deposit": 123,
"counterOfferAmount": 123,
"content": "<string>",
"owner": "618a35a36d932054e195ca0a"
}
'import requests
url = "https://api.avest.fr/v1/external-integration/match/{matchId}/offer"
payload = {
"offerDate": "2023-11-07T05:31:56Z",
"sellPrice": 123,
"agencyCommission": 123,
"feeResponsibility": "<string>",
"financing": "<string>",
"deposit": 123,
"counterOfferAmount": 123,
"content": "<string>",
"owner": "618a35a36d932054e195ca0a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
offerDate: '2023-11-07T05:31:56Z',
sellPrice: 123,
agencyCommission: 123,
feeResponsibility: '<string>',
financing: '<string>',
deposit: 123,
counterOfferAmount: 123,
content: '<string>',
owner: '618a35a36d932054e195ca0a'
})
};
fetch('https://api.avest.fr/v1/external-integration/match/{matchId}/offer', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.avest.fr/v1/external-integration/match/{matchId}/offer",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'offerDate' => '2023-11-07T05:31:56Z',
'sellPrice' => 123,
'agencyCommission' => 123,
'feeResponsibility' => '<string>',
'financing' => '<string>',
'deposit' => 123,
'counterOfferAmount' => 123,
'content' => '<string>',
'owner' => '618a35a36d932054e195ca0a'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.avest.fr/v1/external-integration/match/{matchId}/offer"
payload := strings.NewReader("{\n \"offerDate\": \"2023-11-07T05:31:56Z\",\n \"sellPrice\": 123,\n \"agencyCommission\": 123,\n \"feeResponsibility\": \"<string>\",\n \"financing\": \"<string>\",\n \"deposit\": 123,\n \"counterOfferAmount\": 123,\n \"content\": \"<string>\",\n \"owner\": \"618a35a36d932054e195ca0a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.avest.fr/v1/external-integration/match/{matchId}/offer")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"offerDate\": \"2023-11-07T05:31:56Z\",\n \"sellPrice\": 123,\n \"agencyCommission\": 123,\n \"feeResponsibility\": \"<string>\",\n \"financing\": \"<string>\",\n \"deposit\": 123,\n \"counterOfferAmount\": 123,\n \"content\": \"<string>\",\n \"owner\": \"618a35a36d932054e195ca0a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.avest.fr/v1/external-integration/match/{matchId}/offer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"offerDate\": \"2023-11-07T05:31:56Z\",\n \"sellPrice\": 123,\n \"agencyCommission\": 123,\n \"feeResponsibility\": \"<string>\",\n \"financing\": \"<string>\",\n \"deposit\": 123,\n \"counterOfferAmount\": 123,\n \"content\": \"<string>\",\n \"owner\": \"618a35a36d932054e195ca0a\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"offer": {
"id": "618a35a36d932054e195ca0a",
"type": "<string>",
"startAt": "2023-11-07T05:31:56Z",
"endAt": "2023-11-07T05:31:56Z",
"deadline": "2023-11-07T05:31:56Z",
"completionDate": "2023-11-07T05:31:56Z",
"pinned": true,
"owner": "618a35a36d932054e195ca0a",
"linkedDocument": "618a35a36d932054e195ca0a",
"linkedModel": "<string>",
"data": {},
"file": {
"name": "<string>",
"mimetype": "<string>",
"size": 123,
"url": "<string>"
},
"driveLinks": [
"<string>"
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}Créer une offre sur une mise en relation
Crée une offre. offerDate est requis, ainsi qu’au moins un de sellPrice / agencyCommission. Effet de bord : le match est promu à MOFF s’il était à une étape antérieure.
Le statut accepted est refusé : il écrit sur la vente et classe sans suite les autres mises en relation du bien.
curl --request POST \
--url https://api.avest.fr/v1/external-integration/match/{matchId}/offer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"offerDate": "2023-11-07T05:31:56Z",
"sellPrice": 123,
"agencyCommission": 123,
"feeResponsibility": "<string>",
"financing": "<string>",
"deposit": 123,
"counterOfferAmount": 123,
"content": "<string>",
"owner": "618a35a36d932054e195ca0a"
}
'import requests
url = "https://api.avest.fr/v1/external-integration/match/{matchId}/offer"
payload = {
"offerDate": "2023-11-07T05:31:56Z",
"sellPrice": 123,
"agencyCommission": 123,
"feeResponsibility": "<string>",
"financing": "<string>",
"deposit": 123,
"counterOfferAmount": 123,
"content": "<string>",
"owner": "618a35a36d932054e195ca0a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
offerDate: '2023-11-07T05:31:56Z',
sellPrice: 123,
agencyCommission: 123,
feeResponsibility: '<string>',
financing: '<string>',
deposit: 123,
counterOfferAmount: 123,
content: '<string>',
owner: '618a35a36d932054e195ca0a'
})
};
fetch('https://api.avest.fr/v1/external-integration/match/{matchId}/offer', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.avest.fr/v1/external-integration/match/{matchId}/offer",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'offerDate' => '2023-11-07T05:31:56Z',
'sellPrice' => 123,
'agencyCommission' => 123,
'feeResponsibility' => '<string>',
'financing' => '<string>',
'deposit' => 123,
'counterOfferAmount' => 123,
'content' => '<string>',
'owner' => '618a35a36d932054e195ca0a'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.avest.fr/v1/external-integration/match/{matchId}/offer"
payload := strings.NewReader("{\n \"offerDate\": \"2023-11-07T05:31:56Z\",\n \"sellPrice\": 123,\n \"agencyCommission\": 123,\n \"feeResponsibility\": \"<string>\",\n \"financing\": \"<string>\",\n \"deposit\": 123,\n \"counterOfferAmount\": 123,\n \"content\": \"<string>\",\n \"owner\": \"618a35a36d932054e195ca0a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.avest.fr/v1/external-integration/match/{matchId}/offer")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"offerDate\": \"2023-11-07T05:31:56Z\",\n \"sellPrice\": 123,\n \"agencyCommission\": 123,\n \"feeResponsibility\": \"<string>\",\n \"financing\": \"<string>\",\n \"deposit\": 123,\n \"counterOfferAmount\": 123,\n \"content\": \"<string>\",\n \"owner\": \"618a35a36d932054e195ca0a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.avest.fr/v1/external-integration/match/{matchId}/offer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"offerDate\": \"2023-11-07T05:31:56Z\",\n \"sellPrice\": 123,\n \"agencyCommission\": 123,\n \"feeResponsibility\": \"<string>\",\n \"financing\": \"<string>\",\n \"deposit\": 123,\n \"counterOfferAmount\": 123,\n \"content\": \"<string>\",\n \"owner\": \"618a35a36d932054e195ca0a\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"offer": {
"id": "618a35a36d932054e195ca0a",
"type": "<string>",
"startAt": "2023-11-07T05:31:56Z",
"endAt": "2023-11-07T05:31:56Z",
"deadline": "2023-11-07T05:31:56Z",
"completionDate": "2023-11-07T05:31:56Z",
"pinned": true,
"owner": "618a35a36d932054e195ca0a",
"linkedDocument": "618a35a36d932054e195ca0a",
"linkedModel": "<string>",
"data": {},
"file": {
"name": "<string>",
"mimetype": "<string>",
"size": 123,
"url": "<string>"
},
"driveLinks": [
"<string>"
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}Autorisations
Token LinkedAPI avec scope externalIntegration. La clé doit avoir un agencyGroup configuré (sinon 400 LinkedAPI agencyGroup is required). Fourni via l'en-tête Authorization: Bearer {linkedAPI_token}. Si la clé a secure === true, l'IP appelante doit être whitelistée (en-tête X-Real-IP), sinon 403 Not authorized to access this resource.
La clé porte aussi un niveau d'accès : en lecture seule, elle n'autorise que les GET ; un POST ou un PATCH renvoie alors 403 Not authorized to access this resource, soit la même réponse qu'une requête sans en-tête Authorization. Voir le guide Authentification.
Paramètres de chemin
Corps
À la création, offerDate est requis ainsi qu'au moins un de sellPrice / agencyCommission. En mise à jour, au moins un champ.