Holiday Groups : Assigning, Removing, Viewing

Introduction

Holidays are stored in /holidays

Holiday Groups are in /holiday-groups

Assigning a holiday to a group

You form a POST JSON that identifies the ID of the holiday group, and an array of integer IDs of the holidays like this:

[POST] /holiday-groups/6/actions/add-holidays

{
  "id": "6",
  "holidays" : [7,9]
}

This adds holidays identified by IDs 7 and 9 to the holiday group identified by ID 6.

Removing a holiday from a group

You form a POST JSON that identifies the ID of the holiday group, and an array of integer IDs of the holidays to remove like this:

[POST] /holiday-groups/6/actions/remove-holidays

{
  "id": "6",
  "holidays" : [7,9]
}

This removes holidays identified by IDs 7 and 9 from the holiday group identified by ID 6.

Viewing Holidays assigned to a Holiday Group

You can’t include all holidays from a holiday group record when using the list view of /holiday-groups . You can however request the holiday group by its ID, and then include its relation list of holidays:

[GET] /holiday-groups/6?include=holidays

{
       "name": "Quebec Holiday Group",
       "isGlobal": false,
       "region": 7,
       "isDefault": false,
       "id": 6,
 ==>   "holidays": [
           {
               "label": "New Year's Day",
               "region": null,
               "code": "NY",
               "id": 1
           },
           {
               "label": "Martin Luther King Day",
               "region": null,
               "code": "MartLK",
               "id": 2
           },
           {
               "label": "President's Day",
               "region": null,
               "code": "PRED-D",
               "id": 3
           },
           {
               "label": "Mardi Gras",
               "region": null,
               "code": "MARDIG",
               "id": 4
           },
           {
               "label": "Easter",
               "region": null,
               "code": "EASTER",
               "id": 5
           },
           {
               "label": "Memorial Day",
               "region": null,
               "code": "MEMOR",
               "id": 6
           },
           {
               "label": "July 4th",
               "region": null,
               "code": "4TH",
               "id": 7
           },
           {
               "label": "Labor Day",
               "region": null,
               "code": "LABOR",
               "id": 8
           },
           {
               "label": "Christmas Eve",
               "region": null,
               "code": "CMASEVE",
               "id": 14
           },
           {
               "label": "Christmas",
               "region": null,
               "code": "CMAS",
               "id": 15
           },
           {
               "label": "New Year's Eve",
               "region": null,
               "code": "NYEVE",
               "id": 16
           },
           {
               "label": "Good Friday",
               "region": null,
               "code": "GDFRI",
               "id": 17
           },
           {
               "label": "Black Friday",
               "region": null,
               "code": "BLKFRI",
               "id": 19
           },
           {
               "label": "Family Day",
               "region": null,
               "code": "CA-FAMDAY",
               "id": 24
           }
       ]
   }
Was this article helpful?
0 out of 0 found this helpful

Articles in this section