Loading

Using a web browser and REST client to help understand API usage

Udgivelsesdato: Aug 5, 2025
Opgave

GOAL

When working with API's it is sometimes useful to identify a working example. In some scenarios, working examples are not forthcoming. This procedure demonstrates how to identify web request functionality and then import the request samples into a tool for further inspection.

In the walkthrough, the example will demonstrate identifying a MuleSoft API call within the Anypoint Platform that allows us to inspect the application status. You will need to have access to view Runtime Manager for this example. 

This example uses Google Chrome and Postman which are third-party products. MuleSoft does not provide technical support for these products. 
Trin
The first step is to use a browser to identify the web request that you would like to use. This is typically done by identifying functionality in a website that provides the information that you are hoping to use. When requests are made by client-side scripts the request and response can be captured. 
  1. Open Google Chrome
  2. Navigate to https://anypoint.mulesoft.com and log in. 
  3. Access Runtime Manager
  4. Open the Developer tools window in Google Chrome (View -> Developer -> Developer Tools) 
  5. Select the "Network Tab" to show the web requests that are being displayed on the browser
  6. At this point, your window should look similar to this. You can change the window layout using the options provided in the menu (⋮) 
A screenshot showing Chrome with the Developer Console open while accessing Runtime Manager

At this point, we can see that there are web requests being shown in the Console. We are interested in determining the API that shows the status of our applications. 
  1. We can identify the correct request by looking at the name of the request. There are filtering and searching tools that can help with this process also.
  2. In this case, we are going to select the applications request and check the response contains the information we are after (which it does!)
A screenshot showing the response from a web request in Chrome developer tools

Now that we have successfully identified the web request, we need to export this request.
  1. Right click on the web request you wish to export. 
  2. Select the "Copy" -> "Copy as cURL" (Note: Windows environments will show two options here, "cmd" and "bash", either are fine for this procedure)
  3. This procedure will copy the web request onto your system clipboard (Copy and Paste clipboard).
copying a webreuset as a curl query
 
We can run what is available on our clipboard from the command line in systems that have the curl command installed and this is often a useful approach, however as you will see shortly, the browser request contains additional headers that are simply not required, or helpful for us when understanding how to use an API. At this stage, we can use Postman to provide a friendly GUI to work with the API. 
  1. Open Postman
  2. Select the "Import" button from the main window. This will bring up the Import dialog.
  3. In the Import dialogue, select the "Paste as Raw Text" open, and paste the cURL request from the previous task. 
  4. Once pasted, click the orange import button shown within the dialogue. 
Postman showing the import dialogue and the cURL command from Chrome browser

Once the cURL request is imported, you will be able to execute the request from Postman, an example is shown below, which shows the API result from calling the curl URL.
postman showing a successful web request

This procedure does not need to be limited to Anypoint API requests. We do recommend that only API's which are documented are used (to ensure that only publicized API's with a release management cycle are used). Additionally, some API's require authorisation. This example uses the existing token from the browser, however, these will expire. Review the How to generate your Authorization Bearer token for Anypoint Platform for guidance with this. 
 
Vidensartikelnummer

001114991

 
Indlæser
Salesforce Help | Article