mailin-api/mailin-api-php

Can't update custom attribute value with SendInBlue API

Closed this issue · 2 comments

Hi,
I can't succeed to update user's custom attribute value with SendInBlue API.
In fact, I want to update his firstname PRENOM and his last name Nom, but only his firstname is updated (PRENOM). The other custom attribute (Nom) is not updated at all, even if get_attributes() returns it well.
I have no error, it's just like the value of attribute Nom was ignored...

Here is my code:

$data = array(
    "email" => $email,
    "attributes" => $attributes,
    "listid" => array($liste['id'])				
);

var_dump($mailin->get_attributes());
var_dump($data);
var_dump($mailin->create_update_user($data));
// $mailin->get_attributes()
array(3) {
  ["code"]=>
  string(7) "success"
  ["message"]=>
  string(45) "All attributes and values have been retrieved"
  ["data"]=>
  array(5) {
    ["normal_attributes"]=>
    array(22) {
      [0]=>
      array(2) {
        ["name"]=>
        string(3) "Nom"
        ["type"]=>
        string(4) "text"
      }
      [1]=>
      array(2) {
        ["name"]=>
        string(6) "PRENOM"
        ["type"]=>
        string(4) "text"
      }
      ...
    }
    ...
  }
  ...
}


// $data
array(3) {
  ["email"]=>
  string(15) "email@domain.com"
  ["attributes"]=>
  array(4) {
    ["Nom"]=>
    string(8) "last name"
    ["PRENOM"]=>
    string(10) "firstname"
    ["PRODUIT"]=>
    string(18) "product"
    ["GAMME_PRODUIT"]=>
    string(32) "product range"
  }
  ["listid"]=>
  array(1) {
    [0]=>
    string(2) "11"
  }
}


// $mailin->create_update_user($data)
array(3) {
  ["code"]=>
  string(7) "success"
  ["message"]=>
  string(27) "User created successfully. "
  ["data"]=>
  array(1) {
    ["id"]=>
    int(57197)
  }
}

Hi @hjerem

Thanks for contacting us, your issue has been fixed.

Regards
SendinBlue Team

Hi @ekta-slit

Can I have more information please ?
What was the issue and how has it been resolved ?

Thanks