Skip to main content
1 of 3
Needhi S
  • 120
  • 12

Access SymbolTable methods field using Rest Tooling API

String endpointUrl = URL.getSalesforceBaseUrl().toExternalForm() + '/services/data/v38.0/tooling/query/?q=Select+Id,Name,SymbolTable,Body+From+ApexClass+where+Id= Apex class salesforce id';

I am able to get following information through above query using tooling api :

SymbolTable={constructors=(), externalReferences=(), id=01p2800000E0Fc2AAF, innerClasses=(), interfaces=(), key=01p2800000E0Fc2AAF, methods=({annotations=(), location={column=41, line=4}, modifiers=(static, public), name=getItems, parameters=(), references=(), returnType=LIST, type=null}, {annotations=(), location={column=35, line=12}, modifiers=(static, public), name=saveItem, parameters=({name=item, type=Camping_Item__c}), references=(), returnType=Camping_Item__c, type=null}), name=CampingListController, namespace=null, parentClass=, ...},

I want to fetch symbol Table field methods explicitly to know the methods in apex class and its parameters. Any idea how to parse the SymbolTable fields?

Needhi S
  • 120
  • 12