Latest 0.0.2
Homepage https://github.com/Rentlio/api.lib.swift
License MIT
Platforms ios 10.0, requires ARC
Dependencies Just
Authors

Swift client for Rentlio API

Swift wrapper for official Rentlio API. This lib is heavily inspired by official documentation, and follows REST methods listed there.

The Rentlio API is organized around REST. It has predictable, resource-oriented URLs, and uses HTTP response codes to indicate API errors.

JSON is returned by all API responses, including errors. Also JSON is used in request body instead of form data. We don’t use sandbox version where you can test your integrations. Instead, you can use a DEMO property and its reservations to be sure no harm is done on real data.

Please read official docs before consuming this lib https://docs.rentl.io

IMPORTANT NOTE: apikey is private key that allows access to execute all methods available in Rentlio public API. Anyone with your API key will have permission to read, create, update and delete data from your private Rentlio account.

Dependencies

Integration

You can use CocoaPods to install RentlioApi by adding it to your Podfile:

platform :ios, '10.0'
use_frameworks!

target 'MyApp' do
    pod 'RentlioApi'
end

Example Project

Grab the source code

$ git clone https://github.com/Rentlio/api.lib.swift.git api.lib.swift && cd $_
$ pod install
$ open api.lib.swift.xcworkspace

Basic Usage

Making a Request

let rentlio = RentlioApi(apikey: "your_apikey")
rentlio.getUser()

// GET /users/me

Completion block

rentlio.getUser(
    done: {
        res in
        if let json = res.json {
            print(json)
        }
    }
)

Methods

  • getUser()
  • getProperties()
  • getUnitTypes()
  • getUnits()
  • getUnitReservations()
  • getReservations()
  • getServices()
  • createInvoiceItem()
  • getServicePaymentTypesEnum()
  • getReservationStatusesEnum()
  • getCurrenciesEnum()

Branches

  • master – The production branch. Clone or fork this repository for the latest copy.
  • develop – The active development branch. Pull requests should be directed to this branch.

Contribution

Ready to submit a fix or a feature? Submit a pull request! And please:

  • If code changes, run the tests and make sure everything still works.
  • Write new tests for new functionality.
  • Update documentation comments where applicable.
  • Maintain the existing style.

Contact

License

See LICENSE.

Latest podspec

{
    "name": "RentlioApi",
    "version": "0.0.2",
    "summary": "Swift client for consuming official Rentlio API",
    "description": "Swift client for consuming official [Rentlio API](https://docs.rentl.io/)nnMethods:nn-    getUsern-    getPropertiesn-    getUnitTypesn-    getUnitsn-    getUnitReservationsn-    getReservationsn-    getServicesn-    createInvoiceItemn-    getServicePaymentTypesEnumn-    getReservationStatusesEnumn-    getCurrenciesEnum",
    "homepage": "https://github.com/Rentlio/api.lib.swift",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Juraj Hilje": "[email protected]"
    },
    "requires_arc": true,
    "platforms": {
        "ios": "10.0"
    },
    "source": {
        "git": "https://github.com/Rentlio/api.lib.swift.git",
        "tag": "0.0.2"
    },
    "source_files": "Source/*.swift",
    "dependencies": {
        "Just": [
            "~> 0.6.0"
        ]
    },
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "3.0"
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This