Code Monkey home page Code Monkey logo

faxplus-ruby's Introduction

FaxPlus

Faxplus is a Ruby library for interacting with faxplus APIs.

Setting things up.

To start using faxplus, you first need to add it to your Gemfile, with an entry such as this:

gem 'faxplus_api'

Afterwards, run bundle install

Next, you'll need to create a PAT token from faxplus dashboard here is the link [https://apidoc.fax.plus/v3/?shell#option-1-personal-access-tokens-pats

Accounts.

client = FaxplusApi::Client.new(access_token: ENV['FAXPLUS_PAT_TOKEN'])
client.account.accounts # List corporate members
client.account.user(user_id: 'userid') # Get account information
client.account.update_user(user_id: 'userid') # Modify account information
client.account.member(member_user_id: 'member_user_id') # Get member details
client.account.update_member(member_user_id: 'member_user_id') # Modify member details

Numbers.

client.number.list(user_id: 'userid') # List phone numbers
client.number.get(user_id: 'userid', number: 'number') # Get number information
client.number.update(user_id: 'userid', number: 'number') # Assign number
client.number.revoke(user_id: 'userid', number: 'number') # Revoke number

Faxes.

client.fax.list(user_id: 'userid') # List fax records
client.fax.get(user_id: 'userid', fax_id: 'fax_id') # Get a fax record
client.fax.update(user_id: 'userid', fax_id: 'fax_id') # Modify fax record
client.fax.revoke(user_id: 'userid', fax_id: 'fax_id') # Delete a fax

Files.

# Upload a file
client.file.upload(user_id: 'userid', data: {fax_file: File.open('pdf_file_path.pdf'), multipart: true}) => {:path => "/storage/transient-hsfhadhaskha.pdf"}
client.file.get(user_id: 'userid', fax_id: 'fax_id') # Download fax file
client.file.fax_report(user_id: 'userid', fax_id: 'fax_id') # Get fax confirmation report

Outbox.

client.outbox.list(user_id: 'userid') # List faxes in the outbox
# file_path from the client.file.upload output path
client.outbox.send(user_id: 'userid', data: {from: "+12345667", to: ["+12345688"], files: [file_path]}) # Send a fax 
client.outbox.get(user_id: 'userid', outbox_fax_id: 'outbox_fax_id') # List outgoing faxes
client.outbox.update(user_id: 'userid', outbox_fax_id: 'outbox_fax_id') # Delete an outgoing fax
client.outbox.delete(user_id: 'userid', outbox_fax_id: 'outbox_fax_id') # Modify an outgoing fax

Webhooks.

client.webhook.list # List user webhooks
client.webhook.create # Register new webhook
client.webhook.delete(hook_id: 'hook_id') # Delete webhook

Testing

TODO

More help

Please submit an issue via GitHub if you need more help with the faxplus_ruby gem.

faxplus-ruby's People

Contributors

dilkhush avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.