My customer sent a url like this;
https://accounts.zoho.com/oauth/v2/token?refresh_token={refreshToken}&client_id={client_id}&client_secret={client_secret}&grant_type=refresh_token_adhesive
I want to write a insert code according to this. My code is below but I'm not sure this code is true. I didn't find any document about send to data from access token request.
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://accounts.zoho.com/oauth/v2/token?refresh_token={refreshToken}&client_id={client_id}&client_secret={client_secret}&grant_type=refresh_token"); request.Method = "POST"; JObject requestBody = new JObject(); JArray recordArray = new JArray(); JObject recordObject = new JObject(); recordObject.Add("First_Name", contactData.FirstName); recordObject.Add("Mobile", contactData.PhoneNumber); recordObject.Add("Email", contactData.Email); recordObject.Add("Kategori", contactData.MessageType); recordObject.Add("Konu", contactData.Subject); recordObject.Add("Last_Name", contactData.LastName); recordObject.Add("Company", contactData.CompanyName); recordObject.Add("Sirketiniz_ile_ilgili_ozet", contactData.CompanySummary); recordArray.Add(recordObject); requestBody.Add("data", recordArray); string dataString = requestBody.ToString(); var data = Encoding.UTF8.GetBytes(dataString); int dataLength = data.Length; request.ContentLength = dataLength; using (var writer = request.GetRequestStream()) { writer.Write(data, 0, dataLength); } request.KeepAlive = true; HttpWebResponse response; try { response = (HttpWebResponse)request.GetResponse(); } catch (WebException e) { if (e.Response == null) { throw; } response = (HttpWebResponse)e.Response; } HttpWebResponse responseEntity = response; Console.WriteLine("HTTP Status Code : " + (int)response.StatusCode); string responsestring = new StreamReader(responseEntity.GetResponseStream()).ReadToEnd(); responseEntity.Close(); Console.WriteLine(responsestring);