Hi, I am new to Zoho Creator.
I am trying to add a new record via http post method as given below.
The problem is that in respose I get a login page html.
- protected void btnSubmit_OnClick(object sender, EventArgs e)
- {
- var response = Http.Post("https://creator.zoho.com/<USERNAME>/<APPLICATION_NAME>/form-perma/NEWCONTACT/record/add/", new NameValueCollection() {
- { "authtoken", "<KEY>" },
- { "scope", "creatorapi" },
- { "First_Name", "John" },
- { "Last_Name", "Doe" },
- { "Email", "someone22@gmail.com" },
- { "Company_Name", "Orca Studios" },
- { "Company_Phone", "9949499666" },
- { "Job_Title", "Dev" },
- { "Company_Country", "Australia" },
- { "Catalog_Size", "less than 50 titles" },
- { "Catalog_Genre_s", "ALL" },
- { "Company_Type", "Archive" },
- { "Lead_Source", "Website" },
- });
- string result = System.Text.Encoding.UTF8.GetString(response);
-
- }
- public static class Http
- {
- public static byte[] Post(string uri, NameValueCollection pairs)
- {
- byte[] response = null;
- using (WebClient client = new WebClient())
- {
- response = client.UploadValues(uri, pairs);
- }
- return response;
- }
- }
I am using asp.net with c#.
Please tell me what I am doing wrong.
Warm Regards