# Admedia API (V6) - GET (Read)

### Querying Generated Ad Media via the V6 REST-API

To ensure simple and efficient management of generated ad media, the V6 REST-API provides a query function. This feature allows users to retrieve relevant data regarding the ad media and their corresponding tracking links.

### Endpoint

- **For Admins:** `https://SUBDOMAIN.de/ws/V6/admin/JSON/Admedia`

### Required Parameters

- **campaign\_id:** ID of the respective campaign (**Mandatory**)
- **project\_id:** ID of the respective project (Optional)

---

### Example Request with cURL

<div _ngcontent-ng-c1630465722="" class="code-block ng-tns-c1630465722-149 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation" id="bkmrk-bash" jslog="223238;track:impression,attention;BardVeMetadataKey:[["r_065f91d4ef8af021","c_5229d7aaa2a28b5d",null,"rc_eaf189623487fc83",null,null,"en",null,1,null,null,1,0]]"><div _ngcontent-ng-c1630465722="" class="code-block-decoration header-formatted gds-title-s ng-tns-c1630465722-149 ng-star-inserted"><span class="ng-tns-c1630465722-149">Bash</span><div _ngcontent-ng-c1630465722="" class="buttons ng-tns-c1630465722-149 ng-star-inserted"><button aria-label="Code herunterladen" class="mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger download-button ng-tns-c1630465722-149 mat-unthemed ng-star-inserted"></button><button aria-label="Code kopieren" class="mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c1630465722-149 mat-unthemed ng-star-inserted"></button></div></div><div _ngcontent-ng-c1630465722="" class="formatted-code-block-internal-container ng-tns-c1630465722-149"><div _ngcontent-ng-c1630465722="" class="animated-opacity ng-tns-c1630465722-149"></div></div></div>```
curl -X GET -H "Content-Type: application/json" -H "X-Network-ID: -1" -H "X-Auth-Token: ADMIN_APIUSER_TOKEN" -H "X-Auth-ID: ADMIN_APIUSER_LOGIN_ID" https://DOMAIN/ws/V6/admin/JSON/Admedia?campaign_id=1&project_id=50001

```

<div _ngcontent-ng-c1630465722="" class="code-block ng-tns-c1630465722-149 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation" id="bkmrk--2" jslog="223238;track:impression,attention;BardVeMetadataKey:[["r_065f91d4ef8af021","c_5229d7aaa2a28b5d",null,"rc_eaf189623487fc83",null,null,"en",null,1,null,null,1,0]]"><div _ngcontent-ng-c1630465722="" class="formatted-code-block-internal-container ng-tns-c1630465722-149"><div _ngcontent-ng-c1630465722="" class="animated-opacity ng-tns-c1630465722-149"></div></div></div>---

### Expected Response

Upon a successful request, the API returns the following information about the ad media in JSON format:

- **id:** ID of the ad media (`Integer`)
- **title:** Title of the ad media (`String`)
- **campaign\_id:** ID of the assigned campaign (`Integer`)
- **project\_id:** ID of the assigned project (`Integer`, if provided)
- **clicklink:** Click link of the ad media (`String`)
- **viewlink:** View link of the ad media (`String`)
- **adcode:** JavaScript code / HTML code of the tracking link (`String`)

---

### 📘 Error Handling

- If the `campaign_id` is missing or invalid, an appropriate error message will be returned.
- If no data exists for the specified parameters, an empty dataset (array) will be returned.