Podio's API documentation differs from podio-php's when it comes to creating new Items.
Based on Podio's tutorial, I would have to format each value according to its type, whereas podio-php describes using PodioItemFieldCollection
to handle that for you. I prefer the latter option, but I keep getting this error:
Invalid value "1" (string): Not a valid option
I don't see much difference in my code versus the example given by podio-php. What's causing this error?
$fields = new PodioItemFieldCollection(array(
new PodioTextItemField(array("external_id" => "my-text-field", "values" => "FooBar")),
new PodioProgressItemField(array("external_id" => "my-number-field", "values" => 75))
));
$atts = array(
'app' => new PodioApp($app_id),
'fields' => $fields
);
$item = new PodioItem($atts);
No errors caught up to here. But when I try to save...
$response = $item->save();
Invalid value "1" (string): Not a valid option