Qore HueRestClient Module Reference 1.0
Loading...
Searching...
No Matches
HueRestClient::HueRestClient Class Reference

this class provides the REST client API for communication with Hue servers More...

#include <HueRestClient.qm.dox.h>

Inheritance diagram for HueRestClient::HueRestClient:
[legend]

Public Member Methods

 constructor (hash< auto > opts, *softbool do_not_connect)
 creates the object with the given options More...
 

Static Public Member Methods

static hash< auto > getOptions (hash< auto > opts)
 returns options for HueRestClient::HueRestClient::constructor()
 

Public Attributes

const DefaultAuthUrl = "https://api.meethue.com/v2/oauth2/authorize"
 Default authorization request URL.
 
const DefaultGrantType = "authorization_code"
 Default OAuth2 grant type.
 
const DefaultHuePingHeaders
 Default Hue ping headers.
 
const DefaultHuePingMethod = "GET"
 Default Hue ping method.
 
const DefaultOptions
 Default constructor options.
 
const DefaultTokenUrl = "https://api.meethue.com/v2/oauth2/token"
 Default token request URL.
 
const DefaultUrl = "rests://api.meethue.com/route/api"
 Default Hue REST API URL.
 

Detailed Description

this class provides the REST client API for communication with Hue servers

You must use an OAuth2 token by setting the token and oauth2_refresh_token options; the following options need to be set as well:

  • oauth2_client_id: the OAuth2 client ID
  • oauth2_client_secret: the OAuth2 client secret

Then an external program has to guide the user through using the authorization_grant flow to get a token to use; this module does not implement that flow.

Member Function Documentation

◆ constructor()

HueRestClient::HueRestClient::constructor ( hash< auto >  opts,
*softbool  do_not_connect 
)

creates the object with the given options

Example:
HueRestClient rest(opts);
Parameters
optsvalid options are all the options for the RestClient class; note that the URL is set by default if not provided (see DefaultUrl)
do_not_connectif False (the default), then a connection will be immediately established to the remote server
Exceptions
RESTCLIENT-ERRORinvalid option passed to constructor, unsupported data serialization, etc