NinjaOne RMM API
This is a wrapper for the ninjaone API. You can see the API endpoints
Currently only the GET requests to endpoints are implemented (readonly).
Installation
Add this line to your application's Gemfile:
gem 'ninjaone'And then execute:
> bundle installOr install it yourself as:
> gem install ninjaoneUsage
Authentication
Before you start making the requests to API provide the client id and client secret and email/password using the configuration wrapping.
require 'ninjaone'
NinjaOne.configure do |config|
config.client_id = ENV['NINJA1_CLIENT_ID']
config.client_secret = ENV['NINJA1_CLIENT_SECRET']
config.endpoint = ENV['NINJA1_ENDPOINT']
end
client = NinjaOne.client()
client.login
o = client.organizations
o.each do |organization|
puts "#{organization.name}"
endResources
Authentication
# setup configuration
#
client.login| Resource | API endpoint |
|---|---|
| .auth_token or .login | https://app.ninjarmm.com/apidocs/?links.active=authorization |
System
Core system Entities and Resources
subscriptions = client.subscriptions| Resource | API endpoint |
|---|---|
| contacts, contact(id) | List contact and get contact details |
| organizations | list organizations |
| policies | list policies |
| jobs | list active jobs |
| activities | list activities |
| alerts | List active alerts (triggered conditions) |
| automation_scripts | List available automation scripts |
| device_custom_fields | List device custom fields |
| devices | List devices |
| devices_detailed | List devices(deatiled) |
| enabled_notification_channels | List enabled notification channels |
| notification_channels | List all notification channels |
| notification_channels_detailed | List all notification channels detailed |
| groups | List all groups (saved searches) |
| locations | List all locations |
| roles | List device roles |
| tasks | List scheduled tasks |
| software_products | List supported 3rd party software |
| users | List users |
| search_devices(query_string) | Find devices |
| user_end_users | End user list |
| user_technicians | Technicians list |
| user_roles | Get user roles |
Organizations
All apis related to organizations
org = client.organizations.first
org_devices = client.organization_devices(org.id)| Resource | API endpoint |
|---|---|
| .organizations,.organization(id) | List organizations or get one by id |
| .organization_locations(id) | Organization locations |
| .organization_end_users(id) | List users |
| .organization_custom_fields(id) | Organization custom fields |
| .organization_devices(id) | Organization devices |
| .organization_locations_backup_usage(id) | Organization location backup usage |
| .organization_backup_usage_by_location(id, location_id) | Organization locations backup usage |
Contributing
Bug reports and pull requests are welcome on GitHub.
License
The gem is available as open source under the terms of the MIT License.