I've built on Larry Person's work and modified his pull request to retrieve spoke contacts as OSDI people, as well as take batched uploaded contacts. I've put a dev server up, you can play with. Whee...
Go Here
This should bring up the olde trusty HAL browser pointed at an organization and campaign. In the Custom Request Headers box, put
OSDI-API-Token: osdi_rocks
You can browse the OSDI people, aka campaign contact collection in Spoke. Code Branch https://github.com/joshco/Spoke/tree/osdi_contacts
I've riffed on the OSDI Person Signup Helper with another attribute "people" which takes an array of people to sign up in one shot. It reuses Larry's validation, so you'll get back status.
POST http://spoke.dev.joshco.org/osdi/org/1/campaigns/1/api/v1/contacts
Content-Type: application/json
{
"people": [
"given_name": "loooooLawrence",
"family_name": "Woodard",
"phone_numbers": [
{
"number_type": "Mobile",
"number": "+16462321001",
"sms_capable": true
}
]
[....snip....]
{
"invalid": [
{
"first_name": "Scott",
"last_name": "Williams",
"email": "[email protected]",
"cell": null,
"zip": "10011"
}
],
"dupes_in_batch": 0,
"number_submitted": 9,
"dupes_in_campaign": 8,
"opted_out": 0,
"added": 0
}