コード例 #1
0
        public HttpResponseMessage GetModulesDetails()
        {
            var sessionId = "0";

            try
            {
                sessionId = SuiteWrapper.Login().GetAwaiter().GetResult();
            }
            catch (Exception ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.Unauthorized, ex.Message.ToString()));
            }
            try
            {
                var req = new SuiteAPI.ReadEntryListRequest();
                req.SessionId  = sessionId;
                req.ModuleName = "Contacts";
                req.MethodName = "get_module_fields";
                var list = SuiteWrapper.GetModuleList <CMSModels.ModuleDetails>(req).GetAwaiter().GetResult();
                return(Request.CreateResponse(HttpStatusCode.OK, list));
            }
            catch (Exception ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message.ToString()));
            }
        }