---
title: "Get a placement's invocation code"
type: reference
method: GET
path: /rest-api/placements/{placementId}/invocation-code.do
tag: "Placements"
---

# Get a placement's invocation code

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

Returns the placement's invocation code of the given type, with its default invocation-code parameters applied. Unlike GET /rest-api/placement/{key}/code this is addressed by placement ID and checks access: it requires VIEW access to the placement's site and, for types that have one, the per-type invocation-code permission.

## Path params

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

## Query params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `type` | string | yes | `AJAX` | Invocation code type: IFRAME_SIMPLE, VIDEO_PLAYER, API, DIRECT_URL, EMAIL, AJAX or JS_MOUNT |

## Responses

- `200` — {success, type, code}
- `400` — Unknown code type
- `401` — Authentication error
- `403` — No VIEW access to the site, or the code type is not available to the caller 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/invocation-code.do?type=AJAX' \
  --header 'X-Api-Key: YOUR_API_KEY'
```

Source: https://epom.com/ad-server/docs/api/placements/get-placements-invocation-code