SHOW:
|
|
- or go back to the newest paste.
1 | <?php | |
2 | ||
3 | //print_r($_POST); | |
4 | ||
5 | $curl = curl_init(); | |
6 | ||
7 | curl_setopt_array($curl, [ | |
8 | CURLOPT_URL => "https://api.sendinblue.com/v3/contacts", | |
9 | CURLOPT_RETURNTRANSFER => true, | |
10 | CURLOPT_ENCODING => "", | |
11 | CURLOPT_MAXREDIRS => 10, | |
12 | CURLOPT_TIMEOUT => 30, | |
13 | CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, | |
14 | CURLOPT_CUSTOMREQUEST => "POST", | |
15 | CURLOPT_POSTFIELDS => "{ | |
16 | \"attributes\":{ | |
17 | \"LASTNAME\":\"".$_POST['lastname']."\", | |
18 | \"FIRSTNAME\":\"".$_POST['first_last_name']."\", | |
19 | \"PHONE\":\"".preg_replace("/(\+372|372)?(.*)/i", "$2", $_POST['phone'])."\", | |
20 | \"SUMMA\":\"".$_POST['summa']."\", | |
21 | \"PERIOOD\":\"".$_POST['periood']."\", | |
22 | \"MAKSEHAIRED\":\"".$_POST['maksehaired']."\", | |
23 | \"TAGATISETA\":\"".$_POST['tagatiseta']."\", | |
24 | \"SISETULEK\":\"".$_POST['sisetulek']."\", | |
25 | \"PALK\":\"".$_POST['palk']."\", | |
26 | \"KODAKONDSUS\":\"".$_POST['kodakondsus']."\", | |
27 | \"ISIKUKOOD\":\"".$_POST['isikukood']."\", | |
28 | \"STAATUS\":\"".$_POST['staatus']."\", | |
29 | \"KUIDAS\":\"".$_POST['kuidas']."\", | |
30 | \"VANUS\":\"".$_POST['vanus']."\", | |
31 | - | \"SOURCE\":\"krediidikassa.ee\", |
31 | + | |
32 | \"SEARCH_TERM\":\"".$_POST['search_term']."\", | |
33 | \"POHJUS\":\"".$_POST['pohjus']."\", | |
34 | \"TYPE\":\"".$_POST['type']."\", | |
35 | \"ISIKUANDMED\":\"1\", | |
36 | \"CID\":\"".$_POST['cid']."\" | |
37 | }, | |
38 | \"listIds\":[18], | |
39 | \"updateEnabled\":false, | |
40 | \"email\":\"".$_POST['email']."\" | |
41 | }", | |
42 | CURLOPT_HTTPHEADER => [ | |
43 | "Accept: application/json", | |
44 | "Content-Type: application/json", | |
45 | "api-key: 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" | |
46 | ], | |
47 | ]); | |
48 | ||
49 | $response = curl_exec($curl); | |
50 | $err = curl_error($curl); | |
51 | ||
52 | curl_close($curl); | |
53 | ||
54 | if ($err) { | |
55 | echo "cURL Error #:" . $err; | |
56 | } else { | |
57 | echo $response; | |
58 | } | |
59 | ?> |