Skip to main content
Problem Solver I
May 5, 2024
Solved

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

  • May 5, 2024
  • 6 replies
  • 92 views

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?

    This topic has been closed for replies.
    Best answer by rafath217

    Found the solution here. Thanks!
     

     

    6 replies

    Problem Solver I
    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"

                                    }

                                }

                            }

                        }

                    }

    rafath217Author
    Problem Solver I
    May 6, 2024

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

    Problem Solver I
    May 6, 2024
    rafath217Author
    Problem Solver I
    May 6, 2024

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

    Problem Solver I
    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}");

    rafath217AuthorAnswer
    Problem Solver I
    May 6, 2024

    Found the solution here. Thanks!