Esempio n. 1
0
        public async Task <string> List(Dictionary <string, string> parameters = null)
        {
            string uri         = "tickets";
            string paramString = "";

            if (parameters != null && parameters.Count > 0)
            {
                foreach (var keyValuePair in parameters)
                {
                    if (paramString.Length == 0)
                    {
                        paramString += "?";
                    }
                    else
                    {
                        paramString += "&";
                    }

                    paramString += string.Format("{0}={1}", keyValuePair.Key, HttpUtility.UrlEncode(keyValuePair.Value));
                }
            }
            if (paramString.Length > 0)
            {
                uri += paramString;
            }

            return(await Api.Get(uri));
        }
Esempio n. 2
0
        public async Task <string> List(string groupID = "")
        {
            string uri = "greetings";

            if (groupID.Length > 0)
            {
                uri += string.Format("?group={0}", HttpUtility.UrlEncode(groupID));
            }

            return(await Api.Get(uri));
        }
Esempio n. 3
0
        public async Task <string> List(string status = "")
        {
            string uri = "agents";

            if (status.Length > 0)
            {
                uri += string.Format("?status={0}", HttpUtility.UrlEncode(status));
            }

            return(await Api.Get(uri));
        }
Esempio n. 4
0
        public async Task <string> GetPendingMessages(string visitorID, string licenseID, string sessionID, string lastMessageID = "")
        {
            string uri = string.Format("visitors/{0}/chat/get_pending_messages?licence_id={1}&secured_session_id={2}", HttpUtility.UrlEncode(visitorID), HttpUtility.UrlEncode(licenseID), HttpUtility.UrlEncode(sessionID));

            if (lastMessageID.Length > 0)
            {
                uri += string.Format("&last_message_id={0}", lastMessageID);
            }

            return(await Api.Get(uri));
        }
Esempio n. 5
0
        public async Task <string> Get(Dictionary <string, string> parameters)
        {
            string uri = "";

            if (parameters != null && parameters.Count > 0)
            {
                foreach (var keyValuePair in parameters)
                {
                    if (uri.Length == 0)
                    {
                        uri = "chats?";
                    }
                    else
                    {
                        uri += "&";
                    }
                    uri += string.Format("{0}={1}", keyValuePair.Key, HttpUtility.UrlEncode(keyValuePair.Value));
                }
            }

            return(await Api.Get(uri));
        }
Esempio n. 6
0
        public async Task <string> List()
        {
            string uri = "goals";

            return(await Api.Get(uri));
        }