nhance/app/Controllers/ICICILombardController.php

36 lines
912 B
PHP

<?php
namespace App\Controllers;
use CodeIgniter\Controller;
class ICICILombardController extends AdminController
{
public function generateAuthToken($scope)
{
helper('api');
$url = 'https://ilesbapigee.insurancearticlez.com/generate-jwt-token';
$method = 'POST';
$headers = [
'Content-Type: application/x-www-form-urlencoded'
];
$body = [
'grant_type' => 'password',
'username' => 'Nhanceins',
'password' => 'SSWW7bFNaLxxQyw',
'scope' => $scope,
'client_id' => 'Nhanceins',
'client_secret' => 'P4W0G6TAYMa0MV8bbVSx4pTAqbCcUIg48kCWa6PJykAhGWzPmpPr0iLuNWtz5wqN'
];
$response = call_third_party_api($url, $method, $headers, $body);
if($response['status'] != false){
}
return $this->response->setJSON($response);
}
}