Last active
December 27, 2017 08:19
-
-
Save DmitriySmirnov/8b29429d75e9b66eef9c88d4a647a3e8 to your computer and use it in GitHub Desktop.
How to create a bundle using wild apricot API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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