Public class testapi{
   ToolingAPI toolingAPI = new ToolingAPI();
   List<ToolingAPI.CustomObject> customObjects = (List<ToolingAPI.CustomObject>) toolingAPI.query(
   'Select Id, DeveloperName, NamespacePrefix From'+
   'CustomObject Where NamespacePrefix = \'c\''

I am not able to save this code it is coming :

Invalid type: ToolingAPI

kindly help me to resolve the issue

  • 1
    I am not able to see ToolingAPI object definition anywhere in Salesforce developer documentation. Is it coming from some other Managed package which you missed to install ? or Please point me to the documenation you are referring Feb 25, 2016 at 7:57
  • I am referring some blogs and try to create it.andyinthecloud.com/category/tooling-api Feb 25, 2016 at 8:00
  • whether i need to use rest callout to implement this code or we can directly in the apex Feb 25, 2016 at 8:02

1 Answer 1


Short Answer: https://githubsfdeploy.herokuapp.com/?owner=afawcett&repo=apex-toolingapi

Long Answer:

You are missing the required Package https://github.com/afawcett/apex-toolingapi. This is the package which contains the ToolingAPI class.




I tried all the steps above in my org and finally tried your snippet and it works fine.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .