0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 3.144.98.61


Current Path : /proc/thread-self/root/var/www/html/sjbitapi/src/
Upload File :
Current File : //proc/thread-self/root/var/www/html/sjbitapi/src/apitest.php

<?php

function apitest($aobj_context)
{ 
	include("genToken.php");	
	include("const.php");
	$tokenArry = getToken(client_id,client_secret,username,password,grant_type);
	$tokendet = json_decode($tokenArry,true);
	$token = $tokendet['access_token'];
	$iurl  = $tokendet['instance_url'];
	$username = username;
	$password = password;
	$hbody = 'Basic '.base64_encode((username.':'.password));
	

	$headers = array
		(
			"Authorization:Bearer $token",
			"Content-Type: application/json"
		);
			
			

	$studData = array(
		array(
		"regno"=>"A181002", 
		"sem"=>"1", 
		"ExaminationMonthYear"=>"Dec 2021/ Jan 2022", 
		"subcode"=>"A0011", 
		"subname"=>"subject name", 
		"securedIAMarks"=>"20", 
		"securedExternalMarks"=>"60", 
		"credits"=>"1.4",
		"gradepoint"=>"11", 
		"creditpoint"=>"1", 
		"cgpa"=>"7.7", 
		"sgpa"=>"9.1", 
		"grade"=>"A", 
		"Result"=>"Pass", 
		"remarks"=>"Note: REVA University is not responsible for any inadvertent error that may have crept in the results being published on NET. The results published on net are for immediate information to the examinees. These cannot be treated as original mark sheets."
		)
	);

			
	$req['MarksDetails'] = $studData; 

	$url = $iurl."/services/apexrest/studentresults";

	$ch = curl_init();
	curl_setopt( $ch,CURLOPT_URL, $url);            
	curl_setopt( $ch,CURLOPT_POST, true );
	curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers );
	curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true );
	curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, false );
	curl_setopt( $ch,CURLOPT_POSTFIELDS, json_encode( $req ) );
	$result2 = curl_exec($ch);
	var_dump($result2);
	die();
	curl_close( $ch );

}

?>