Announcement

Collapse
No announcement yet.

PhoneNumber and ActionHistoryRecord Entities

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PhoneNumber and ActionHistoryRecord Entities

    Hi,

    I'm working on a migration project, and I have 2 questions:

    a) How do I import multiple contact phones? /api/v1/Contact/{id}/PhoneNumber is not available... If I send a GET to /api/v1/Contact/{id}, I get only one phone number. Who can I get all of them?

    b) Customer would like to import history contacts from the old application. So, I think the best approach would import these informations to ActionHistoryRecord, but I get permission problems with the API.

    Can anyone more experienced help me?


    Thanks in advance

    Eduardo
    Last edited by eduardofendrich; 10-07-2021, 12:47 PM.

  • #2
    Hello,


    1) phoneNumberData contains all phoneNumber, type and so
    2) i don't know out-of-box, but you can make your own script (entryPoint or API) and fetch all.

    Comment


    • #3
      Hi,

      Thanks

      1-I'll check, thanks.
      2-Use Stream API. POST and GET works.

      Comment


      • #4
        Item 2, OK.

        Item 1, my problem persists. I've read your suggestion, but there is nothing about how use PhoneNumberData with REST calls.

        Thanks

        Comment


        • #5
          Hello,
          if you make a get /api/v1/Contact/{id}. ... phoneNumberData is here emailAddressData too




          "emailAddressData":[{"emailAddress":"micha@puerto_demo.lk","lower": "mi cha@puerto_demo.lk","primary":true,"optOut":false, "invalid":false}],"phoneNumberData":[{"phoneNumber":"123-979-070","type":"Other","primary":true,"optOut":false , "invalid":false}],

          Comment


          • #6
            Thanks, for reading it's ok, I get them. But how should I convert into a REST POST call?

            $response = $client->request('POST', 'Contact',
            ['firstName' => 'firstName',
            'lastName' => 'surname',
            'phoneNumberData' => '***'
            ]
            );

            *** should be '[{"phoneNumber" => "123","type" => "Other","primary" => true,"optOut" => false, "invalid" => false},
            {"phoneNumber" => "124","type" => "Other","primary" => false,"optOut" => false, "invalid" => false}]'
            ?

            Comment


            • #7
              i know in v6 Yuri have make some change (api/entryPoint method Get - Post. .but forget)
              if i understand your question

              'phoneNumberData' => [
              [
              "phoneNumber" => "blabla",
              "type" => "Office"
              ],
              [
              "phoneNumber" => "blabla2",
              "type" => "Mobile"
              ],

              ]

              Comment


              • #8
                Yes, you got the point. I'm able to do hard coded, but do you know how to create this structure dinamically? (some contacts have 1 phone, others have 2, someothers 3)

                Comment


                • #9
                  Hello,

                  it's a array of ... object or json

                  $matrix = [
                  (object) [
                  'type' => 'linkedin',
                  'url' => 'blabla.com',
                  'isActive' => false,
                  ],
                  (object) [
                  'type' => 'facebook',
                  'url' => 'fafa.com',
                  'isActive' => true,
                  ]
                  ];

                  for i= 1 < countContact

                  phoneNumberData[] = json_encode( ['phoneNumber' => 'blabla' ] )

                  I thinks something so

                  Comment

                  Working...
                  X