I'm new to making API. I want to know, how to call a post API with multiple parameters? I know get API can be called with multiple parameters but is there any way to call a POST API like that? here is my code:
api.php :
if ($action == 'user_assign_machine') {
$id = $PARAMS['id'];
$user_Id = $PARAMS['user_Id'];
$res = HR::userAssignMachine($user_Id,$id);
echo json_encode($res);
code-api.php :
public static function userAssignMachine($userid,$machineid) {
$message_to_admin = "Hi Admin! User $user_Id wants to assign machine $machineid";
return $message_to_admin;
}
Now I want to call this API through a link, i.e. passing all the parameters in the API URL link. plz help me out. thanks