Tool Window for "REST Explorer" to execute against REST API of a selected Org
Similar to workbench, where you’re able to executer against the REST API and get responses - It’d be great to have a tool window like that baked into the IDE as you may find yourself quickly wanting to test out an endpoint.
Comments (10)
-
repo owner -
reporter That’s great, thanks for that. The only pain is that
System.debug(UserInfo.getSessionId());
gets removed in the debug logs asSESSION_ID_REMOVED
. Otherwise, it works quite nicely and can add a default .http file where one just needs to change the URL and Authorization -
repo owner Hah! I forgot about that (somewhat recent) change. Maybe I'll see if there's an easy way for me to have IC augment the base IDE's REST tool with the connection's current session ID. I'll take a look.
-
repo owner There probably won't be real traction on this until after the new year, but I have two ideas on this:
- It appears that the REST client is (slightly) extensible. I still need to investigate exactly what can be done, but I'm going to see whether I can add new actions/templates to create Salesforce-specific REST requests with the path, authentication header, etc., all pre-configured based on the project's connection.
- Whether that works or not, I'll also see if I can add code completions for the URL stems of the key Salesforce REST APIs and for key context information, specifically the session ID(s) for the project connection(s).
Hopefully that will make it quite simple to execute the Salesforce REST APIs from the IDE.
-
An alternative to get the session Id from the log:
String sessionId = UserInfo.getSessionId(); sessionId = sessionId.right(sessionId.length()-1); System.debug(sessionId);
Just prefix a ‘0' onto the output and that’ll get you a complete sessionId.
-
repo owner - removed version
- changed component to Other Editor
-
repo owner - changed component to Salesforce Integration
-
repo owner Issue
#2014was marked as a duplicate of this issue. -
repo owner - changed component to Salesforce Packaging
-
repo owner - changed component to Salesforce Feature Integration
- Log in to comment
FYI, the (commercial) JetBrains IDEs already include a powerful REST client:
https://www.jetbrains.com/help/idea/testing-restful-web-services.html
All you'd need to do is get your session ID using
System.debug(UserInfo.getSessionId());
and add that as the authorization header for these requests.