Client List in FreshBooks API

28 views
Skip to first unread message

sarala k

unread,
Jul 24, 2018, 8:23:59 AM7/24/18
to FreshBooks API (not monitored)
Hi Team,

I am using FreshBooks API and trying to get all clients list, but getting only few records in response even though there are several records.
Please help why it is not returning all.

below is my Code 

           
                String data = "<request method=\"client.list\"></request>";
                WebRequest myReq = WebRequest.Create(url);              
                myReq.Method = "POST";
                myReq.ContentLength = data.Length;
                myReq.ContentType = "application/xml; charset=UTF-8";

                string usernamePassword = "ec220f3d3599d3f4e79ea8ef545faa31" + ":" + "x";
                UTF8Encoding enc = new UTF8Encoding();
                myReq.Headers.Add("Authorization", "Basic " + Convert.ToBase64String(enc.GetBytes(usernamePassword)));
                using (Stream ds = myReq.GetRequestStream())
                {
                    ds.Write(enc.GetBytes(data), 0, data.Length);
                }

                var wr = (HttpWebResponse)myReq.GetResponse();
                var receiveStream = wr.GetResponseStream();
                StreamReader reader = new StreamReader(receiveStream, Encoding.Default);
                string content = reader.ReadToEnd();
                reader.Close();
Reply all
Reply to author
Forward
0 new messages