Guestfolio API Documentation

« back to overview

Events [1.1]

Methods for creating, updating and viewing hotel event information

The schedule responds to any attributes provided through the from_hash method in IceCube github.com/seejohnrun/ice_cube. Only the start_time and end_time are required as hashes

index

Get the list of events for a hotel

URL

GET /api/hotels/:id/events

Optional Parameters

  • page String

    Page number requested

  • per_page String

    Results to be shown per page

  • search Hash
    String

    name

Response Object

  • Array of event details

Examples

Request

(Optional)

"search": [
    "name": "Drinks at noon"
]

Response

{

"total_count": 2,
"total_pages": 3,
"events": [
    {
        "id": 1,
        "name": "Drinks at noon",
        "description": "Meet our GM",
        "active": true,
        "schedule": {
          "start_time": { time: "2013-11-01T08:00:00Z", zone: "Athens" },
          "end_time": { time: "2013-11-01T11:00:00Z", zone: "Athens" },
          "rrules": [], "exrules": [], "rtimes": [], "extimes": [],
        },
        "created_at": "2012-12-13T10:20:50-08:00",
        "updated_at": "2012-12-15T12:18:26-08:00",
        "deleted": false,
        "_links": {
            "self": {
                "href": "https://guestfolio.net/api/hotels/1/events/1"
            }
        }
    },
    {
        "id": 2,
        "name": "Drinks at noon",
        "description": "Meet our GM",
        "active": true,
        "schedule": {
          "start_time": { time: "2013-11-01 08:00:00", zone: "Athens" },
          "end_time": { time: "2013-11-01 11:00:00", zone: "Athens" },
          "rrules": [], "exrules": [], "rtimes": [], "extimes": [],
        },
        "created_at": "2012-12-13T10:20:50-08:00",
        "updated_at": "2012-12-15T12:18:26-08:00",
        "deleted": false,
        "_links": {
            "self": {
                "href": "https://guestfolio.net/api/hotels/1/events/2"
            }
        }
    }
],
"_links": {
    "self": {
        "href": "https://guestfolio.net/api/hotels/1/events?page=2"
    }
    "previous": {
        "href": "https://guestfolio.net/api/hotels/1/events?page=1"
    }
    "next": {
        "href": "https://guestfolio.net/api/hotels/1/events?page=3"
    }
}

}

The events array includes a hash of basic event information

create

Create a new event

URL

POST /api/hotels/:id/events

Required Parameters

  • name String
  • description String
  • active Boolean
  • schedule Hash

    The event schedule hash including start_time and end_time values

Response Object

  • The event details

Examples

Request

{

"name": "Drinks at noon",
"description": "Meet our GM",
"active": true,
"schedule": {
  "start_time": { time: "2013-11-01 08:00:00", zone: "Athens" },
  "end_time": { time: "2013-11-01 11:00:00" },
},

}

Response

{

"id": 3,
"name": "Drinks at noon",
"description": "Meet our GM",
"active": true,
"schedule": {
  "start_time": { time: "2013-11-01 08:00:00", zone: "Athens" },
  "end_time": { time: "2013-11-01 11:00:00", zone: "Athens" },
  "rrules": [], "exrules": [], "rtimes": [], "extimes": [],
},
"created_at": "2013-01-08T10:20:50-08:00",
"updated_at": "2013-01-08T10:20:50-08:00",
"deleted": false,
"_links": {
    "self": {
        "href": "https://guestfolio.net/api/hotels/1/events/3"
    }
}

}

show

Get a specific events details

URL

GET /api/hotels/:id/events/:id

Response Object

  • The event details

Examples

Request Response

{

"id": 3,
"name": "Drinks at noon",
"description": "Meet our GM",
"active": true,
"schedule": {
  "start_time": { time: "2013-11-01 08:00:00", zone: "Athens" },
  "end_time": { time: "2013-11-01 11:00:00", zone: "Athens" },
  "rrules": [], "exrules": [], "rtimes": [], "extimes": [],
},
"created_at": "2013-01-08T10:20:50-08:00",
"updated_at": "2013-01-08T10:20:50-08:00",
"deleted": false,
"_links": {
    "self": {
        "href": "https://guestfolio.net/api/hotels/1/events/3"
    }
}

}

update

Update an existing event with specific changed attributes

URL

PUT /api/hotels/:id/events/:id

Optional Parameters

  • name String
  • description String
  • active Boolean
  • schedule Hash

    The event schedule hash including start_time and end_time values

Response Object

  • String

    Empty string on success, check response code

Examples

Request

"name": "New event",

Response

destroy

Delete an existing event

URL

DELETE /api/hotels/:id/events/:id