No release in over 3 years
Low commit activity in last 3 years
Ruby client for the Xporter on Demand API.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.15
~> 5.0
~> 10.0

Runtime

>= 2.8.3, ~> 2.8.3
>= 2.4.2
 Project Readme

A Ruby client for the XporterOnDemand API

Installation

gem install xod_client

Getting started

require 'xporter_on_demand'

relying_party = "app.example.com"   # Your relying party
school_estab  = "1234567"           # School establishment number
estab_secret  = "YOUR SECRET HERE"  # Supplied school secret

# Retrieve an IDAAS Authentication token
token  = XporterOnDemand::Token.new(school_estab, relying_party, estab_secret).retrieve
# Initialize a client with the token
client = XporterOnDemand::Client.new(token.token)

# Craft a query with your desired options & parameters
students_endpoint = XporterOnDemand::Endpoint.create(:students, options: [:include_group_ids, :include_att_stats], parameters: { student_status: 'OnRoll' })

# Fetch the first page of results
student_results = client.query(students_endpoint)
# Retrieve all pages
student_results.fetch_all

Using the Invitation API

# Create your registration object
reg = XporterOnDemand::Registration.new do |r|
  r.registration_type     = 'Test' # Defaults to 'Live'
  r.partner_id            = 'your-partner-id'
  r.app_management_secret = 'your-app-management-secret'
end

# Build your school with at the required parameters
school = {
  lea_code: 123,                                          # Required
  dfes_code: 4567,                                        # Required
  school_name: 'Test School',                             # Required
  school_contact_first_name: 'Joe',                       # Required
  school_contact_last_name: 'Bloggs',                     # Required
  school_contact_email: 'joe.bloggs@email.com',           # Required
  school_contact_phone: '01234 567890',                   # Required
  school_contact: 'Joe Bloggs',
  school_technical_contact_name: 'Jim Bloggs',
  school_technical_contact_email: 'jim.bloggs@email.com',
  school_technical_contact_phone: '01234 567890',
  partner_application_id: 'your-partner-id',              # Required
  partner_name: 'your-registered-name',                   # Required
  partner_registered_email: 'your-registered-email',      # Required
  we_accept_groupcall_usage_policy: true,                 # Required
}

# Add school to the registration object. Multiple schools can be added
reg.add_school(school)

# Send registrations
reg.register

# Will return a boolean outlining whether or not ALL registrations were successful.
# Any error messages will be assigned to the registration object or the
# individual schools eg.

reg.message
# => 'Unauthorized: ApplicationId header missing or incorrect'

reg.schools.first.message
# => 'School not found in EduBase'