PHP code example of adereksisusanto / dapodik-api-php

1. Go to this page and download the library: Download adereksisusanto/dapodik-api-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

adereksisusanto / dapodik-api-php example snippets


// default host & port
$dapodik = new Adereksisusanto\DapodikAPI();

// custom host & port
$dapodik = new Adereksisusanto\DapodikAPI('custom_host','custom_port');

$auth = $dapodik->login('username', 'password', 'kode_registrasi');
$sekolah = $auth->sekolah();
var_dump($sekolah);

$api = $dapodik->api('token', 'npsn');
$sekolah = $api->sekolah();
var_dump($sekolah);
bash
composer