4600Unable to process your request. Can't figure out how to send my create Potential request
4600Unable to process your request. Please verify if the name and value is appropriate for the "xmlData" parameter.
Is the error I am getting, I used to $_POST to get my variables, I am certain I am not doing my xmlData variable like I should but I am not certain at all how to set it up.
Any help would be greatly appreciated on where I am going wrong.
EDIT: when I echo xmlData it shows up as blank.. so obviously I am writing it wrong, but I do not see where the error is....
Thank you.
- $ch = curl_init('https://crm.zoho.com/crm/private/xml/Potentials/insertRecords?');
- curl_setopt($ch, CURLOPT_VERBOSE, 1);//standard i/o streams
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);// Turn off the server and peer verification
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);//Set to return data to string ($response)
- curl_setopt($ch, CURLOPT_POST, 1);//Regular post
- //Set post fields
-
- //used in the $xmlData variable below
-
- $xmlData= '<Potentials>'.
- '<row no=\"1">'.
- '<FL val="ACCOUNTID">'.$accountID.'</FL>'.
-
- '<FL val="Potential Name">'.$nomPlumb.'</FL>'.
- '<FL val="Description">'.$valid_Code.'</FL>'.
- '</row>'.
- '</Potentials>';
-
- $query = "newFormat=1&authtoken={$authtoken}&scope=crmapi&xmlData={$xmlData}";
- curl_setopt($ch, CURLOPT_POSTFIELDS, $query);// Set the request as a POST FIELD for curl.
- //Execute cUrl session
- $response = curl_exec($ch);
- curl_close($ch);
EDIT: Attempt 2
- $xmlData= simplexml_load_file('create_potential.xml');
- $xmlData->row[0]->FL[0]=$accountID; //Account ID
- $xmlData->row[0]->FL[1]=$nomPlumb;//Plumber name
- $xmlData->row[0]->FL[2]=$valid_Code;//description
I did this as $xmlData and it still doesn't work