1. Home
  2. Tutorials
  3. Working with APIs
  4. Display an Image from an API Response

Display an Image from an API Response

If your API response includes the URLs for images you want to display in your app, you can do so using request Events. The process is slightly different from displaying other API data, as you need to specify that the app should load the images from the Web when the response data is received.

ⓘ Note

To display images from URLs that are inside an array in your response, see Display Images from an API Array instead.

With the request added to a page in your app and an Image Element on the page:

  1. Open the request in the API tab on the right of the editor.
  2. Select the Events section. You should see an Event for each status code that the API returns.
  3. Open the Event for the status code your image URL is associated with (typically it will be 200: OK).
  4. Click the plus plus button and select the Display Image from URL Action to add it. Click Edit.
    • In the first input, select the Image Element you added to the page. select image element
    • In the second input, select the URL from the API response in the Event Data container. select image url

    Save the Action.

When the app runs and the API response is received, the image will load into the Element from the URL. Remember to use a Run API Request Action to execute the request.

Was this article helpful to you? Yes No

How can we help?