0.0
No commit activity in last 3 years
No release in over 3 years
Simple client for circuit REST API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 12
~> 6

Runtime

 Project Readme

Gem Version

Circuit Client

circuit_client is a minimal client for the Circuit REST API.

It is not a full-featured API client and current only supports:

  • only client_credentials authentication
  • list and create conversations
  • create new messages

API Documentation

Available at rubydoc.info.

Usage

Basic usage

require 'circuit_client'

client = CircuitClient::Client.new do |c|
  c.client_id = '<client_id>'
  c.client_secret = '<client_secret>'
end

client.create_message('<convId>', 'Hello World!')

Command line interface

The send-circuit command shipped with circuit_client has the following options:

Usage: send-circuit [OPTIONS]
  --help | -h                display this help text
  --config | -c <file>       path to configuration file
                             (default: /etc/send-circuit.yaml)
  --trace                    print http debug information

List conversations:
  --list | -l                list conversations of user

Send message:
  --subject | -s <text>      Set subject for message

  --conversation | -c <id>   Id of the conversation to send a message to
  or
  --new | -n                 creates a new conversation
  --topic | -t <text>        topic of the new conversation
  --participant | -p
    <email or id>            adds a participant to the conversation

The command will read the message body from stdin.