crisphive

Crisphive - the Ruby gem for the CrispHive Developer API

Public REST API for integrating CrispHive from your own backend. Authenticate every request with a secret API key as a Bearer token (Authorization: Bearer chsk_live_…). The key prefix selects the data environment: chsk_live_… → production (live), chsk_test_… → sandbox (isolated test).

Key scopes (restricted keys). A key is either full-access (can call every endpoint below) or restricted to a set of permission codes chosen at creation — the same codes as the dashboard permission grid (e.g. customers_view, job_create, team_manage). A restricted key calling an endpoint outside its scope gets 403. The full code list is the permission catalog (GET /permission/modules on the dashboard API). Create, scope, and revoke keys from the business dashboard.

Every response is wrapped in the envelope { \"error_code\": 0, \"message\": \"Success\", \"data\": <payload> }.

This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.0
  • Package version: 0.1.0
  • Generator version: 7.11.0
  • Build package: org.openapitools.codegen.languages.RubyClientCodegen

Installation

Build a gem

To build the Ruby code into a gem:

gem build crisphive.gemspec

Then either install the gem locally:

gem install ./crisphive-0.1.0.gem

(for development, run gem install --dev ./crisphive-0.1.0.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 'crisphive', '~> 0.1.0'

Install from Git

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

gem 'crisphive', :git => 'https://github.com/crisphive/crisphive-ruby.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 gem
require 'crisphive'

# Setup authorization
Crisphive.configure do |config|
  # Configure Bearer authorization (CrispHive secret key): ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
  # Configure a proc to get access tokens in lieu of the static access_token configuration
  config.access_token_getter = -> { 'YOUR TOKEN GETTER PROC' } 
  # Configure faraday connection
  config.configure_faraday_connection { |connection| 'YOUR CONNECTION CONFIG PROC' }
end

api_instance = Crisphive::BusinessSkillApi.new
opts = {
  page: 56, # Integer | Page number (default: 1)
  limit: 56 # Integer | Page size (default: 15, max: 1000)
}

begin
  #List skill categories
  result = api_instance.list_skill_categories(opts)
  p result
rescue Crisphive::ApiError => e
  puts "Exception when calling BusinessSkillApi->list_skill_categories: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://api.crisphive.com/v1

Class Method HTTP request Description
Crisphive::BusinessSkillApi list_skill_categories GET /skill-categories List skill categories
Crisphive::BusinessSkillApi list_skills GET /skills List all skills
Crisphive::BusinessSkillApi list_skills_by_category GET /skill-categories/id/skills List skills in a category
Crisphive::CustomerApi create_customer POST /customers Create a customer
Crisphive::CustomerApi delete_customer DELETE /customers/id Delete a customer
Crisphive::CustomerApi get_customer GET /customers/id Get a customer
Crisphive::CustomerApi list_customers GET /customers List customers
Crisphive::CustomerApi update_customer PUT /customers/id Update a customer
Crisphive::JobRequestBusinessApi create_job_request POST /job-requests Create a job request (business actor)
Crisphive::JobRequestBusinessApi get_job_request GET /job-requests/id Get a job request
Crisphive::JobRequestBusinessApi get_job_request_timeline GET /job-requests/id/timeline Job timeline (business surface — also serves tech via BusinessAuth)
Crisphive::JobRequestBusinessApi list_job_request_booking_windows GET /job-requests/booking-windows Booking availability (business actor)
Crisphive::JobRequestBusinessApi list_job_request_changes GET /job-requests/changes Poll for new & changed job requests (sync feed)
Crisphive::JobRequestBusinessApi list_job_requests GET /job-requests List job requests
Crisphive::JobTypesApi get_job_type GET /job-types/id Get a job type
Crisphive::JobTypesApi list_job_types GET /job-types List job types
Crisphive::ServiceAreaApi get_service_area GET /service-areas/id Get a service area
Crisphive::ServiceAreaApi list_service_areas GET /service-areas List service areas
Crisphive::TechnicianApi get_technician GET /technicians/id Get a technician
Crisphive::TechnicianApi list_technicians GET /technicians List technicians
Crisphive::VehicleApi get_vehicle GET /vehicles/id Get a vehicle
Crisphive::VehicleApi list_vehicles GET /vehicles List vehicles

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

ApiKeyAuth

  • Type: Bearer authentication (CrispHive secret key)