I am using
Tooling Api to run the test in org for apex classes. Please help me with the query to callout
runTests() in RestAPI.
If you want to get the CodeCoverage for an Apex class you are going to need to run the corresponding test classes so the coverage can be calculated.
With the REST API, that means you will want the
The simplest approach will be to use that resource with the testLevel of RunLocalTests. That will run all the tests in the org that don't come from managed packages.
Getting more fine grained control of which tests classes give coverage of what classes is a much more complicated question. Easier to just run all the tests.