This topic contains 1 reply, has 1 voice, and was last updated by Rodolfo 9 years, 1 month ago.
- Topic
Hi!
I’m trying to create a Lead using Rest/API. So, I’m using this example here:
I’m using guzzleHttp and my POST request is:
12345678910111213$responseOro = $oroClient->post('api/rest/latest/lead.json', ['body' => ['lead' => ['name' => 'lead_name_' . mt_rand(1, 500),'firstName' => 'first_name_' . mt_rand(1, 500),'lastName' => 'last_name_' . mt_rand(1, 500),'owner' => '1','dataChannel' => '16']]]);I’m getting these errors:
string(134) “Client error response [url] http://localhost/api/rest/latest/lead.json [status code] 400 [reason phrase] Bad Request”
string(609) “{“code”:400,”message”:”Validation Failed”,”errors”:{“children”:{“owner”:[],”name”:[],”dataChannel”:{“errors”:[“This value is not valid.”]},”namePrefix”:[],”firstName”:[],”middleName”:[],”lastName”:[],”nameSuffix”:[],”contact”:[],”jobTitle”:[],”phoneNumber”:[],”email”:[],”customer”:[],”companyName”:[],”website”:[],”numberOfEmployees”:[],”industry”:[],”address”:{“children”:{“id”:[],”label”:[],”namePrefix”:[],”firstName”:[],”middleName”:[],”lastName”:[],”nameSuffix”:[],”organization”:[],”country”:[],”street”:[“…“This value is not valid.”
The forum ‘OroPlatform – Programming Questions’ is closed to new topics and replies.