Post

1 follower Follow
0
Avatar

Fatal error: Uncaught exception 'PodioBadRequestError' with message 'The mail address name is not valid'

//get data from file

$fileName = '../test.csv';

$file = fopen($fileName,"r");

//while not to end of file

while (!feof($file)) {

while (($csv_line = fgetcsv($file)) !== FALSE) {

$contact_new = PodioContact::create( $space_id, $attributes = array(

$user_id = user_id => $csv_line[0],

$name = name => ucwords(strtolower(($csv_line[1]))),

$phone = phone => array($csv_line[4]),

$zip = zip => $csv_line[5],

$state = state => mb_strtoupper($csv_line[7]),

$country = country => mb_strtoupper($csv_line[6]),

$email = mail => array($csv_line[2])

));

}

sleep(2);

}

 

I do not inderst why i am getting this error with this code. I referred to PodioContact.php and it says the attribute name is 'mail' and that it is an array. Can anyone help

Nick George Answered

Please sign in to leave a comment.

1 comment

0
Avatar

Hi Nick,

A good first step would be to check that your CSV parsing gives you the data you expect. Print out the data you are sending to the Podio API before sending it so you can see exactly which attributes you are sending (or enable debug mode in the PHP client)

/Andreas

Andreas Haugstrup Pedersen 0 votes