/dotloop

Primary LanguageRubyMIT LicenseMIT

DotLoop API Library

Build Status Coverage Status

This library is designed to help ruby applications consume the DotLoop API.

You can read more about the api from the official documentation at https://support.dotloop.com

Installation

Add this line to your application's Gemfile:

gem 'dotloop'

And then execute:

$ bundle

Or install it yourself as:

$ gem install dotloop

Usage

Optional parameters are prefixed with a '*''

    client = Dotloop::Client.new(api_key: 'c4c26918-b2df-49a6-9bc2-9009274b23a7')

    myprofile = client.Profile.all                                          #=> get list of profiles

    client.Loop.all(
      profile_id: '1234',
      *batch_number: 1,
      *batch_size: 50,
      *statuses: [:private_listing, :active_listing, :sold],
      *complianceStatusIds: '1,2,3'
      *tagIds: '1,2,3'
      *sortBy: 'email'
      *searchQuery: 'test@example.com'
      *tagNames: 'tag'
      *createdByMe: '1234567'
    )                                                                       #=> get list of loops
    myprofile.loops                                                         #=> get list of loops

    client.Loop.all(profile_id: '1234', loop_view_id: '76046')              #=> get basic loop information (multiple loops)

    myloop = client.Loop.find(profile_id: '1234', loop_view_id: '76046')    #=> get basic loop information (single loop)
    client.Loop.detail(profile_id: '1234', loop_view_id: '76046')           #=> get loop detail
    myloop.detail                                                           #=> get loop detail

    client.LoopActivity.all(
      profile_id: '1234',
      loop_view_id: '76046',
      *batch_number: 1,
      *batch_size: 50
    )                                                                       #=> get loop activity
    myloop.activities                                                       #=> get loop activity

    mydoc = client.Document.all(profile_id: '1234', loop_view_id: '76046')  #=> get loop document list
    mydoc = myloop.documents                                                #=> get loop document list

    client.Participant.all(profile_id: '1234', loop_view_id: '76046')       #=> get a list of loop participants
    myloop.participants                                                     #=> get a list of loop participants

    client.Task.all(profile_id: '1234', loop_view_id: '76046')              #=> get a list of loop tasks
    myloop.tasks                                                            #=> get a list of loop tasks

    client.Folder.all(profile_id: '1234', loop_view_id: '76046')            #=> get a list of folders in a loop
    myloop.folders                                                          #=> get a list of folders in a loop

    client.Employee.all(
      profile_id: '1234',
      *batch_number: 1,
      *batch_size: 50,
      *show_admin: true,
      *show_in_active: true,
      *include_child: true
    )                                                                       #=> get a list of users in a profile
    myprofile.employees                                                     #=> get a list of users in a profile

    client.DocumentActivity.all(
      profile_id: '1234',
      document_id: '561622',
      *batch_number: 1,
      *batch_size: 50
    )                                                                       #=> get activity details for a document
    mydoc.activities                                                        #=> get activity details for a document

    client.Person.all(
      *batch_number: 1,
      *batch_size: 50
    )                                                                       #=> get list of contacts
    client.Person.find(person_id: '3603862')           #=> get details for a contact

    client.Document.get(
      profile_id: '1234',
      loop_view_id: '76046',
      document_id: '561622',
      document_name: 'My Offer'
    )                                                                       #=> get a PDF document
    mydoc.get                                                               #=> get a PDF document

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/dotloop.

License

The gem is available as open source under the terms of the MIT License.