Tuesday, March 31, 2015

Tooling API Overview

Tooling API provides SOAP and REST interfaces that allow you to build custom development tools for Force.com applications. For example, you can:
  • Add features and functionality to your existing Force.com tools.
  • Build dynamic modules for Force.com development into your enterprise integration tools.
  • Build specialized development tools for a specific application or service.

Tooling API exposes objects used in developer tooling that you can access through REST or SOAP, and works just like the Salesforce REST API and SOAP API.

Tooling API provides both SOAP and REST interfaces.
  • Use REST API if you’re using a language that isn’t strongly typed, like JavaScript.
  • Use SOAP API if you’re using a strongly typed language like Java that generates Web service client code. 

Tooling REST API

The base URI for each Tooling REST API resource is http://domain/services/data/vXX.X/tooling/ where domain is a Salesforce instance or a custom domain and vXX.X is the API version number. For example: http://na1.salesforce.com/services/data/v28.0/tooling/

For complete list of Tooling API resources, refer below URL:

Available Custom Objects using tooling API

If you have to find out all available custom objects in your org, then use below code sample :

Available Validation Rules using Tooling API

Below apex code will give all validation rules in your organization:

Tooling API can be used to perform the following tasks

  • Manage working copies of Apex classes and triggers and Visualforce pages and components using the ApexClassMember, ApexTriggerMember, ApexPageMember, ApexComponentMember and MetadataContainer objects.
  • Manage working copies of static resource files using the StaticResource object.
  • Check for updates and errors in working copies of Apex classes and triggers and Visualforce pages and components, and commit changes to your organization using the containerAsyncRequest object.
  • Execute anonymous Apex. 
  • Manage custom fields on custom objects using the CustomField object.
  • Access code coverage results using the ApexCodeCoverage, ApexOrgWideCoverage and ApexCodeCoverageAggregate objects.
  • Execute tests, and manage test results using the ApexTestQueueItem and ApexTestResult objects.
  • Manage validation rules and workflow rules using the ValidationRule and WorkflowRule objects.

No comments:

Post a Comment