https://github.com/vhx/vhx-ruby
VHX API Client – Ruby
https://github.com/vhx/vhx-ruby
ruby vhx vhx-api
Last synced: 5 months ago
JSON representation
VHX API Client – Ruby
- Host: GitHub
- URL: https://github.com/vhx/vhx-ruby
- Owner: vhx
- Created: 2015-04-21T19:43:30.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2020-04-21T17:31:36.000Z (about 6 years ago)
- Last Synced: 2024-03-26T02:56:17.639Z (over 2 years ago)
- Topics: ruby, vhx, vhx-api
- Language: Ruby
- Homepage:
- Size: 146 KB
- Stars: 2
- Watchers: 38
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# VHX Ruby API Client
The VHX API is currently Private Beta.
### Installation
`gem install vhx-ruby`
#### Building Locally
```shell
$ gem build vhx.gemspec
Successfully built RubyGem
Name: vhx
Version: 0.0.0
File: vhx-0.0.0.gem
$ gem install vhx-0.0.0.gem
Successfully installed vhx-0.0.0
1 gem installed
$ irb
irb(main)> require 'vhx'
```
#### Running Specs
```shell
rspec .
```
#### Publishing to RubyGems
```shell
gem push vhx-ruby-#.#.#.gem
```
### Documentation
Full API reference is available at http://dev.vhx.tv/docs/api?ruby.
## Getting Started
Before requesting your first resource, you must setup an instance of the Vhx Client:
```ruby
vhx = Vhx.setup({ api_key: 'your VHX API key' })
```
Here's an example of creating a Vhx resource with payload options. You can handle errors by rescuing Vhx::VhxError.
```ruby
begin
# Example Customer Create
customer = Vhx::Customer.create({
email: 'customer@email.com',
name: 'First Last',
subscription: 'https://api.vhx.tv/subscriptions/1'
})
rescue Vhx::VhxError
# Handle error
end
```
### Resources & methods
customers
* [`create`](http://dev.vhx.tv/docs/api?ruby#create_customer)
* [`update`](http://dev.vhx.tv/docs/api?ruby#update_customer)
* [`retrieve`](http://dev.vhx.tv/docs/api?ruby#retrieve_customer)
* [`list`](http://dev.vhx.tv/docs/api?ruby#list_customers)
authorizations
* [`create`](http://dev.vhx.tv/docs/api?ruby#create_authorization)
videos
* [`create`](http://dev.vhx.tv/docs/api?ruby#create_customer)
* [`update`](http://dev.vhx.tv/docs/api?ruby#update_customer)
* [`retrieve`](http://dev.vhx.tv/docs/api?ruby#retrieve_customer)
* [`list`](http://dev.vhx.tv/docs/api?ruby#list_customers)
collections
* [`create`](http://dev.vhx.tv/docs/api?ruby#create_collection)
* [`update`](http://dev.vhx.tv/docs/api?ruby#update_collection)
* [`retrieve`](http://dev.vhx.tv/docs/api?ruby#retrieve_collection)
* [`list`](http://dev.vhx.tv/docs/api?ruby#list_collections)
* [`items`](http://dev.vhx.tv/docs/api?ruby#list_collection_items)
analytics
* [`report`](http://dev.vhx.tv/docs/api/?ruby#analytics)