---
title: "Get a shareable placement preview link"
type: reference
method: GET
path: /rest-api/placements/{placementId}/preview-link.do
tag: "Placements"
---

# Get a shareable placement preview link

`GET https://YOUR-NETWORK-DOMAIN/rest-api/placements/{placementId}/preview-link.do`

A link that renders the placement exactly as a visitor would see it, served with the given invocation code type. It needs no login, so it can be sent to anyone, and works for 30 days. url is built on the address this request reached the server on; path is the same link without it. servesOnlyWhileActive tells whether the placement, its zone and its site are all switched on - otherwise the preview shows no ad. Without codeType the link renders AJAX when the caller may generate it, else the first type the caller may that the console previews. Requires VIEW access to the placement's site and the invocation-code permission of the rendered type, the same the console's ad-tag card checks.

## Path params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `placementId` | integer | yes | `4001` | Placement ID |

## Query params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `codeType` | string | no | `AJAX` | Invocation code type: IFRAME_SIMPLE, VIDEO_PLAYER, API, DIRECT_URL, EMAIL, AJAX or JS_MOUNT — the tag the preview renders |

## Responses

- `200` — {success, placementId, path, url, codeType, servesOnlyWhileActive}
- `400` — Unknown code type, or one a placement of this type has no code of
- `401` — Authentication error
- `403` — No VIEW access to the placement's site, or the role may not generate the code type (or, without codeType, any type) for this placement
- `404` — Placement, its zone or its site not found or deleted

## Example request

```bash
curl --request GET \
  --url 'https://YOUR-NETWORK-DOMAIN/rest-api/placements/4001/preview-link.do?codeType=AJAX' \
  --header 'X-Api-Key: YOUR_API_KEY'
```

Source: https://epom.com/ad-server/docs/api/placements/get-placements-preview-link