<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://tester.eye.my.id/ws/live2.php');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$payload = json_encode(['act' => 'GetToken', 'username' => 'pddikti.itka@gmail.com', 'password' => '123456789']);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
$res = json_decode(curl_exec($ch), true);
$token = $res['data']['token'];
$payload2 = json_encode(['act' => 'GetListPenugasanDosen', 'token' => $token, 'limit' => 2]);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload2);
echo substr(curl_exec($ch), 0, 1000);
?>
