podio-php
podio-php copied to clipboard
podio get_basic_by_field not work
I want to fetch podio data using field_id and item_id . I use this function and it does not work for me :
$fild_value = PodioItem::get_basic_by_field( $item_id, $field_id );
And output is : "PodioBadRequestError (1) PodioBadRequestError" .
A bad request usually is something wrong with the data you are sending; Please check item_id and field id and try again
A bad request usually is something wrong with the data you are sending; Please check item_id and field id and try again
I try since this morning and the same problem, though item_id and field_id as true
and my real probleme is :
I fetch data from podio CRM using PHP language and I fetch data for each element via its id as it is found in this function:
public function getContacts($item_id) {
$this->contactAuth();
$item = \PodioItem::get_by_app_item_id($podio_contact_app_id,$item_id);
return $item;
}
For example we have the 'Status' we show it like this:
$status = $item->fields[6]->values;
Not all elements get it right though it is the same function.
Sometimes :
$status = $item->fields[6]->values;
and sometimes :
$status = $item->fields[8]->values;
I tried to access data via a function : get_basic_by_field() but it did not work
What is the simplest solution to these problems? Can we know what caused the problem?
Yeah that looks dangerous, get a field value by it's array position.
Can you try changing it to the external_id ? It's the second best (the best is field_item_id but that is annoying to use specially in multiple environments)