1

I'm trying to create an event and chain the participants creation using the REST API from python. My attempt goes like this:

import requests

params = {
 "key": "key",
 "api_key": "apikey",
 "json": 1,
 "sequential": 1,
 "entity": "Event",
 "action": "create",
 "title":"Test event",
 "start_date":20181005123600,
 "event_type_id":"Conference",
 "api.Participant.create": {"event_id":"$value.id","contact_id":"8","participant_status_id":"2"},
 "api.Participant.create.2": {"event_id":"$value.id","contact_id":"6","participant_status_id":"2"}
}

url = "some_url"
response = requests.post(url, params = params)

For some reason the event is created but the participants are not. Could anyone give me a hint about what's happening?

Thanks

  • Can you check CiviCRM logs if there are any errors? – Pradeep Nayak Oct 5 '18 at 11:05
  • Sorry, I don't have access to the CiviCRM server @PradeepNayak – JME Oct 5 '18 at 11:16
  • @JME If you don't have access to the server, it's probably best to stand up a demo server to test against. It's very difficult to troubleshoot such an issue without access to the logs. – Jon G - Megaphone Tech Oct 5 '18 at 12:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.