Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Repository files navigation

Notice

This repo is no longer maintained by Clever. We provide the Swagger definitions at https://github.com/Clever/swagger-api.

clever-ruby

Clever - the Ruby gem for the Clever API

The Clever API

This SDK is automatically generated by the Swagger Codegen project:

  • API version: 2.0.0
  • Package version: 2.0.1
  • Build package: io.swagger.codegen.languages.RubyClientCodegen

Installation

Build a gem

To build the Ruby code into a gem:

gem build clever-ruby.gemspec

Then either install the gem locally:

gem install ./clever-ruby-2.0.1.gem

(for development, run gem install --dev ./clever-ruby-2.0.1.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'clever-ruby', '~> 2.0.1'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:

gem 'clever-ruby', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gemrequire'clever-ruby'# Setup authorizationClever.configuredo |config|
# Configure OAuth2 access token for authorization: oauthconfig.access_token='YOUR ACCESS TOKEN'endapi_instance=Clever::DataApi.newid="id_example"# String | beginresult=api_instance.get_contact(id)presultrescueClever::ApiError=>eputs"Exception when calling DataApi->get_contact: #{e}"end

Documentation for API Endpoints

All URIs are relative to https://api.clever.com/v2.0

ClassMethodHTTP requestDescription
Clever::DataApiget_contactGET /contacts/{id}
Clever::DataApiget_contactsGET /contacts
Clever::DataApiget_contacts_for_studentGET /students/{id}/contacts
Clever::DataApiget_courseGET /courses/{id}
Clever::DataApiget_course_for_sectionGET /sections/{id}/course
Clever::DataApiget_coursesGET /courses
Clever::DataApiget_districtGET /districts/{id}
Clever::DataApiget_district_adminGET /district_admins/{id}
Clever::DataApiget_district_adminsGET /district_admins
Clever::DataApiget_district_for_contactGET /contacts/{id}/district
Clever::DataApiget_district_for_courseGET /courses/{id}/district
Clever::DataApiget_district_for_district_adminGET /district_admins/{id}/district
Clever::DataApiget_district_for_schoolGET /schools/{id}/district
Clever::DataApiget_district_for_school_adminGET /school_admins/{id}/district
Clever::DataApiget_district_for_sectionGET /sections/{id}/district
Clever::DataApiget_district_for_studentGET /students/{id}/district
Clever::DataApiget_district_for_teacherGET /teachers/{id}/district
Clever::DataApiget_district_for_termGET /terms/{id}/district
Clever::DataApiget_districtsGET /districts
Clever::DataApiget_schoolGET /schools/{id}
Clever::DataApiget_school_adminGET /school_admins/{id}
Clever::DataApiget_school_adminsGET /school_admins
Clever::DataApiget_school_for_sectionGET /sections/{id}/school
Clever::DataApiget_school_for_studentGET /students/{id}/school
Clever::DataApiget_school_for_teacherGET /teachers/{id}/school
Clever::DataApiget_schoolsGET /schools
Clever::DataApiget_schools_for_school_adminGET /school_admins/{id}/schools
Clever::DataApiget_schools_for_studentGET /students/{id}/schools
Clever::DataApiget_schools_for_teacherGET /teachers/{id}/schools
Clever::DataApiget_sectionGET /sections/{id}
Clever::DataApiget_sectionsGET /sections
Clever::DataApiget_sections_for_courseGET /courses/{id}/sections
Clever::DataApiget_sections_for_schoolGET /schools/{id}/sections
Clever::DataApiget_sections_for_studentGET /students/{id}/sections
Clever::DataApiget_sections_for_teacherGET /teachers/{id}/sections
Clever::DataApiget_sections_for_termGET /terms/{id}/sections
Clever::DataApiget_studentGET /students/{id}
Clever::DataApiget_studentsGET /students
Clever::DataApiget_students_for_contactGET /contacts/{id}/students
Clever::DataApiget_students_for_schoolGET /schools/{id}/students
Clever::DataApiget_students_for_sectionGET /sections/{id}/students
Clever::DataApiget_students_for_teacherGET /teachers/{id}/students
Clever::DataApiget_teacherGET /teachers/{id}
Clever::DataApiget_teacher_for_sectionGET /sections/{id}/teacher
Clever::DataApiget_teachersGET /teachers
Clever::DataApiget_teachers_for_schoolGET /schools/{id}/teachers
Clever::DataApiget_teachers_for_sectionGET /sections/{id}/teachers
Clever::DataApiget_teachers_for_studentGET /students/{id}/teachers
Clever::DataApiget_termGET /terms/{id}
Clever::DataApiget_term_for_sectionGET /sections/{id}/term
Clever::DataApiget_termsGET /terms
Clever::EventsApiget_eventGET /events/{id}
Clever::EventsApiget_eventsGET /events

Documentation for Models

Documentation for Authorization

oauth

Previous Versions

The current client support v2.0 of the API. For v1.2 please use:

Updating the Library

  1. Git clone swagger-codegen (https://github.com/swagger-api/swagger-codegen)

  2. Git clone Clever's swagger-api repo (https://github.com/Clever/swagger-api)

  3. Run this command in the swagger-codegen repo

java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i $PATH_TO_SWAGGER_API_REPO/v2.0-client.yml -l ruby -o $PATH_TO_THIS_REPO --additional-properties gemVersion=$VERSION
  1. Run make build to copy over the override files

Publishing

Signup to rubygems.org if you don't already have an account, and ask one of the gem owners to add you as an owner. You'll be prompted to log in from the command line when you push the gem, if you aren't already logged in.

To add a new owner, you need to be an owner, then run this command: gem owner clever-ruby -a <emailaddress>

  1. Update CHANGELOG.md
  2. gem build clever-ruby.gemspec
  3. gem push clever-ruby-X.Y.Z.gem

About

Clever Ruby library

Resources

Stars

28 stars

Watchers

12 watching

Forks

Releases

Packages

Used by

Contributors

Languages