Skip to main content
Solved

Unable to update profile's custom properties in "string" format

  • May 5, 2024
  • 6 replies
  • 52 views

Forum|alt.badge.img+1

I want my data to be stored in string format for a profile’s custom properties, but it always gets stored in the array format. Anything I’m doing wrong here?

Best answer by rafath217

Found the solution here. Thanks!
 

 

6 replies

Forum|alt.badge.img+3
  • Problem Solver I
  • 6 replies
  • May 6, 2024

Hi, I think the structure of request parameters should look like this 

data = new Data

                {

                    type = "event",

                    attributes = new EventAttributes

                    {

                        properties = new EventProperties

                        {

                            SomeAttribute= "1234"

                        },

                        metric = new Metric

                        {

                            data = new MetricData

                            {

                                type = "metric",

                                attributes = new MetricAttributes

                                {

                                    name = "pp"

                                }

                            }

                        },

                        profile = new Profile

                        {

                            data = new ProfileData

                            {

                                type = "profile",

                                attributes = new ProfileAttributes

                                {

                                    email = "a@gmail.com",

                                    first_name = "John"

                                }

                            }

                        }

                    }

                }


Forum|alt.badge.img+1
  • Author
  • Contributor I
  • 3 replies
  • May 6, 2024

Hey @Arif Astori Thanks for replying. Could you please attach the relevant documentation regarding this?


Forum|alt.badge.img+3
  • Problem Solver I
  • 6 replies
  • May 6, 2024

Forum|alt.badge.img+1
  • Author
  • Contributor I
  • 3 replies
  • May 6, 2024

We are using the exact same format as provided in the docs, but still getting the value stored in an array. 


Forum|alt.badge.img+3
  • Problem Solver I
  • 6 replies
  • May 6, 2024

Can you share the endpoint use are using, also have you added the header correctly like

   request.Headers.Add(Constants.KlaviyoConstants.HeaderAccept, Constants.KlaviyoConstants.HeaderAcceptValue);

            request.Headers.Add(Constants.KlaviyoConstants.HeaderRevision, Constants.KlaviyoConstants.HeaderRevisionValue);

            request.Headers.Add(Constants.KlaviyoConstants.Authorization, $"{Constants.KlaviyoConstants.HeaderApiKey} {Constants.KlaviyoConstants.HeaderPrivateApiKeyValue}");


Forum|alt.badge.img+1
  • Author
  • Contributor I
  • 3 replies
  • Answer
  • May 6, 2024

Found the solution here. Thanks!