Post

0 followers Follow
0
Avatar

Non required field "Must be at least 1 characters long"?

I'm trying to create an item from the API but I get an error saying "Invalid field 18365819 ('value'): Invalid value u'': Must be at least 1 characters long"".

The field is a simple single line text field which is not required. I can create an item on the Podio Website without any value in the same field without any problem.

 

The app who owns the field is* /app/2403044/field/18365819*.

From the log:

[Mon Nov 05 22:53:10 2012] [error] [client ::1] [PODIO] Reponse: {"error_propagate":false,"error_parameters":{},"error_detail":null,"error_description":"Invalid field 18365819 ('value'): Invalid value u'': Must be at least 1 characters long","error":"invalid_value"}, referer: http://localhost/hotmap/register/21522664

Carl-Fredrik Herö Answered

Please sign in to leave a comment.

4 comments

0
Avatar

Can you share the request body and the code that is generating the request?

Andreas Haugstrup Pedersen 0 votes
Comment actions Permalink
0
Avatar

I'm use the PHP Library (current stable):

$update = $api->item->create($org_app_id, array('fields' => $data[$name]));

The $data[$name] contains (var_dumped): 

array(9) { ["namn"]=> string(0) "" ["kontaktperson"]=> array(1) { [0]=> int(53184615) } ["email"]=> string(0) "" ["organisationsnummer"]=> string(0) "" ["telefon"]=> string(0) "" ["besoksadress2"]=> string(0) "" ["postnummer"]=> string(0) "" ["postort"]=> string(0) "" ["fakturaadress2"]=> string(0) "" }

Field 18365819 is postnummer the array above.

Carl-Fredrik Herö 0 votes
Comment actions Permalink
0
Avatar

For kicks can you change the empty strings to by null instead (or remove all the empty strings from the request all together)?

Andreas Haugstrup Pedersen 0 votes
Comment actions Permalink
0
Avatar

You're right, I shouldn't try to insert empty values at all.

Carl-Fredrik Herö 0 votes
Comment actions Permalink