I have a task at hand that I am trying to figure out the best way to get done. In short I need to hit an external API, GotoWebinar to be exact. I need to retrieve a list of Webinar Sessions daily including the attendees and some performance metrics as well.
To start testing I wrote a class that does the following.
- Get a list of GotoSessions (API Call) and insert them into a custom object.
- Lop through the sessions and get a list of attendees (Another API call) and insert them into a custom object
- Loop through the sessions and get the performance (Another API call).
- Update the Attendee & Performance custom object with the session ID so that related lists populate for each session.
So far in testing this is working fine but I want to know the best way to automate this daily. I have been reading about scheduled APEX, Batch APEX, @future, Queable APEx... and I am not sure what is the best way to implement this?
My thoughts are maybe, have a Queable APEX to go get the records from GotoAPI and then an APEX trigger on the Attendee & Performance object that updated the sessionID when they get created?
Hope that is enough info to start with. I am a decent coder in Java & C# so APEX has not been bad but I am struggling with how to do things the "right" way...
Thanks in advance for any help!!!