$new_contact = PodioContact::create(
2144836,
new PodioContact(
array('name' => $name,'title'=>$title, 'organization'=>$org, 'phone' => $phone, 'mail' => $email)
)
);
Above is the method of creating a new contact. It accepts 2 arguments, first is a integer for workspace id, the second one is an Contact object which holds the contact details.
Referring to here https://developers.podio.com/doc/contacts/create-space-contact-65590, I clearly know what should be the first argument, which was the workspace id.
However the second argument is stated as $attributes = array() in the API Doc which is an array. I ASSUMED this to be a key value array of the contact's properties. I proceeded to pass a key value array into the second argument like so:
$new_contact = PodioContact::create(
2144836,
array('name' => $name,'title'=>$title, 'organization'=>$org, 'phone' => $phone, 'mail' => $email)
);
It kept failing to work. After struggling and wasting 1 hour. I simply tried to pass an Contact Object as the second argument as shown in the beginning of this post. So with this trial and error and wasting a large amount of time, I discovered what should be the second argument by luck.
So my question is, why is the API Doc showing the second argument should be an array? Is the documentation wrong or am I missing something? Could you please tell me if I did anything wrong here so I don't have to trial and error and waste 1~2hours to figure out the second argument.