· 4 years ago · Mar 30, 2021, 04:34 PM
1<?php
2		$curl = curl_init();
3        curl_setopt_array($curl, [
4          CURLOPT_URL => "https://bridge-api.leadformance.com/locations/search",
5          CURLOPT_RETURNTRANSFER => true,
6          CURLOPT_ENCODING => "",
7          CURLOPT_MAXREDIRS => 10,
8          CURLOPT_TIMEOUT => 30,
9          CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
10          CURLOPT_CUSTOMREQUEST => 'POST',
11          CURLOPT_POSTFIELDS => '{"filters": {"externalAttributes": {"locationId" : "'. /*CODE ICX*/ . '"}}}',
12          CURLOPT_HTTPHEADER => [
13            'accept: application/vnd.bridge+json; version=1',
14            'cache-control: no-cache',
15            'content-type: application/json',
16            'x-api-key: /*API KEY */',
17            'x-bridge-locale: fr'
18          ],
19        ]);
20
21        $response = curl_exec($curl);
22        $httpcode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
23        $err = curl_error($curl);
24        curl_close($curl);
25?>