Beispiel #1
0
        public void UpdatePost(string session_token, String post_id, List <string> attachments_arr, DateTime lastUpdateTime, List <string> recipientEmailList, string title, string sender)
        {
            string result = null;

            // verify
            if (session_token == "" || post_id == null || attachments_arr == null)
            {
                throw new ArgumentNullException();
            }
            //--
            APIKEY = "a23f9491-ba70-5075-b625-b8fb5d9ecd90";
            //
            newPostClass _ws = new newPostClass();

            _ws.group_id      = group_id;
            _ws.session_token = session_token;
            _ws.APIKEY        = APIKEY;
            //string object_id = _ws._object_id;
            string content               = "";
            string attachment_id_array   = joinToJsonList(attachments_arr);
            string recipient_email_array = joinToJsonList(recipientEmailList);
            string preview               = "";
            string type        = "event";
            string coverAttach = "";
            string event_type  = "favorite_shared";
            string favorite    = "0";

            _ws.posts_update(session_token, group_id, post_id, attachment_id_array, type, event_type, favorite, lastUpdateTime, recipient_email_array, title, sender);
        }
Beispiel #2
0
        public string callLogin(string user, string password)
        {
            string result = "";

            if (user == "" || password == "")
            {
                return(null);
            }
            newPostClass _ws = new newPostClass();

            _ws.APIKEY = "a23f9491-ba70-5075-b625-b8fb5d9ecd90";

            result        = _ws.auth_login(user, password);
            group_id      = _ws.group_id;
            session_token = _ws.session_token;
            result        = session_token;
            return(result);
        }
Beispiel #3
0
        public string NewPost(string session_token, List <string> object_arr, List <string> email_arr, string post_id, string title)
        {
            string result = null;

            // verify
            if (session_token == "" || object_arr == null || email_arr == null)
            {
                result = null;
                // log for parmeters error
            }
            //--
            APIKEY = "a23f9491-ba70-5075-b625-b8fb5d9ecd90";
            //
            newPostClass _ws = new newPostClass();

            _ws.group_id      = group_id;
            _ws.session_token = session_token;
            _ws.APIKEY        = APIKEY;
            string object_id           = _ws._object_id;
            string content             = "";
            string attachment_id_array = toJsonArray(object_arr);
            string preview             = "";
            string type             = "event";
            string share_email_list = toJsonArray(email_arr);
            string coverAttach      = "";
            string event_type       = "favorite_shared";
            string favorite         = "0";

            string ret_post = _ws.posts_new(session_token, group_id, content, attachment_id_array, preview, type, coverAttach, share_email_list, event_type, favorite, post_id, title);

            if (ret_post == null)
            {
                throw new Exception("new post failed");
            }

            var retObj = JsonConvert.DeserializeObject <dynamic>(ret_post);

            return(retObj.post.shared_code.ToString());
        }