I was working on a POC wherein I need to run apex code through ExecuteAnonymous API like Workbench does. I got stuck on this one as it was not a straight forward task and I spend some time on research so wanna share my research with you guys.
First of all, ExecuteAnonymous call is available through Apex API & Tooling API.
- Apex API is available through SOAP protocol.
- Tooling API is available through SOAP as well as REST.