Hello,
what is the web service that is going to assign a Parent user to his child,
i used this one
$functionname = 'core_role_assign_roles';
header('Content-type: text/plain; charset=utf-8');
$restformat = '&moodlewsrestformat=json' ;
$serverurl = domainname . '/webservice/rest/server.php'. '?wstoken=' .
token . '&wsfunction='.$functionname;
$serverurl = $serverurl . $restformat;
$http = new Client();
$assignments = array('roleid'=>9, 'userid'=>$student_id, 'contextid'=> $guardian_id);
$assignmentsArray = array(0 => $assignments);
$resp = $http->post($serverurl ,['assignments' => $assignmentsArray]);
$resp = $resp->json;
but this does not help, am i missing something?