我正在使用 apache api 公开会议。它一直在登录,但是当我尝试添加新用户时,我收到 HTTP 响应错误 500(权限不足)。
我试过这个,但它不起作用:
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
function create_user() {
$.ajax({
method: "POST",
url: "http://localhost:5080/openmeetings/services/user",
data: {sid : "2575fb6f-c030-4ef4-b9c5-0c6bcb9b18f3",
userDTO:JSON.stringify( { address :{
additionalname:"mr"
,comment:"k"
,country:"sy"
,deleted:false
,email:"ssss@hotmail.com"
,fax:"111"
,id:222
,inserted:"2014-02-14T08:00Z"
,phone:"1111"
,street:"sss"
,town:"sss"
,updated:"2014-02-14T08:00Z"
,zip:"qq"
}
,externalId:"1"
,externalType:"myCMS"
,firstname:"asasas"
,id:1
,languageId:55
,lastname:"zxczxc"
,login:"asasas"
,password:"asasas"
,rights:null
,timeZoneId:"sa"
,type:{type:"user"}
}),
confirm: false },
dataType: "json",
success: function(data){
$("#res").html(data["id"]);
}
});
}
$(document).ready(function(){
$("button").click(function(){
create_user();
});
});
</script>
</head>
<body>
<button>Get JSON data</button>
<div id="res"></div>
</body>
</html>