<?php
require '../vendor/autoload.php';
// define CI environment for config
require '../app/Config/Constants.php';
require '../app/Config/Paths.php';
require '../system/bootstrap.php';

$client = \Config\Services::curlrequest();
$pddiktiUrl = 'http://103.167.112.188:8100/ws/live2.php';

$response = $client->post($pddiktiUrl, [
    'json' => ['act' => 'GetToken', 'username' => '083043', 'password' => 'itka123#'],
    'verify' => false
]);
$token = json_decode($response->getBody(), true)['data']['token'];

$res = $client->post($pddiktiUrl, [
    'json' => ['act' => 'GetListPenugasanSemuaDosen', 'token' => $token, 'limit' => 1],
    'verify' => false
]);
$data = json_decode($res->getBody(), true)['data'][0];
var_dump($data);
