Initial import
This commit is contained in:
24
application/controllers/jurnal/Apitest.php
Normal file
24
application/controllers/jurnal/Apitest.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class ApiTest extends CI_Controller {
|
||||
|
||||
public function index() {
|
||||
// Load the JurnalApi library with parameters
|
||||
$this->load->library('JurnalApi', [
|
||||
'username' => 'BQp5iG3LFuka65JF', // Replace with your HMAC username
|
||||
'secret' => 'OXCGaRQsVLaAmGU003BFSkPCbkVVVxtU', // Replace with your HMAC secret
|
||||
'environment' => 'sandbox' // Use 'production' for live API
|
||||
]);
|
||||
|
||||
// Define the request method and endpoint
|
||||
$requestMethod = 'GET';
|
||||
$requestPath = '/public/jurnal/api/v1/sales_invoices';
|
||||
|
||||
// Make the API request and capture the response
|
||||
$response = $this->jurnalapi->request($requestMethod, $requestPath);
|
||||
|
||||
// Display the response
|
||||
echo json_encode($response);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user