REST API and Company Name in Contact

Hello,

Could you confirm that adding company name during creating or updating a contact is not yet working in REST API ?

Best Regards

Company has been working for quite some time.

However, when I tried to update my contact with a company name, it leaves blank :

$data = array(‘duplicate_option’ => ‘Email’, ‘family_name’ => $nom, ‘given_name’ => $prenom ,‘email_addresses’ => array(array(‘email’=>$email_user,‘field’=>‘EMAIL1’)), ‘company’ => array(‘company_name’=>$societe),‘addresses’ => array(array(‘field’=>‘BILLING’,‘line1’=>$adresse1,‘line2’=>$adresse2,‘locality’=>$ville,‘postal_code’=>$code_postal),array(‘field’=>‘SHIPPING’,‘line1’=>$adresse1_liv,‘line2’=>$adresse2_liv,‘locality’=>$ville_liv,‘postal_code’=>$code_postal_liv)));

Result : Array
(
[email_addresses] => Array
(
[0] => Array
(
[email] => xxxxx@gmail.com
[field] => EMAIL1
)

    )

[email_opted_in] => 
[addresses] => Array
    (
        [0] => Array
            (
                [line1] => Test
                [line2] => 
                [locality] => xxxxx
                [region] => 
                [field] => BILLING
                [postal_code] => xxxxx
                [zip_code] => xxxxx
                [zip_four] => 
                [country_code] => 
            )

        [1] => Array
            (
                [line1] => xxxxxxxx
                [line2] => 
                [locality] => xxxxxxx
                [region] => 
                [field] => SHIPPING
                [postal_code] => xxxxxx
                [zip_code] => xxxxxxx
                [zip_four] => 
                [country_code] => 
            )

    )

[last_updated] => 2019-09-30T16:27:13.000+0000
[tag_ids] => Array
    (
    )

[owner_id] => 
[date_created] => 2019-09-27T16:29:06.000+0000
[middle_name] => 
[given_name] => Test
[email_status] => NonMarketable
[phone_numbers] => Array
    (
    )

[company] => 
[id] => 9
[family_name] => Test

)

Your parentheses are off in the above section. You have three left paren and only one right…that won’t work.

I suggest not getting fancy with anything and just copy the samples and modify them little by little. Don’t add or remove anything from the example than necessary and only small changes at a time so you can see where it went wrong.

Hello,

You don’t watch all the message :

Result : Array
(
[email_addresses] => Array
(
[0] => Array
(
[email] => xxxxx@gmail.com
[field] => EMAIL1
)
)

[email_opted_in] =>
[addresses] => Array
(
[0] => Array
(
[line1] => Test
[line2] =>
[locality] => xxxxx
[region] =>
[field] => BILLING
[postal_code] => xxxxx
[zip_code] => xxxxx
[zip_four] =>
[country_code] =>
)
[1] => Array
(
[line1] => xxxxxxxx
[line2] =>
[locality] => xxxxxxx
[region] =>
[field] => SHIPPING
[postal_code] => xxxxxx
[zip_code] => xxxxxxx
[zip_four] =>
[country_code] =>
)

)

[last_updated] => 2019-09-30T16:27:13.000+0000
[tag_ids] => Array
(
)

[owner_id] =>
[date_created] => 2019-09-27T16:29:06.000+0000
[middle_name] =>
[given_name] => Test
[email_status] => NonMarketable
[phone_numbers] => Array
(
)

[company] =>
[id] => 9
[family_name] => Test
)

If you’re using REST then you have to send a json string as your information…not a structure with arrays. If you try to build it with arrays and convert it into json, it’s near impossible to duplicate the format you need. Stick to working with the original json example and modify it (without converting it or trying to rebuild it with arrays etc)