<commit_before>---
layout: documentation
categories:
- documentation
- publish
---

# Publish API

Use the Publish API to publish events, venues and attractions. The API provides the opportunity to make your events, venues and attractions available within the Discovery API.
{: .lead .article}

#### Developer Console
{: .aside .gray}

Make live API calls right now in the interactive docs:

[INTERACTIVE DOCS](/products-and-docs/apis/interactive-console/){: .button}

## Overview
{: .article #overview }

### Authentication

To run a successful API call, you will need to pass your API Key as the query parameter  __apikey__.

Example: `https://app.ticketmaster.com/publish/v2/events?apikey=<KEY>`

### Root URL

`https://app.ticketmaster.com/publish/{API version}`


## Publish Events
{: .article #publish-events }

**Method:** POST.
Authentication required.
Publish events accessible within the Discovery API.

publish/{version}/events
{: .code .red}

### URL parameters:

| Parameter  | Description          | Type              | Default Value      | Required |
|:-----------|:---------------------|:----------------- |:------------------ |:-------- |
| `version` | The API Version.     | string            |       "v2"         | Yes      |

### Exemple of a minimal recommended request payload
{% highlight http %}
{
    "source" : {
        "id" : "test_id_0009",
        "name" : "test-source"
    },
    "test": true,
    "names": {
        "en-us": "example test event tnt1"
    },
    "publicVisibility": {
        "startDateTime": "2015-10-29T15:00:00Z",
        "visible": true
    },
    "dates": {
        "start": {
            "dateTime": "2016-04-15T01:00:00Z",
            "localDate": "2016-04-14",
            "localTime": "19:00:00"
        },
        "timezone": "America/Edmonton"
    },
    "venue": {
        "source" : {
            "id" : "test_venue_id_0001",
            "name" : "test-source"
        },
        "test": true,
        "currency": "USD",
        "country": {
            "countryCode": "US"
        }
    }
}
{% endhighlight %}

### Full request payload documentation

{: .nested-list}
- `additionalInfos` (object) - map of locale to value for any additional informations on the event.
- `attractions` (array) - list of attractions in the event.
    * `additionalInfos` (object) - map of locale to value for any additional informations on the attraction.
    * `descriptions` (object) - map of locale to value for the description of the attraction.
    * `id` (string) - the id of the attraction as returned by the Discovery API. If specified, all the other fields of the attraction will be ignored. Otherwise, a new attraction is created and embedded into the event.
    * `images` (array) - list of images of the attraction.
        - `height` (number) - the height of the image.
        - `ratio` (string) - the ratio of the image ex.: 3x2, 16x9, ...
        - `url` (string) - the URL of the image.
        - `width` (number) - the width of the image.
    * `names` (object) - map of locale to value for the names of the attraction.
    * `redirectUrl` (string) - the URL of the attraction on the publisher's site.
    * `source` (object) - the id and source name of the attraction. Must be specified if `id` is not.
        - `id` (string) - the publisher's id of the attraction.
        - `name` (string) - the publisher's name.
    * `test` (boolean) - true if this is a test attraction data, false otherwise (real attraction).
    * `version` (number) - the publisher's version for this attraction.
- `dates` (object) - all the dates related to the event.
    * `start` (object) - the start date of the event.
        - `localDate` (string) - the start date in the event timezone.<commit_msg>Mod: response highlight<commit_after>---
layout: documentation
categories:
- documentation
- publish
---

# Publish API

Use the Publish API to publish events, venues and attractions. The API provides the opportunity to make your events, venues and attractions available within the Discovery API.
{: .lead .article}

#### Developer Console
{: .aside .gray}

Make live API calls right now in the interactive docs:

[INTERACTIVE DOCS](/products-and-docs/apis/interactive-console/){: .button}

## Overview
{: .article #overview }

### Authentication

To run a successful API call, you will need to pass your API Key as the query parameter  __apikey__.

Example: `https://app.ticketmaster.com/publish/v2/events?apikey=<KEY>`

### Root URL

`https://app.ticketmaster.com/publish/{API version}`


## Publish Events
{: .article #publish-events }

**Method:** POST.
Authentication required.
Publish events accessible within the Discovery API.

publish/{version}/events
{: .code .red}

### URL parameters:

| Parameter  | Description          | Type              | Default Value      | Required |
|:-----------|:---------------------|:----------------- |:------------------ |:-------- |
| `version` | The API Version.     | string            |       "v2"         | Yes      |

### Exemple of a minimal recommended request payload

{% highlight HTTP %}
HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8

{
  "url": "/Madonna-tickets/artist/768011",
  "image":  {
    "url": "/dbimages/213810a.jpg"
  },
  "name": "Madonna",
  "locale": "en-us",
  "_links":  {
    "self":  {
      "href": "/discovery/v1/attractions/768011?locale=en-us&domain=ticketmaster.com"
    }
  },
  "id": "768011",
  "type": "attraction"
}

{
  "source" : {
    "id" : "test_id_0009",
    "name" : "test-source"
  },
  "test": true,
  "names": {
    "en-us": "example test event tnt1"
  },
  "publicVisibility": {
    "startDateTime": "2015-10-29T15:00:00Z",
    "visible": true
  },
  "dates": {
    "start": {
      "dateTime": "2016-04-15T01:00:00Z",
      "localDate": "2016-04-14",
      "localTime": "19:00:00"
    },
    "timezone": "America/Edmonton"
  },
  "venue": {
    "source" : {
      "id" : "test_venue_id_0001",
      "name" : "test-source"
    },
    "test": true,
    "currency": "USD",
    "country": {
      "countryCode": "US"
    }
  }
}
{% endhighlight %}

### Full request payload documentation

{: .nested-list}
- `additionalInfos` (object) - map of locale to value for any additional informations on the event.
- `attractions` (array) - list of attractions in the event.
    * `additionalInfos` (object) - map of locale to value for any additional informations on the attraction.
    * `descriptions` (object) - map of locale to value for the description of the attraction.
    * `id` (string) - the id of the attraction as returned by the Discovery API. If specified, all the other fields of the attraction will be ignored. Otherwise, a new attraction is created and embedded into the event.
    * `images` (array) - list of images of the attraction.
        - `height` (number) - the height of the image.
        - `ratio` (string) - the ratio of the image ex.: 3x2, 16x9, ...
        - `url` (string) - the URL of the image.
        - `width` (number) - the width of the image.
    * `names` (object) - map of locale to value for the names of the attraction.
    * `redirectUrl` (string) - the URL of the attraction on the publisher's site.
    * `source` (object) - the id and source name of the attraction. Must be specified if `id` is not.
        - `id` (string) - the publisher's id of the attraction.
        - `name` (string) - the publisher's name.
    * `test` (boolean) - true if this is a test attraction data, false otherwise (real attraction).
    * `version` (number) - the publisher's version for this attraction.
- `dates` (object) - all the dates related to the event.
    * `start` (object) - the start date of the event.
        - `localDate` (string) - the start date in the event timezone.
{'fraction_non_alphanumeric': 0.1503672207189795, 'fraction_numerical': 0.018940858136838035, 'mean_word_length': 2.563820018365473, 'pattern_counts': {'":': 44, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4997730', 'n_tokens_mistral': 2435, 'n_tokens_neox': 2290, 'n_words': 819}