# Schedule Endpoint

## Schedule

This endpoint returns information on all off the tee times of all the groups within a single tournament. This will return the tee times for all days of the tournament. It contains information on:

* Course
* Round
* Tee sequence
* Hole
* Start date and time
* Player and group number (and team number for Match Play tournaments.)

### Endpoint URL <a href="#endpoint-url" id="endpoint-url"></a>

Endpoint for tournament schedule: [https://dde-api.imggaming.com/golf/tournaments/{id}/schedule](https://dde-api.imggaming.com/golf/tournaments/%7Bid%7D/schedule)​To view a schedule, enter the ID of the event for example, the ID for BMW PGA Championship 2019 is 163, which will display the schedule for all 4 rounds. Note that you can pass ID as 1 to return sample data.

### Required Headers <a href="#required-headers" id="required-headers"></a>

| Key           | Value                                            |
| ------------- | ------------------------------------------------ |
| Accept        | application/vnd.imggaming.dde.api+json;version=1 |
| Content-Type  | application/json                                 |
| Authorization | Bearer eyvhaoudfgpdfgo\*                         |

\*Authorization header includes a truncated Bearer token, contact IMG for your auth token if you do not have.

### Request Parameters <a href="#request-parameters" id="request-parameters"></a>

This endpoint currently takes no request parameters, we aim to add them, and once we have they will be detailed here. It will be query-able by date and this doc will be updated when that is ready.

### Response Model <a href="#response-model" id="response-model"></a>

**Event Object**

<table data-header-hidden><thead><tr><th></th><th width="155"></th><th></th><th></th></tr></thead><tbody><tr><td>Field Name</td><td>Type</td><td>Description</td><td>Optional</td></tr><tr><td>date</td><td>date</td><td>The day that the round will be played for that group</td><td>​</td></tr><tr><td>round</td><td>int</td><td>The round that is being played for that group</td><td>​</td></tr><tr><td>hole</td><td>int</td><td>The hole in which the round is starting for that group</td><td>​</td></tr><tr><td>teeSeq</td><td>int</td><td>The sequence on the tee for that group</td><td>​</td></tr><tr><td>courseId</td><td>int</td><td>The ID of the course for the round for that group</td><td>​</td></tr><tr><td>courseName</td><td>string</td><td>The name of the course for the round for that group</td><td>​</td></tr><tr><td>status</td><td>string</td><td>The status of the round for that group. The values are either: NotStarted, InProgress or Finished.</td><td>​</td></tr><tr><td>matchType</td><td>string</td><td>"Strokeplay" or "Matchplay"</td><td>​</td></tr><tr><td>bookingStatus</td><td>string</td><td>If an end user has got a license for that group; always set to “Booked”</td><td>​</td></tr><tr><td>startTime</td><td>object</td><td>See object docs</td><td>​</td></tr><tr><td>group</td><td>object</td><td>See object docs</td><td>​</td></tr><tr><td>poolNo</td><td>int</td><td>[Optional] number of the pool the match is in</td><td>YES</td></tr></tbody></table>

````
```json
 {
        "bookingStatus": "Booked",
        "courseId": "162",
        "courseName": "Colonial Country Club",
        "date": "2023-05-26",
        "externalCourseId": "PGA-21",
        "group": {
            "groupNo": 33,
            "matchNo": null,
            "teams": [
                {
                    "orderOfPlayWithinGroup": 0,
                    "players": [
                        {
                            "country": "SWE",
                            "displayName": "Henrik Norlander",
                            "firstName": "Henrik",
                            "isAmateur": false,
                            "lastName": "Norlander",
                            "playerEuropeanTourId": "34964",
                            "playerId": 5933,
                            "playerLPGATourId": null,
                            "playerPGATourId": "30163",
                            "playerRandAId": null,
                            "status": "Entered"
                        }
                    ],
                    "teamNo": 106
                },
                {
                    "orderOfPlayWithinGroup": 1,
                    "players": [
                        {
                            "country": "USA",
                            "displayName": "Robby Shelton",
                            "firstName": "Robby",
                            "isAmateur": false,
                            "lastName": "Shelton",
                            "playerEuropeanTourId": null,
                            "playerId": 5938,
                            "playerLPGATourId": null,
                            "playerPGATourId": "46441",
                            "playerRandAId": null,
                            "status": "Entered"
                        }
                    ],
                    "teamNo": 2
                },
                {
                    "orderOfPlayWithinGroup": 2,
                    "players": [
                        {
                            "country": "USA",
                            "displayName": "Andrew Novak",
                            "firstName": "Andrew",
                            "isAmateur": false,
                            "lastName": "Novak",
                            "playerEuropeanTourId": "100860",
                            "playerId": 6044,
                            "playerLPGATourId": null,
                            "playerPGATourId": "51997",
                            "playerRandAId": null,
                            "status": "Entered"
                        }
                    ],
                    "teamNo": 10
                }
            ]
        },
        "groupId": 362401,
        "hole": 1,
        "matchType": "Strokeplay",
        "poolNo": null,
        "round": 2,
        "startTime": {
            "status": "StartsAt",
            "time": "12:42Z"
        },
        "status": "Finished",
        "teeSeq": 3
    }
```
````

**Start Time Object**

| Field Name | Type   | Description                                               |
| ---------- | ------ | --------------------------------------------------------- |
| status     | string | The status of the start time – e.g. ‘StartsAt’            |
| time       | date   | The time of the group are scheduled to start their round. |

```
 "startTime": {
            "status": "StartsAt",
            "time": "17:06Z"
        },
```

**Group Object**

| Field Name | Type   | Description                                                                                                       | Optional |
| ---------- | ------ | ----------------------------------------------------------------------------------------------------------------- | -------- |
| groupNo    | int    | The group’s number, an identifier for the group within that round.                                                |          |
| MatchNo    | int    | <p>For Match Play tournaments only</p><p><strong>When is Match Play tournament</strong> "matchNo" = "groupNo"</p> | **YES**  |
| teams      | object | see object doc                                                                                                    |          |

```
"group": {
            "groupNo": 11,
            "teams": [
            ],
            "matchNo": null
        },
```

**Teams Object**

| Field Name             | Type | Description                                                                                                               |
| ---------------------- | ---- | ------------------------------------------------------------------------------------------------------------------------- |
| teamNo                 | int  | The ID of the team within the Tournament                                                                                  |
| orderOfPlayWithinGroup | int  | The order within the Group (or Match for Match Play.) Useful for ordering the display name of the Teams on the Front End. |

```
"group": {
            "groupNo": 11,
            "teams": [
                {
                    "teamNo": 24,
                    "players": [
                        {
                        }
                    ],
                    "orderOfPlayWithinGroup": 0
                },
                {
                    "teamNo": 26,
                    "players": [
                        {
                        }
                    ],
                    "orderOfPlayWithinGroup": 1
                }
            ],
```

**Players Object**

| Field Name           | Type    | Description                                   |
| -------------------- | ------- | --------------------------------------------- |
| playerId             | int     | The ID of the player across the whole of Golf |
| displayName          | string  | The display name of the player                |
| playerPGATourId      | int     | Player's PGA tour Id (if relevant)            |
| playerRandAId        | int     | Players R\&A Id (if relevant)                 |
| playerEuropeanTourId |         | Player's European tour Id (if relevant)       |
| playerLPGATourId     | int     | Player's LPGA tour Id (if relevant)           |
| firstName            | string  | The first name of the player                  |
| lastName             | string  | The last name of the player                   |
| country              | string  | The country code of the player’s country      |
| isAmateur            | boolean | Is the player an amateur or not               |
| status               | string  | The player’s entry type into the tournament   |

```

 "players": [
                        {
                            "country": "USA",
                            "displayName": "Scott Piercy",
                            "firstName": "Scott",
                            "isAmateur": false,
                            "lastName": "Piercy",
                            "playerEuropeanTourId": "36202",
                            "playerId": 5009,
                            "playerLPGATourId": null,
                            "playerPGATourId": "25818",
                            "playerRandAId": null,
                            "status": "Entered"
                        }
                    ],

```

### Playoffs

During a playoff, the schedule will be used in the same way as before. The only way of discerning whether or not a scheduled round would be a play off would be to understand the round type from the isPlayOff is True from the Tournaments end point.
