I’m migrating our calls to the v2 API, previously we used the endpoint /api/v1/campaigns which includes the subject of the campaign and all of its related attributes.
It seems, it has been migrated to a relationship called “campaign-messages”, except I can’t find in your API how to directly embed them in the /api/campaigns call.
I don’t want to be forced to call /api/campaigns/{id}/campaign-messages/ on each campaign, which is not perfect for performance reasons.
Thank you
Best answer by Kim Strauch
This is where relationships come into play. You can use an `?include=campaign-messages` query parameter to include details about the related campaign message(s) for each campaign. Each campaign will include its related campaign message(s) under the relationships key, and you can see the full data for each campaign is included under the `included` key.
This is where relationships come into play. You can use an `?include=campaign-messages` query parameter to include details about the related campaign message(s) for each campaign. Each campaign will include its related campaign message(s) under the relationships key, and you can see the full data for each campaign is included under the `included` key.