# Admedia API (V6) - POST (Create)

### Einleitung

To create ad media via an automated process rather than manually in the easy.affiliate system, easy Marketing GmbH provides a web service API. For this purpose, each user has an **Authentication Token** and a **Login ID** available, which are provided via the frontend.

- **User ID:** Where is the User ID stored? (See frontend profile)
- **Access Token:** Where is the Access Token stored? (See API settings)

### Endpoints

- **Endpoint for Admin:** `https://SUBDOMAIN.de/ws/V6/admin/JSON/Admedia`
- **Endpoint for Advertiser:** `https://SUBDOMAIN.de/ws/V6/advertiser/JSON/Admedia`

---

### Example with cURL

<div _ngcontent-ng-c1630465722="" class="code-block ng-tns-c1630465722-136 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation" id="bkmrk-bash" jslog="223238;track:impression,attention;BardVeMetadataKey:[[&quot;r_98fea8d792c99e53&quot;,&quot;c_5229d7aaa2a28b5d&quot;,null,&quot;rc_d6ce4684816cf8e3&quot;,null,null,&quot;en&quot;,null,1,null,null,1,0]]"><div _ngcontent-ng-c1630465722="" class="code-block-decoration header-formatted gds-title-s ng-tns-c1630465722-136 ng-star-inserted"><span class="ng-tns-c1630465722-136">Bash</span><div _ngcontent-ng-c1630465722="" class="buttons ng-tns-c1630465722-136 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-136 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-136 mat-unthemed ng-star-inserted"></button></div></div><div _ngcontent-ng-c1630465722="" class="formatted-code-block-internal-container ng-tns-c1630465722-136"><div _ngcontent-ng-c1630465722="" class="animated-opacity ng-tns-c1630465722-136"></div></div></div>

```
curl -X POST -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" -d "$EXAMPLE_JSON_DATA" https://DOMAIN/ws/V6/admin/JSON/Admedia

```

<div _ngcontent-ng-c1630465722="" class="code-block ng-tns-c1630465722-136 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation" id="bkmrk--2" jslog="223238;track:impression,attention;BardVeMetadataKey:[[&quot;r_98fea8d792c99e53&quot;,&quot;c_5229d7aaa2a28b5d&quot;,null,&quot;rc_d6ce4684816cf8e3&quot;,null,null,&quot;en&quot;,null,1,null,null,1,0]]"><div _ngcontent-ng-c1630465722="" class="formatted-code-block-internal-container ng-tns-c1630465722-136"><div _ngcontent-ng-c1630465722="" class="animated-opacity ng-tns-c1630465722-136"></div></div></div>### Code Example

Ad media can be created using the following format. An example request looks like this:

**Headers:**

<div _ngcontent-ng-c1630465722="" class="code-block ng-tns-c1630465722-137 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation" id="bkmrk-http" jslog="223238;track:impression,attention;BardVeMetadataKey:[[&quot;r_98fea8d792c99e53&quot;,&quot;c_5229d7aaa2a28b5d&quot;,null,&quot;rc_d6ce4684816cf8e3&quot;,null,null,&quot;en&quot;,null,1,null,null,1,0]]"><div _ngcontent-ng-c1630465722="" class="code-block-decoration header-formatted gds-title-s ng-tns-c1630465722-137 ng-star-inserted"><span class="ng-tns-c1630465722-137">HTTP</span><div _ngcontent-ng-c1630465722="" class="buttons ng-tns-c1630465722-137 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-137 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-137 mat-unthemed ng-star-inserted"></button></div></div><div _ngcontent-ng-c1630465722="" class="formatted-code-block-internal-container ng-tns-c1630465722-137"><div _ngcontent-ng-c1630465722="" class="animated-opacity ng-tns-c1630465722-137"></div></div></div>

```
Content-Type: application/json
X-Network-ID: -1
X-Auth-Token: ADMIN_APIUSER_TOKEN
X-Auth-ID: ADMIN_APIUSER_LOGIN_ID

```

<div _ngcontent-ng-c1630465722="" class="code-block ng-tns-c1630465722-137 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation" id="bkmrk--5" jslog="223238;track:impression,attention;BardVeMetadataKey:[[&quot;r_98fea8d792c99e53&quot;,&quot;c_5229d7aaa2a28b5d&quot;,null,&quot;rc_d6ce4684816cf8e3&quot;,null,null,&quot;en&quot;,null,1,null,null,1,0]]"><div _ngcontent-ng-c1630465722="" class="formatted-code-block-internal-container ng-tns-c1630465722-137"><div _ngcontent-ng-c1630465722="" class="animated-opacity ng-tns-c1630465722-137"></div></div></div>**Body:**

<div _ngcontent-ng-c1630465722="" class="code-block ng-tns-c1630465722-138 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation" id="bkmrk-json" jslog="223238;track:impression,attention;BardVeMetadataKey:[[&quot;r_98fea8d792c99e53&quot;,&quot;c_5229d7aaa2a28b5d&quot;,null,&quot;rc_d6ce4684816cf8e3&quot;,null,null,&quot;en&quot;,null,1,null,null,1,0]]"><div _ngcontent-ng-c1630465722="" class="code-block-decoration header-formatted gds-title-s ng-tns-c1630465722-138 ng-star-inserted"><span class="ng-tns-c1630465722-138">JSON</span><div _ngcontent-ng-c1630465722="" class="buttons ng-tns-c1630465722-138 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-138 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-138 mat-unthemed ng-star-inserted"></button></div></div><div _ngcontent-ng-c1630465722="" class="formatted-code-block-internal-container ng-tns-c1630465722-138"><div _ngcontent-ng-c1630465722="" class="animated-opacity ng-tns-c1630465722-138"></div></div></div>

```
{
    "campaign_id": 1,
    "project_ids": [50012],
    "title": "Ad Media Title",
    "deeplink": "https://example.de/link",
    "category_id": 5,
    "mediatype": "text",
    "linktext": "Click here",
    "status": 1
}

```

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

### Parameter Explanations

#### Headers

<table data-path-to-node="20" id="bkmrk-variable-meaning-dat"><thead><tr><td>**Variable**</td><td>**Meaning**</td><td>**Data Type**</td></tr></thead><tbody><tr><td><span data-path-to-node="20,1,0,0">**Content-Type**</span></td><td><span data-path-to-node="20,1,1,0">The Content-Type of the request</span></td><td><span data-path-to-node="20,1,2,0">String</span></td></tr><tr><td><span data-path-to-node="20,2,0,0">**X-Network-ID**</span></td><td><span data-path-to-node="20,2,1,0">The client (tenant) ID or <code>&#45;1</code></span></td><td><span data-path-to-node="20,2,2,0">Integer</span></td></tr><tr><td><span data-path-to-node="20,3,0,0">**X-Auth-Token**</span></td><td><span data-path-to-node="20,3,1,0">The API authentication token of the admin user</span></td><td><span data-path-to-node="20,3,2,0">String</span></td></tr><tr><td><span data-path-to-node="20,4,0,0">**X-Auth-ID**</span></td><td><span data-path-to-node="20,4,1,0">The ID of the admin user</span></td><td><span data-path-to-node="20,4,2,0">Integer</span></td></tr></tbody></table>

#### Body

<table data-path-to-node="22" id="bkmrk-parameter-explanatio-1"><thead><tr><td>**Parameter**</td><td>**Explanation**</td><td>**Data Type**</td><td>**Required**</td></tr></thead><tbody><tr><td><code>&#60;span data&#45;path&#45;to&#45;node&#61;&#34;22&#44;1&#44;0&#44;0&#34;&#62;&#60;strong data&#45;index&#45;in&#45;node&#61;&#34;0&#34; data&#45;path&#45;to&#45;node&#61;&#34;22&#44;1&#44;0&#44;0&#34;&#62;campaign&#95;id&#60;&#47;strong&#62;&#60;&#47;span&#62;</code></td><td><span data-path-to-node="22,1,1,0">ID of the campaign</span></td><td><span data-path-to-node="22,1,2,0">Integer</span></td><td><span data-path-to-node="22,1,3,0">Yes</span></td></tr><tr><td><code>&#60;span data&#45;path&#45;to&#45;node&#61;&#34;22&#44;2&#44;0&#44;0&#34;&#62;&#60;strong data&#45;index&#45;in&#45;node&#61;&#34;0&#34; data&#45;path&#45;to&#45;node&#61;&#34;22&#44;2&#44;0&#44;0&#34;&#62;project&#95;ids&#60;&#47;strong&#62;&#60;&#47;span&#62;</code></td><td><span data-path-to-node="22,2,1,0">Whitelist of project IDs</span></td><td><span data-path-to-node="22,2,2,0">JSON Array</span></td><td><span data-path-to-node="22,2,3,0">No</span></td></tr><tr><td><code>&#60;span data&#45;path&#45;to&#45;node&#61;&#34;22&#44;3&#44;0&#44;0&#34;&#62;&#60;strong data&#45;index&#45;in&#45;node&#61;&#34;0&#34; data&#45;path&#45;to&#45;node&#61;&#34;22&#44;3&#44;0&#44;0&#34;&#62;title&#60;&#47;strong&#62;&#60;&#47;span&#62;</code></td><td><span data-path-to-node="22,3,1,0">Title of the ad media</span></td><td><span data-path-to-node="22,3,2,0">String</span></td><td><span data-path-to-node="22,3,3,0">Yes</span></td></tr><tr><td><code>&#60;span data&#45;path&#45;to&#45;node&#61;&#34;22&#44;4&#44;0&#44;0&#34;&#62;&#60;strong data&#45;index&#45;in&#45;node&#61;&#34;0&#34; data&#45;path&#45;to&#45;node&#61;&#34;22&#44;4&#44;0&#44;0&#34;&#62;deeplink&#60;&#47;strong&#62;&#60;&#47;span&#62;</code></td><td><span data-path-to-node="22,4,1,0">Deeplink of the ad media</span></td><td><span data-path-to-node="22,4,2,0">String</span></td><td><span data-path-to-node="22,4,3,0">Yes</span></td></tr><tr><td><code>&#60;span data&#45;path&#45;to&#45;node&#61;&#34;22&#44;5&#44;0&#44;0&#34;&#62;&#60;strong data&#45;index&#45;in&#45;node&#61;&#34;0&#34; data&#45;path&#45;to&#45;node&#61;&#34;22&#44;5&#44;0&#44;0&#34;&#62;category&#95;id&#60;&#47;strong&#62;&#60;&#47;span&#62;</code></td><td><span data-path-to-node="22,5,1,0">ID of the category</span></td><td><span data-path-to-node="22,5,2,0">Integer</span></td><td><span data-path-to-node="22,5,3,0">Yes</span></td></tr><tr><td><code>&#60;span data&#45;path&#45;to&#45;node&#61;&#34;22&#44;6&#44;0&#44;0&#34;&#62;&#60;strong data&#45;index&#45;in&#45;node&#61;&#34;0&#34; data&#45;path&#45;to&#45;node&#61;&#34;22&#44;6&#44;0&#44;0&#34;&#62;click&#95;tracking&#95;getparameter&#60;&#47;strong&#62;&#60;&#47;span&#62;</code></td><td><span data-path-to-node="22,6,1,0">Click tracking parameters</span></td><td><span data-path-to-node="22,6,2,0">String</span></td><td><span data-path-to-node="22,6,3,0">No</span></td></tr><tr><td><code>&#60;span data&#45;path&#45;to&#45;node&#61;&#34;22&#44;7&#44;0&#44;0&#34;&#62;&#60;strong data&#45;index&#45;in&#45;node&#61;&#34;0&#34; data&#45;path&#45;to&#45;node&#61;&#34;22&#44;7&#44;0&#44;0&#34;&#62;valid&#95;from&#60;&#47;strong&#62;&#60;&#47;span&#62;</code></td><td><span data-path-to-node="22,7,1,0">"Valid from" date</span></td><td><span data-path-to-node="22,7,2,0">String</span></td><td><span data-path-to-node="22,7,3,0">No</span></td></tr><tr><td><code>&#60;span data&#45;path&#45;to&#45;node&#61;&#34;22&#44;8&#44;0&#44;0&#34;&#62;&#60;strong data&#45;index&#45;in&#45;node&#61;&#34;0&#34; data&#45;path&#45;to&#45;node&#61;&#34;22&#44;8&#44;0&#44;0&#34;&#62;valid&#95;until&#60;&#47;strong&#62;&#60;&#47;span&#62;</code></td><td><span data-path-to-node="22,8,1,0">"Valid until" date</span></td><td><span data-path-to-node="22,8,2,0">String</span></td><td><span data-path-to-node="22,8,3,0">No</span></td></tr><tr><td><code>&#60;span data&#45;path&#45;to&#45;node&#61;&#34;22&#44;9&#44;0&#44;0&#34;&#62;&#60;strong data&#45;index&#45;in&#45;node&#61;&#34;0&#34; data&#45;path&#45;to&#45;node&#61;&#34;22&#44;9&#44;0&#44;0&#34;&#62;mediatype&#60;&#47;strong&#62;&#60;&#47;span&#62;</code></td><td><span data-path-to-node="22,9,1,0">Type of ad media (e.g., <code>text</code>, <code>banner</code>)</span></td><td><span data-path-to-node="22,9,2,0">String</span></td><td><span data-path-to-node="22,9,3,0">Yes</span></td></tr><tr><td><code>&#60;span data&#45;path&#45;to&#45;node&#61;&#34;22&#44;10&#44;0&#44;0&#34;&#62;&#60;strong data&#45;index&#45;in&#45;node&#61;&#34;0&#34; data&#45;path&#45;to&#45;node&#61;&#34;22&#44;10&#44;0&#44;0&#34;&#62;linktext&#60;&#47;strong&#62;&#60;&#47;span&#62;</code></td><td><span data-path-to-node="22,10,1,0">Link text</span></td><td><span data-path-to-node="22,10,2,0">String</span></td><td><span data-path-to-node="22,10,3,0">Yes, if type is <code>text</code></span></td></tr><tr><td><code>&#60;span data&#45;path&#45;to&#45;node&#61;&#34;22&#44;11&#44;0&#44;0&#34;&#62;&#60;strong data&#45;index&#45;in&#45;node&#61;&#34;0&#34; data&#45;path&#45;to&#45;node&#61;&#34;22&#44;11&#44;0&#44;0&#34;&#62;imageurl&#60;&#47;strong&#62;&#60;&#47;span&#62;</code></td><td><span data-path-to-node="22,11,1,0">Image URL</span></td><td><span data-path-to-node="22,11,2,0">String</span></td><td><span data-path-to-node="22,11,3,0">Yes, if type is <code>banner</code></span></td></tr><tr><td><code>&#60;span data&#45;path&#45;to&#45;node&#61;&#34;22&#44;12&#44;0&#44;0&#34;&#62;&#60;strong data&#45;index&#45;in&#45;node&#61;&#34;0&#34; data&#45;path&#45;to&#45;node&#61;&#34;22&#44;12&#44;0&#44;0&#34;&#62;size&#95;width&#60;&#47;strong&#62;&#60;&#47;span&#62;</code></td><td><span data-path-to-node="22,12,1,0">Width of the banner</span></td><td><span data-path-to-node="22,12,2,0">String</span></td><td><span data-path-to-node="22,12,3,0">Yes, if type is <code>banner</code></span></td></tr><tr><td><code>&#60;span data&#45;path&#45;to&#45;node&#61;&#34;22&#44;13&#44;0&#44;0&#34;&#62;&#60;strong data&#45;index&#45;in&#45;node&#61;&#34;0&#34; data&#45;path&#45;to&#45;node&#61;&#34;22&#44;13&#44;0&#44;0&#34;&#62;size&#95;height&#60;&#47;strong&#62;&#60;&#47;span&#62;</code></td><td><span data-path-to-node="22,13,1,0">Height of the banner</span></td><td><span data-path-to-node="22,13,2,0">String</span></td><td><span data-path-to-node="22,13,3,0">Yes, if type is <code>banner</code></span></td></tr><tr><td><code>&#60;span data&#45;path&#45;to&#45;node&#61;&#34;22&#44;14&#44;0&#44;0&#34;&#62;&#60;strong data&#45;index&#45;in&#45;node&#61;&#34;0&#34; data&#45;path&#45;to&#45;node&#61;&#34;22&#44;14&#44;0&#44;0&#34;&#62;status&#60;&#47;strong&#62;&#60;&#47;span&#62;</code></td><td><span data-path-to-node="22,14,1,0">Status of the ad media</span></td><td><span data-path-to-node="22,14,2,0">Integer</span></td><td><span data-path-to-node="22,14,3,0">Yes</span></td></tr></tbody></table>

---

### Response

Upon successful creation, the API returns the following information as JSON:

- **Ad Media ID:** `Integer`
- **Ad Media Title:** `String`
- **Ad Media Category:** `String`
- **View Link:** `String`
- **Click Link:** `String`
- **View Link (Shortener):** `String`
- **Click Link (Shortener):** `String`
- **Adcode:** `String`