Tool Window for "REST Explorer" to execute against REST API of a selected Org

Issue #1789 new
Kris Goncalves created an issue

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)

  1. Kris Goncalves reporter

    That’s great, thanks for that. The only pain is that System.debug(UserInfo.getSessionId()); gets removed in the debug logs as SESSION_ID_REMOVED. Otherwise, it works quite nicely and can add a default .http file where one just needs to change the URL and Authorization

  2. Scott Wells 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.

  3. Scott Wells repo owner

    There probably won't be real traction on this until after the new year, but I have two ideas on this:

    1. 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.
    2. 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.

  4. Justin Julicher

    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. 🙂

  5. Log in to comment