Using RestAPI to determine Mailings for a Group

  • 0
  • 1
  • Question
  • Updated 8 months ago
Is it possible via the RestAPI to determine the mailings to which a group was assigned?

For example:
https://api.e2ma.net/xxxxx/mailings?member_group_id=yyyyyy
Photo of LexisNexis

LexisNexis

  • 20 Posts
  • 2 Reply Likes

Posted 8 months ago

  • 0
  • 1
Photo of Kyle Gregory | Lipscomb University

Kyle Gregory | Lipscomb University, Champion

  • 99 Posts
  • 69 Reply Likes
Hey LexisNexis,

Looks like the best way to go about that would be to query your mailings, then get the groups to which a particular mailing was sent and record the keys where the group was present. Doesn't seem like there is a straightforward call to accomplish it, but you can do it through a bit of data analysis on your end.

Hope that helps get you on your way.

Thanks,
Kyle
Photo of LexisNexis

LexisNexis

  • 20 Posts
  • 2 Reply Likes
I've already considered that route except that it requires a request for each mailing until I find the one that has the group that I'm looking for.  With hundreds of potential mailings, that hundreds of calls to the server.  Bummer.

P.S.
I posted an issue for your "EmmaSharp" .NET wrapper. 
https://github.com/kylegregory/EmmaSharp/issues/35

I had to implement my own "AddNewMembers" and "Members" class because I have an EMMA customer where the "ImportId" value is too big for Int32.

  public class MembersAdd
  {
    [JsonProperty("import_id")]
    public long ImportId { get; set; }
  }
(Edited)
Photo of Kyle Gregory | Lipscomb University

Kyle Gregory | Lipscomb University, Champion

  • 99 Posts
  • 69 Reply Likes
True, but if you save the information on your end, you should only have to do it once for everything the past 18 months. Then maybe a triggered process to search mailings over the last N time period can help you keep the list current. Because Emma doesn't record (at least publicly) mailings in audience groups, I don't think there will likely be an API call to do Group -> Mailings vs what's capable today for Mailing -> Groups.

Yeah, thanks for the heads up on the Int32 issue. I've made the change in code, but not been able to push a change due to time.

Kyle
Photo of LexisNexis

LexisNexis

  • 20 Posts
  • 2 Reply Likes
Can't use a trigger because that would require an endpoint accessible from outside the client's network.  That is not possible.
Photo of LexisNexis

LexisNexis

  • 20 Posts
  • 2 Reply Likes
Now, if there were a "field" on a group that I could populate via a trigger once the mailing is sent, that would accomplish what I need to do.  But I don't believe that there are any such "fields" on a group.
Photo of Kyle Gregory | Lipscomb University

Kyle Gregory | Lipscomb University, Champion

  • 99 Posts
  • 69 Reply Likes
Yeah, on the public API there is no property of group that relates in any way to a mailing.
Photo of Ross Cochran

Ross Cochran, Official Rep

  • 134 Posts
  • 10 Reply Likes
It looks like Kyle has this one answered pretty well. If you need anything else, don't hesitate to let us know.  Cheers!