Sha256: 5f5a9cf010843a428ac5d76e54bf95f2dff3f17b41f8d378ab4dfb7e9fea26f2
Contents?: true
Size: 1.67 KB
Versions: 7
Compression:
Stored size: 1.67 KB
Contents
# Open Recycling API Client Ruby client for the Open Recycling API. You can use this gem to develop applications that interact with the Open Recycling Platform. ## Installation Install the gem and add to the application's Gemfile by executing: $ bundle add open_recycling Or add it manually to the Gemfile: ```ruby gem 'open_recycling' ``` If bundler is not being used to manage dependencies, install the gem by executing: $ gem install open_recycling ## Usage Register a new application on the Open Recycling Platform and get the application id, api key and secret key. Furthermore, you need to have an application user id as the application always acts on behalf of a user. With the above information, you can generate a JWT token using the `OpenRecycling.generate_token` method. ``` require 'open_recycling' OpenRecycling.api_url = "<open recycling url>" OpenRecycling.jwt_token = OpenRecycling.generate_token( application_id: "<application id>", api_key: "<api key>", secret_key: "<secret key>", application_user_id: "<application user id>" ) ``` You can now create a new client instance. ```ruby client = OpenRecycling::Client.new ``` With the client setup, you can now make requests to the OpenRecycling API, e.g. to fetch all organizations. ```ruby organizations = client.org.organizations.all ``` ## License The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). ## Code of Conduct Everyone interacting in the Open Recycling project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/open_recycling/blob/main/CODE_OF_CONDUCT.md).
Version data entries
7 entries across 7 versions & 1 rubygems