How can we make it easier for you to develop on top of Wild Apricot?

Sending email via API

I'm trying to use the send email API call - https://app.swaggerhub.com/apis-docs/WildApricot/wild-apricot_public_api/2.1.0#/Emailing.Operations/SendEmail but not having any luck.

I've tried from the API browser and via a Google Apps script. In both, I just get a 400 error.

I'm POSTing to https://api.wildapricot.org/v2.1/rpc/<ACCOUNT>/email/sendemail, with this as my body:
{
"Subject": "test email",
"Body": "test email",
"Recipients": [
{
"Id": 0,
"Type": "IndividualRecipient",
"Name": "test",
"Email": "<HIDDEN>"
}
],
"EventId": <EVENTID>
}

(account, email and event id have been hidden). Each time, I get a 400 error: Parameter is required: EmailDraftParam.
The swagger documentation doesn't mention a "EmailDraftParam". What am I doing wrong?

1 vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    Mark shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    4 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...
      • Mark commented  ·   ·  Flag as inappropriate

        Thanks for this info! This helps me understand how this API call works.

        In this case, I want the second option - sending email to everyone registered for an event, and not the wait list. (we're sending a post-event feedback email, and manually sending it each time)

        Unfortunately, I still don't quite have the body right. Using event 1000 as an example, I've tried

        {
        "Subject": "test email",
        "Body": "test email",
        "Recipients": [
        {
        "Type": "EventAttendees_All",
        }
        ],
        "EventId": 1000
        }

        and

        {
        "Subject": "test email",
        "Body": "test email",
        "Type": "EventAttendees_All",
        "EventId": 1000
        }

        But still getting a 400. What should I be sending instead?

      • AdminDmitry Smirnov (Product Owner, Wild Apricot by Personify) commented  ·   ·  Flag as inappropriate

        If you want to send email to individual recipient, then you have to provide valid contact id (id:0 is not a valid contact id) and don't need to provide eventId.

        If you want to send email to event-related recipients, then Type should be set to one of EventAttendees_All, EventAttendees_Selected, EventWaitlist_All, EventWaitlist_Selected.

      Feedback and Knowledge Base