Zoho creator: How to add a record from a vb.net forms application

Zoho creator: How to add a record from a vb.net forms application

Hello,
I am struggling for one day and I hope someone can help me. I try to add a record from a windows forms application using vb.net. This is my code:

  1. Public Sub addRecord(ByVal ht As Hashtable)

  2.         Dim apiUrl As String = "https://creator.zoho.com/api/<xxx>/xml/<appname>/form/<form name>/record/add/"
  3.         Dim xmlStr As New System.Text.StringBuilder
  4.         xmlStr.Append("<input type=""hidden"" name =""authtoken"" value=""abcdefghijk"">")
  5.         xmlStr.Append("<input type=""hidden"" name =""scope"" id=""scope"" value=""creatorapi"">")
  6.         Dim enu As IDictionaryEnumerator = ht.GetEnumerator
  7.         While (enu.MoveNext)
  8.             xmlStr.AppendLine("<input type=""text"" name=""" + enu.Key + """ value=""" + enu.Value + """>")
  9.         End While
  10.         Dim params As String = "XMLString=" + xmlStr.ToString
  11.         Dim res As String = getResponseFromUrl(apiUrl, params)
  12.         MsgBox(res)
  13. End Sub
  14. Public Function getResponseFromUrl(ByVal url As String, ByVal params As String)
  15.         Dim str As String = ""
  16.         Try
  17.             Dim webreq As HttpWebRequest = WebRequest.Create(url)
  18.             webreq.Method = "POST"
  19.             webreq.ContentType = "application/x-www-form-urlencoded"
  20.             Dim byteArray As Byte() = System.Text.Encoding.UTF8.GetBytes(params)
  21.             Dim dataStream As Stream = webreq.GetRequestStream()
  22.             dataStream.Write(byteArray, 0, byteArray.Length)
  23.             dataStream.Close()

  24.             Dim res As WebResponse = webreq.GetResponse()
  25.             Dim stream As Stream = res.GetResponseStream()
  26.             Dim streamReader As New StreamReader(stream)
  27.             str = streamReader.ReadToEnd
  28.         Catch ex As Exception
  29.             MsgBox(ex.ToString)
  30.         End Try
  31.         Return str.ToString
  32. End Function
But I always get the error:
<response><errorlist><error><code>2899</code><message><![CDATA[Permission Denied To Add Record(s).]]></message></error></errorlist></response>

Any idea?

Thank you and kind regards,
Marco