---
schema_version: "1"
id: 4edad54a0f9620541990bc6bd7d537b6385bda6d5bceedc59f34da37e07da0e3
title: ContentImagebyID
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/guides/mc-programmatic-content/ssjs_platformContentContentImageByID.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_platformContentContentImageByID.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 95af05c365b0c78558885399c1dc6fe9029e45be8720186c5edc01feba7abd09
products:
  - Marketing Cloud Engagement APIs and Programmatic Languages
  - Marketing Cloud
---
# ContentImagebyID

## Overview

Returns an img tag with the src attribute containing the path to an image from Content Builder. Identify the image to include with the ID value. The img tag includes the title and alt information for the selected image, as well as a border value, measured in pixels, and any identified thid value. If the value of the first parameter does not link to a valid image, you can include another image value for the second parameter as a default option.

### Syntax

ContentImagebyID(1, 2)

### Function Properties

<!--complex table-->

| Ordinal | Type   |              | Description                                                             |
| ------- | ------ | ------------ | ----------------------------------------------------------------------- |
| **1**   | string | **Required** | ID of image to return                                                   |
| **2**   | string | **Required** | Value used to return image if function can’t find the original image ID |

## Example

```
<script runat="server">
     var content = Platform.Function.ContentImagebyId("12345","defaultContentHere");
</script>
```
