0
J'utilise apache api open meetings. Cela a fonctionné dans la connexion, mais quand j'essaye d'ajouter un nouvel utilisateur, j'obtiens HTTP Response Error 500 (autorisations insuffisantes).Création d'un nouvel utilisateur dans apache openmeetings API via Ajax
J'ai essayé, mais ça ne marche pas:
<!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:"[email protected]"
,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>
C'est la bonne réponse. 'sid' est le paramètre de requête –