Skip to content

Instantly share code, notes, and snippets.

@DmitriySmirnov
Last active December 27, 2017 08:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DmitriySmirnov/8b29429d75e9b66eef9c88d4a647a3e8 to your computer and use it in GitHub Desktop.
Save DmitriySmirnov/8b29429d75e9b66eef9c88d4a647a3e8 to your computer and use it in GitHub Desktop.
How to create a bundle using wild apricot API
Assume you have a bundle level with id = 9378
1. Create bundle admin
POST https://api.wildapricot.org/v2.1/accounts/XXX/contacts
{
"email":"my_bundle_admin@invaliddomain.com",
"membershipLevel": { "id": 9378 },
"membershipEnabled":true,
"fieldValues":[
{
"fieldName":"Member role",
"value": "Bundle administrator"
}
]
}
2. As a result of POST operation you will get a json of new contact.
So find a record in FieldValues with "FieldName": "Bundle ID" and take "Value" from that record. Assume it equals 16125
3. Create a bundle member
POST https://api.wildapricot.org/v2.1/accounts/XXX/contacts
{
"email":"my_bundle_member@invaliddomain.com",
"membershipLevel": { "id": 9378 },
"membershipEnabled":true,
"fieldValues":[
{
"fieldName":"Bundle ID",
"value": 16125
},
{
"fieldName":"Member role",
"value": "Bundle member"
}
]
}
4. Check we have a bundle and it contains members we expect
GET https://api.wildapricot.org/v2.1/accounts/XXX/bundles/16125
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment