"Draft" campaigns are not returned by GET /#account_id/mailings/#mailing_id

  • 0
  • 1
  • Question
  • Updated 1 year ago
I have a "draft" campaign (i.e., "/campaigns/create/212359325/"). GET /#account_id/mailings/212359325 (via the EMMASharp wrapper) returns HTTP 404. What am I doing wrong?



Photo of LexisNexis

LexisNexis

  • 20 Posts
  • 2 Reply Likes

Posted 1 year ago

  • 0
  • 1
Photo of Kyle Gregory | Lipscomb University

Kyle Gregory | Lipscomb University, Champion

  • 99 Posts
  • 69 Reply Likes
Hey @LexisNexis,

Looks like "draft" campaigns can't be queried. I just tried with two separate accounts and received 404s on both. If you query the ListMailings (GET /#account_id/mailings) method you'll see drafts are not there either.

Hope that helps point you in the right direction.

Thanks,
Kyle
Photo of Jason Nack

Jason Nack

  • 7 Posts
  • 0 Reply Likes
Two things are thwarting you here, both in the design/documentation of Emma's API, and not necessarily your use or expectation of how it should work.

First, the API only provides access to mailings that are sent, or in the process of being sent. There is no endpoint for campaigns as mailing documents, only for meta-data on distributed campaigns.

Second, the unique number in the url of the Emma front-end is NOT the mailing_id that they provide through the API. To get the actual mailing_ids for your account (again, only for distributed mailings), you need to retrieve the list from "GET /#account_id/mailings".

So in short, you are not doing anything wrong. I would say you are trying to use the API as it should be designed, but unfortunately that is not how it is designed.
Photo of LexisNexis

LexisNexis

  • 20 Posts
  • 2 Reply Likes
Thx.
Photo of Kyle Gregory | Lipscomb University

Kyle Gregory | Lipscomb University, Champion

  • 99 Posts
  • 69 Reply Likes
I want to clarify Jason's note, which does have some good insight. Yes, only mailings which have been scheduled or sent (including standard, test, etc) can be queried.

Because a campaign can be sent multiple times, the mailing_id will correspond to that mailing in Response (not the Campaign). Though using the API is preferable, in a pinch a mailing_id can be retrieved from the Response URL. 



You'll just need to make sure you know what ID goes with which call.

Best,
Kyle
Photo of LexisNexis

LexisNexis

  • 20 Posts
  • 2 Reply Likes
Right, I am grabbing the ID from the /response/overview page.