private static void PatchPhoneContactPoint()

in SampleCPMProject/Program.cs [158:189]


        private static void PatchPhoneContactPoint()
        {
            ContactName name = new ContactName()
            {
                FirstName = "John",
                LastName = "Doe"
            };

            PhoneContactIdentity identity = new PhoneContactIdentity()
            {
                PhoneNumber = "+14256668888",                                   //The phone number should follow the E.164 standard
                Name = name
            };

            PhoneContactPoint phoneContactPoint = new PhoneContactPoint()
            {
                Identity = identity,
                Country = "US"                                                  //Use only ISO 2 char country codes. Any other string will result in HTTP 400
            };

            phoneContactPoint.TopicSettings.Add(new ContactPointTopicSetting
            {
                TopicId = testTopicId,                                          //Topic ID for which this permission was collected
                CultureName = CultureInfo.CurrentCulture.ToString(),            //Specify a culture supported by the topic. E.g en-US, fr-FR, fr-CA etc. Communication with the user will be based on this culture;
                LastSourceSetDate = DateTime.UtcNow,                            //The actual time at which this permission was collected. Could be in the past..
                OriginalSource = "SampleCPMProject",                            //Name of this application that collected the consent. Saved for auditing purposes.
                State = ContactPointTopicSettingState.OptInExplicit             //The permission
            });

            cpmClient.PatchPhoneContactPoint(phoneContactPoint).Wait();
            Console.WriteLine("Phone contact patch successfull");
        }