This topic contains 3 replies, has 2 voices, and was last updated by cardiac 8 years, 9 months ago.
- Topic
Hi all,
I have the same problem, some of the other users have.
OroPlatform: 1.7.0
Guzzle Request:
$response = $this->client->post(
'http://crm-dev.dev/api/rest/latest/leads.json',
[
"headers" => [
"Authorization" => "WSSE profile="UsernameToken""
"X-WSSE" => "UsernameToken Username="bolt", PasswordDigest="1ePa3pK+CQiurS/J3HyZawJmbWA=", Nonce="559b83c9cf4fb", Created="2015-07-07T09:46:17+02:00""
]
"json" => [
"gender" => "male"
"firstname" => "Test"
"lastname" => "Test"
"email" => "test@test.de"
"phone" => "0170 123 123"
"zipcode" => "81541"
"city" => "Weilheim"
"source" => "bolt"
"sourceId" => "4"
]
"debug" => "debug"]
);
Response:
{"code":400,"message":"Validation Failed","errors":{"children":{"gender":{"errors":["This value should not be blank."]},"firstName":{"errors":["This value should not be blank."]},"lastName":{"errors":["This value should not be blank."]},"phoneNumber":[],"email":{"errors":["This value should not be blank."]},"address":{"children":{"id":[],"label":[],"namePrefix":[],"firstName":[],"middleName":[],"lastName":[],"nameSuffix":[],"organization":[],"country":[],"street":[],"street2":[],"city":[],"region":[],"region_text":[],"postalCode":[]}},"organization":[],"bankFirstName":[],"bankLastName":[],"bankIban":[],"sourceId":[],"source":[],"bankBic":[]}}}
Debugging:
AppBundle\Form\Handler\LeadHandler.php
echo 'Form Name: ' . print_r($this->form->getName(), true) . PHP_EOL;
echo 'Keys: ' . print_r(array_keys($this->form->all()), true) . PHP_EOL;
echo 'Values: ' . print_r($this->request->request->all(), true) . PHP_EOL;
echo 'Method: ' . $this->request->getMethod() . PHP_EOL;
die('FALSE!' .print_r($this->form->getErrors(), true));
die();
Form Name: lead
Keys: Array
(
[0] => gender
[1] => firstName
[2] => lastName
[3] => phoneNumber
[4] => email
[5] => address
[6] => organization
[7] => bankFirstName
[8] => bankLastName
[9] => bankIban
[10] => sourceId
[11] => source
[12] => bankBic
)Values: Array
(
[gender] => male
[firstname] => Test
[lastname] => Test
[email] => test@sb.banovo.de
[phone] => 0170 123 123
[zipcode] => 81541
[city] => Weilheim
[source] => bolt
[sourceId] => 4
)Method: POST
FALSE!Array
(
)But $entity is empty, because func_get_args() is empty in RestController.php#L55
Hope somebody of you can help me out fixing this problem.
Thanks and regards
The forum ‘OroPlatform – Programming Questions’ is closed to new topics and replies.