<%@ language = "JavaScript" %>
<%
/*
    $Revision$
    $Id$

    File:               res_ruimte_extern_sync.asp
    Description:        Synchroniseren van reserveerbare ruimtes via MSGraph naar Outlook
    Parameters:         res_ruimte_key

    Context:
    Note:
Sample:             appl/mgt/res_ruimte_extern_sync.asp?res_ruimte_key=1

*/
Server.ScriptTimeout = 1200; // ~1s per reservering
var JSON_Result = true;
%>
<!-- #include file="../Shared/common.inc"-->
<%

user.auth_required_or_abort(user.has("WEB_RESMSU"));

var res_ruimte_key = getQParamInt("res_ruimte_key");

// Initialize hook
var hook = hookfunc.gethook("utils/exchange/res_to_graph.wsc");
var DEZE = this;
hook.initialize({
    DEZE: DEZE,
    custabspath: Server.MapPath(custpath)
});
var result = hook.batchToGraph("C", { "res_ruimte_key": res_ruimte_key });
hook = null;

Response.Write(JSON.stringify(result));
ASPPAGE_END();
%>