コード例 #1
0
        public string DeleteContact(string id, string token)
        {
            SageOneWebRequest webRequest = new SageOneWebRequest();

            Uri specificContactUri = new Uri(contactUri.AbsoluteUri + "/" + id);

            return(webRequest.DeleteData(specificContactUri, token, oauth.SigningSecret));
        }
コード例 #2
0
        public ContactGetHeader GetContacts(string token)
        {
            SageOneWebRequest webRequest = new SageOneWebRequest();

            string JSON = webRequest.GetData(contactUri, token, oauth.SigningSecret);

            ContactGetHeader contact = JsonConvert.DeserializeObject<ContactGetHeader>(JSON);

            return contact;
        }
コード例 #3
0
        public ContactGetHeader GetContacts(string token)
        {
            SageOneWebRequest webRequest = new SageOneWebRequest();

            string JSON = webRequest.GetData(contactUri, token, oauth.SigningSecret);

            ContactGetHeader contact = JsonConvert.DeserializeObject <ContactGetHeader>(JSON);

            return(contact);
        }
コード例 #4
0
        public ContactToGet GetContact(string id, string token)
        {
            SageOneWebRequest webRequest = new SageOneWebRequest();

            Uri specificContactUri = new Uri(contactUri.AbsoluteUri + "/" + id);

            string JSON = webRequest.GetData(specificContactUri, token, oauth.SigningSecret);

            ContactToGet contact = JsonConvert.DeserializeObject<ContactToGet>(JSON);

            return contact;
        }
コード例 #5
0
        public ContactToGet GetContact(string id, string token)
        {
            SageOneWebRequest webRequest = new SageOneWebRequest();

            Uri specificContactUri = new Uri(contactUri.AbsoluteUri + "/" + id);

            string JSON = webRequest.GetData(specificContactUri, token, oauth.SigningSecret);

            ContactToGet contact = JsonConvert.DeserializeObject <ContactToGet>(JSON);

            return(contact);
        }
コード例 #6
0
        public ContactGetHeader GetContactItemsPerPage(string token, string page)
        {
            SageOneWebRequest webRequest = new SageOneWebRequest();

            UriBuilder uriWithParameters = new UriBuilder(contactUri.AbsoluteUri);

            uriWithParameters.Query = "$itemsPerPage=" + page;

            string JSON = webRequest.GetData(uriWithParameters.Uri, token, oauth.SigningSecret);

            ContactGetHeader contact = JsonConvert.DeserializeObject<ContactGetHeader>(JSON);

            return contact;
        }
コード例 #7
0
        public ContactGetHeader GetContactItemsPerPage(string token, string page)
        {
            SageOneWebRequest webRequest = new SageOneWebRequest();

            UriBuilder uriWithParameters = new UriBuilder(contactUri.AbsoluteUri);

            uriWithParameters.Query = "$itemsPerPage=" + page;

            string JSON = webRequest.GetData(uriWithParameters.Uri, token, oauth.SigningSecret);

            ContactGetHeader contact = JsonConvert.DeserializeObject <ContactGetHeader>(JSON);

            return(contact);
        }
コード例 #8
0
        public string CreateContact(string name, string companyName, string email, string telephone, int contactTypeID, string token)
        {

            SageOneWebRequest webRequest = new SageOneWebRequest();

            List<KeyValuePair<string, string>> postData = new List<KeyValuePair<string, string>> {
              new KeyValuePair<string,string>("contact[name]", name),
              new KeyValuePair<string,string>("contact[email]",email),
              new KeyValuePair<string,string>("contact[contact_type_id]",contactTypeID.ToString()),
              new KeyValuePair<string,string>("contact[telephone]",telephone),
              new KeyValuePair<string,string>("contact[company_name]",companyName) };

            string _return = webRequest.PostData(contactUri, postData, token, oauth.SigningSecret);


            return _return;
        }
コード例 #9
0
        public string CreateContact(string name, string companyName, string email, string telephone, int contactTypeID, string token)
        {
            SageOneWebRequest webRequest = new SageOneWebRequest();

            List <KeyValuePair <string, string> > postData = new List <KeyValuePair <string, string> > {
                new KeyValuePair <string, string>("contact[name]", name),
                new KeyValuePair <string, string>("contact[email]", email),
                new KeyValuePair <string, string>("contact[contact_type_id]", contactTypeID.ToString()),
                new KeyValuePair <string, string>("contact[telephone]", telephone),
                new KeyValuePair <string, string>("contact[company_name]", companyName)
            };

            string _return = webRequest.PostData(contactUri, postData, token, oauth.SigningSecret);


            return(_return);
        }
コード例 #10
0
        public string DeleteContact(string id, string token)
        {
            SageOneWebRequest webRequest = new SageOneWebRequest();

            Uri specificContactUri = new Uri(contactUri.AbsoluteUri + "/" + id);

            return webRequest.DeleteData(specificContactUri, token, oauth.SigningSecret);
        }