Eoin - I’m not able to even get the event creation to work. Do you have some code that you can share? I’m using Python right now, I’m doing something like this:
postdata = {"event":{"title":"Troop Meeting"}}
# Meeting event type
postdata["event"]["event_type_id"] = "52183"
postdata["event"]["location"] = "Church"
postdata["event"]["start_at"] = str(startdate) + "T18:00-0600"
postdata["event"]["end_at"] = str(startdate) + "T19:30-0600"
postdata["event"]["description"] = "Test"
postdata["event"]["inviteable_tokens"] = scList
# ourtroop is just a placeholder for this example
eventsURL = "https://ourtroop.trooptrack.com:443/api/v1/events"
headers = {"Content-type" : "application/json",
"X-Partner-Token" : XPartnerToken,
"X-User-Token": XUserToken}
response = requests.post(eventsURL, headers=headers, data=postdata)
I’ve tried removing the inviteable_tokens line completely as well as just setting it to an empty string and nothing works. Current, scList is an array of ‘User-’ values like it mentions in the spec. In all cases, I get Error 400 and I’m not sure what I’m doing incorrectly here.
The only change that was needed was to switch the output from a regular dictionary to a string via this one line
postdata = json.dumps(postdata)
I had to wade through your code a bit, but once I saw that, I realized that was probably my issue. I didn’t have to do this when getting the tokens though. So, it’s weird that it’s needed for the events, but not the tokens. Or maybe it’s only needed when you have a dictionary of dictionaries. i.e. the token is just 3 entries in one dictionary. The event request is a dictionary with multiple entries inside the one entry (‘event’) dictionary.
It’s too bad we can’t disable RSVP from the API as well. After creating my events, I’ll have to go back and disable the RSVP by hand.