3. Getting Started - mihilbabin/guesty_api GitHub Wiki
- Create an instance of
GuestyAPI::Clientby using your Guesty credentials
client = GuestyAPI::Client.new(username: '<API-KEY>', password: '<SECRET-KEY>')This is default HTTP Basic Authentication provided by Guesty. You can read more about the client in a corresponding section.
- Create any resource-based class by using a client
users = GuestyAPI::Users.new clientusers will be your source for performing API operations such as list, create, retrieve etc.
- Perform operations on your resource by using methods that have similar to Guesty API wording.
# Get all users on file
users.list
# Get user by ID
users.retrieve id: '5803ca18e48f450300c76173'
# Delete user by ID
users.delete id: '5803ca18e48f450300c76173'For the full resource reference please read the section about resources.
- The returned result may be one of the following: a list of entities, a single entity,
true, raisedGuestyAPI::APIError. To discover what entities are - go here. To figure out what errors you may see - visit Errors Handling page.