function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
PolyglotPolyglot 

Tooling REST API - ApexCodeCoverage & ApexCodeCoverageAggregate

Can someone explain these two REST sObjects - maybe with an example?

In the documentation it lists these as sObjects, but when I try and invoke it using:

/services/data/v29.0/tooling/sobjects/ApexCodeCoverage/{id}   (where {id} is the ID of an Apex class)

I receive:

[{"message":"The requested resource does not exist","errorCode":"NOT_FOUND"}]; HTTP Status: 404

Also, in the documentation for ApexCodeCoverage, under Usage, it lists some SOQL queries.  So I'm confused - do you invoke the REST resource or invoke the query resource?
Ashish_SFDCAshish_SFDC
Hi , 


See the format below, 

/services/data/v29.0/tooling/sobjects/ApexCodeCoverage/classids=<ID>

/runTestsAsynchronous/?classids= <comma separated list of class IDs>
and
/runTestsSynchronous/?classnames= <comma separated list of class names>
GET
Executes the tests in the specified classes. Running tests asynchronously allows methods to process in parallel, cutting down your test run times.

http://www.salesforce.com/us/developer/docs/api_tooling/Content/intro_rest_overview.htm


Regards,
Ashish
Jon SnowJon Snow
The example of ApexCodeCoverage,the following post may explain it I suppose.
https://www.xgeek.net/salesforce/runtest-with-salesforce-rest-api/