https://github.com/revdotcom/rev-ruby-sdk
Ruby wrapper for Rev.com API
https://github.com/revdotcom/rev-ruby-sdk
Last synced: 9 months ago
JSON representation
Ruby wrapper for Rev.com API
- Host: GitHub
- URL: https://github.com/revdotcom/rev-ruby-sdk
- Owner: revdotcom
- License: apache-2.0
- Created: 2013-09-09T23:25:59.000Z (over 12 years ago)
- Default Branch: develop
- Last Pushed: 2022-04-10T10:13:07.000Z (about 4 years ago)
- Last Synced: 2025-04-26T21:33:55.308Z (about 1 year ago)
- Language: Ruby
- Homepage: http://www.rev.com/api/
- Size: 153 KB
- Stars: 10
- Watchers: 68
- Forks: 6
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](http://badge.fury.io/rb/rev-api)
[](https://secure.travis-ci.org/revdotcom/rev-ruby-sdk)
[](https://gemnasium.com/revdotcom/rev-ruby-sdk)
[](https://codeclimate.com/github/revdotcom/rev-ruby-sdk)
[Reference](https://www.rev.com/api/docs) | [RDocs](http://rubydoc.info/github/revdotcom/rev-ruby-sdk/master/frames)
rev-ruby-sdk
------------
### Background
Rev.com provides transcription, caption and translation services powered by humans. The Rev.com API allows you to tap transcription
and caption services with no manual steps. It's a RESTful API, documented at .
The Ruby SDK for the Rev API provides a convenient Ruby wrapper for the Rev.com API. All operations of the API, as described
at , are supported.
### Install
```shell
gem install rev-api
```
or put it into your Gemfile.
When you need it:
```ruby
require 'rev-api'
```
### Authentication
If you are building a new API client, you must first obtain a client API key, which you can do at .
All operations in the API are performed on behalf of a Rev customer, identified by their user API key. The client key / user
key pair is used to authenticate each API operation. Once you have the two keys, you can create a new Rev.com API client:
```ruby
require 'rev-api'
rev_client = Rev.new('your_client_key', 'your_user_key')
```
You can read more about authentication in the Rev.com API at
### Sandbox
All operations can be executed against either the production or the sandbox environment. The sandbox environment allows you
to test your API client without actually paying for orders and having them worked on.
By default, the Rev.com API client executes against the production environment. To go against the sandbox instead,
initialize the client this way:
```ruby
require 'rev-api'
rev_client = Rev.new('your_client_key', 'your_user_key', Rev::Api::SANDBOX_HOST)
```
### Usage
The snippets below assume you've initialized `rev_client`:
```ruby
rev_client = Rev.new('your_client_key', 'your_user_key')
```
#### Listing orders
```ruby
orders_page = rev_client.get_orders_page(1) # get a single page of orders
all_orders = rev_client.get_all_orders # get first page of orders history
orders_by_client_ref = rev_client.get_orders_by_client_ref('some_ref') # get orders with reference id of 'some_ref'
```
#### Get a single order by order number
```ruby
some_order = rev_client.get_order('TCxxxxxxxx')
puts "Original comment: #{some_order.comments.first.text}"
```
#### Cancel an order given an order number
```ruby
rev_client.cancel_order('TCxxxxxxxx')
```
#### Print out the text of all transcripts in an order
```ruby
order = rev_client.get_order('TCxxxxxxx')
order.transcripts.each do |t|
puts rev_client.get_attachment_content_as_string t.id
puts
end
```
Refer to `cli.rb` in the `examples` directory for a full example illustrating placing orders, handling error responses, etc.
### Documentation
[YARD documentation](http://rubydoc.info/github/revdotcom/rev-ruby-sdk/master/frames) can be generated locally by running `rake yard` command, and will be placed in the `doc` directory.
You can find API documentation at .
### Support
If you have any questions or suggestions for improvement, email us directly at api[at]rev[dot]com.
### Compatibility
- MRI 2.0.0
### Tests
Minitest suite might be run using `rake test` command.
Current stack:
- minitest
- webmock
- vcr
- turn
### Dependencies
- httparty