· 6 years ago · Oct 09, 2019, 02:08 PM
1<?php
2error_reporting(1);
3$data = array(
4'api_key' => "8PpUMSHSMiyAoZpTOTAVRz5bZ0TMAnho", //API Key
5'action' => "pemesanan",
6'layanan'=>"TSP1", //Service code, lihat di list produk
7'target'=>081322207701// Nomor tujuan pengisian
8);
9$curl = curl_init();
10
11curl_setopt_array($curl, array(
12 CURLOPT_URL => "https://atlantich2h.com/pulsa",
13 CURLOPT_RETURNTRANSFER => true,
14 CURLOPT_ENCODING => "",
15 CURLOPT_MAXREDIRS => 10,
16 CURLOPT_TIMEOUT => 600,
17 CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
18 CURLOPT_CUSTOMREQUEST => "POST",
19 CURLOPT_POSTFIELDS => http_build_query($data),
20 CURLOPT_HTTPHEADER => array(
21 "Accept: */*",
22 "Accept-Encoding: gzip, deflate",
23 "Cache-Control: no-cache",
24 "Connection: keep-alive",
25 "Content-Length: 536",
26 "Content-Type: multipart/form-data; boundary=--------------------------547457936070693055102751",
27 "Host: atlantich2h.com",
28 "Postman-Token: 43b8037d-c5a6-469e-923f-3637b7763335,e87149ac-4216-4d83-94a7-424fcf5c9533",
29 "User-Agent: PostmanRuntime/7.17.1",
30 "cache-control: no-cache",
31 "content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW"
32 ),
33));
34
35$response = curl_exec($curl);
36$err = curl_error($curl);
37
38curl_close($curl);
39
40if ($err) {
41 echo "cURL Error #:" . $err;
42} else {
43 echo $response;
44}