Skip to main content
Active Contributor II
September 24, 2023
Solved

Migration from "Get Campaigns" Endpoint in Legacy API to New Revision: Clarification Needed

  • September 24, 2023
  • 4 replies
  • 167 views

While transitioning from the Legacy API to the new revision, I encountered the following under the 'relationships' section in the sample response of the new API:


"relationships": { "campaign-messages": { "data": [ { "type": "campaign-message", "id": "string" } ], }


I noticed that the data for "campaign-messages" is presented in an array format, implying that there could be multiple campaign messages associated with a single campaign.

Could someone please confirm if my understanding is correct? If it is, could I also get an explanation or a potential scenario in which a campaign would incorporate more than one campaign message? Any insights would be appreciated.

    This topic has been closed for replies.
    Best answer by Kim Strauch

    Hey @santiagosanti! A campaign will typically have one message associated with it but could have multiple messages in the case that an A/B test has been configured. In that case I believe you may have a campaign message for each of the variations in your test. 

    4 replies

    Kim Strauch
    Klaviyo Employee
    Klaviyo Employee
    September 24, 2023

    Hey @santiagosanti! A campaign will typically have one message associated with it but could have multiple messages in the case that an A/B test has been configured. In that case I believe you may have a campaign message for each of the variations in your test. 

    Active Contributor II
    December 15, 2023

    Hello,

    I have some concerns and questions regarding the migration from the Legacy API to the new revision API to get campaign related data. I have not yet migrated to the new revision API because I have observed that it may not offer the same level of performance as the legacy API.

    In the legacy API, all the necessary data, included and excluded list attributes, campaign message attributes, and total recipients, is available in a single API call. However, in the new revision API, it seems that I would need to make multiple API calls to retrieve the same information. This could potentially slow down the data retrieval process and impact performance.

    Additionally, I am having difficulty locating where I can retrieve the "campaign - is segmented" value by campaign ID in the new API.

    Thank you for your assistance. I look forward to your response.

    Brian Turcotte
    Klaviyo Alum
    January 23, 2024

    Hi @santiagosanti!

    The API team is currently working on ways to make this easier in later releases, so I’ll update the thread when there are further updates!

     

    Best,

    Brian

    Active Contributor II
    June 5, 2024

    Hi @Brian Turcotte,

    Any updates on this? The deprecation of the Legacy API is near, and I'm concerned about performance and locating the "campaign - is segmented" value in the new API revision.

    Thanks!