php url https api ruads org v1 estimate submit data criteria type Pric

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
$url = 'https://api.ruads.org/v1/estimate/submit';
$data = '
{
"criteria": [
{
"type": ".PriceCriterion",
"filters": [
{
"type": ".RangeFilter",
"name": "range",
"min": 8,
"max": 8
}
]
}
]
}
';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Authorization: RUADS_API_KEY ...............'
));
$data_html = curl_exec($ch);
curl_close($ch);
echo json_decode($data_html);
?>