Solved

POST API command using Alteryx

  • 2 April 2024
  • 4 replies
  • 18 views

Badge

Hi! I'm trying to use Alteryx to run the Create or Update Profile command to post updated attributes in Klaviyo. I keep getting "An object with data is required" error, even though I have data selected in the payload. I think my syntax is incorrect but I'm not sure how to fix this. Below are screen shots of the POST command to update the organization for a profile.

 

 

icon

Best answer by Maxbuzz 3 April 2024, 08:55

View original

4 replies

Badge

here is the payload screenshot

Userlevel 3
Badge +7

Hello @ryannschuess 

Where is the payload? I see the data values but it should be an object with profile details

 

Here is what data should look like:

 "data": {
    "type": "profile",
    "id": "01GDDKASAP8TKDDA2GRZDSVP4H",
    "attributes": {
      "email": "sarah.mason@klaviyo-demo.com",
      "phone_number": "+15005550006",
      "external_id": "63f64a2b-c6bf-40c7-b81f-bed08162edbe",
      "anonymous_id": "01GDDKASAP8TKDDA2GRZDSVP4H",
      "_kx": "J8fjcn003Wy6b-3ILNlOyZXabW6dcFwTyeuxrowMers%3D.McN66",
      "first_name": "Sarah",
      "last_name": "Mason",
      "organization": "Example Corporation",
      "title": "Regional Manager",
      "image": "https://images.pexels.com/photos/3760854/pexels-photo-3760854.jpeg",
      "location": {
        "address1": "89 E 42nd St",
        "address2": "1st floor",
        "city": "New York",
        "country": "United States",
        "region": "NY",
        "zip": "10017",
        "timezone": "America/New_York",
        "ip": "127.0.0.1"
      },
      "properties": {
        "newKey": "New Value"
      }
    },
    "meta": {
      "patch_properties": {
        "append": {
          "newKey": "New Value"
        },
        "unappend": {
          "newKey": "New Value"
        },
        "unset": "skus"
      }
    }
  }

Userlevel 3
Badge +7

You can see an example here: https://developers.klaviyo.com/en/reference/create_or_update_profile

Badge

A screenshot of the payload is in the comments.

I was able to get the command to work! I need to add {“data”: { … }} to the payload and change the formatting of the download tool in Alteryx.

Here is the data format

{
"data": {
    "type": "profile",
    "id": "[id]",
    "attributes": {
      "email": "[email]",
      "organization ": "ํ[organization name]"
    }
  }
}

Thank you for your help!

Reply