I am getting very frustrated. I am using .NET to import a bunch of leads in to vTiger 6.2.0. I am using a simple web request that i have seen plenty of examples working. I have also seen it working from my dev environment and i would intermittently get the above response from the service. I have moved over to using live data (still from my machine). There is no reason for the imports to fail as they all contain a last name.
I have scoured the internet for any relevant information and have come up blank.
I am using a post request in the following way...
byte[] bytes = Encoding.ASCII.GetBytes(requestParameters);
WebRequest request = HttpWebRequest.Create(url) as WebRequest;
request.ContentLength = bytes.Length;
request.ContentType = "application/x-www-form-urlencoded";
request.Method = "POST";
using (var swRequest = request.GetRequestStream())
{
swRequest.Write(bytes, 0, bytes.Length);
}
The request URL (minus the domain) looks like this: /webservice.php?operation=create
The requestParameters variable looks like this (anonymised the data where there was data):
operation=create&sessionName=660f54e47e39358ce&element={"leadsource":"blaah","cf_757":"blaah","salutationtype":"0.","firstname":"blaah","lastname":"blaah","email":"blaah","phone":"blaah","description":"blaah","cf_833":"blaah","emailoptout":"1","cf_761":"1","cf_759":"1","cf_763":"1","assigned_user_id":"19x5"}&elementType=Leads
in the response i get back i receive the error below for nearly every record.
MANDATORY_FIELDS_MISSING: lastname does not have a value.
Last name and assigned user are the only mandatory values needed and the assigned user is the id returned from the login.
Is anybody able to provide some help on this? i have spent hours on it with no success.