Skip to main content
Solved

POST API command using Alteryx

  • April 2, 2024
  • 4 replies
  • 81 views

Forum|alt.badge.img+1

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.

 

 

Best answer by Maxbuzz

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

4 replies

Forum|alt.badge.img+1
  • Author
  • Contributor I
  • 2 replies
  • April 2, 2024

here is the payload screenshot


Forum|alt.badge.img+32
  • Partner
  • 253 replies
  • April 3, 2024

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"
      }
    }
  }


Forum|alt.badge.img+32
  • Partner
  • 253 replies
  • Answer
  • April 3, 2024

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

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!