this class provides the REST client API for communication with the zeyos.com CRM ERP system
More...
#include <ZeyosRestClient.qm.dox.h>
|
| constructor (hash< auto > options, *softbool do_not_connect) |
| creates the object with the given options More...
|
|
|
| getToken (*reference< hash > info) |
| logs in an sets the token for further communication
|
|
this class provides the REST client API for communication with the zeyos.com CRM ERP system
This class requires one of the following options for zeyos.com's authentication and authorization to the target server:
appsecret:
the zeyos.com's appsecret
token:
the zeyos.com's token, if provided then the HTTP username, password, and appsecret are not needed and will be ignored.
After connecting, the ZeyosRestClient class will request a session token that will be used in further communication.
◆ constructor()
ZeyosRestClient::ZeyosRestClient::constructor |
( |
hash< auto > |
options, |
|
|
*softbool |
do_not_connect |
|
) |
| |
creates the object with the given options
- Example:
ZeyosRestClient zeyos(
{
"url": "https://cloud.zeyos.com/test",
"identifier": "id",
"appsecret": "8df3cc8be92d300edb9ff9b9a680d22eacbf2ee5"
});
- Parameters
-
options | valid options are:
appsecret (optional): the zeyos.com appsecret
additional_methods: Optional hash with more but not-HTTP-standardized methods to handle. It allows to create various HTTP extensions like e.g. WebDAV. The hash takes the method name as a key, and the value is a boolean True or False: indicating if the method requires a message body as well. Example:
("additional_methods": ("PROPFIND": True, "MKCOL": True ));
connect_timeout: The timeout value in milliseconds for establishing a new socket connection (also can be a relative date-time value for clarity, ex: 20s )
content_encoding: for possible values, see EncodingSupport; this sets the send encoding (if the "send_encoding" option is not set) and the requested response encoding (note that the RestClient class will only compress outgoing message bodies over CompressionThreshold bytes in size)
data: a data serialization option; if not present defaults to "auto"
default_path: The default path to use for new connections if a path is not otherwise specified in the connection URL
default_port: The default port number to connect to if none is given in the URL
error_passthru: if True then HTTP status codes indicating errors will not cause an HTTP-CLIENT-RECEIVE-ERROR exception to be raised, rather such responses will be passed through to the caller like any other response
headers: an optional hash of headers to send with every request, these can also be overridden in request method calls
http_version: Either '1.0' or '1.1' for the claimed HTTP protocol version compliancy in outgoing message headers
identifier (optional): the zeyos.com identifier
instance (required): the zeyos.com instance name (first segment of URI path)
max_redirects: The maximum number of redirects before throwing an exception (the default is 5)
proxy: The proxy URL for connecting through a proxy
send_encoding: a send data encoding option or the value "auto" which means to use automatic encoding; if not present defaults to no content-encoding on sent message bodies (note that the RestClient class will only compress outgoing message bodies over CompressionThreshold bytes in size)
swagger: the path to a Swagger 2.0 REST schema file for API validation; only used if validator not provided (see the Swagger module)
timeout: The timeout value in milliseconds (also can be a relative date-time value for clarity, ex: 30s )
url: A string giving the URL to connect to; if not given then the target URL will be taken from any validator option, if given by calling AbstractRestSchemaValidator::getTargetUrl()
validator: an AbstractRestSchemaValidator object to validate request and response messages; overrides swagger
no_charset: if True no charset will be added to the Content-Type header (should be set to True if data are sent in the body). Default is True if not passed.
|
do_not_connect | if False (the default), then a connection will be immediately established to the remote server |
- Exceptions
-
RESTCLIENT-ERROR | invalid option passed to constructor, unsupported data serialization, etc |
ZEYOSRESTCLIENT-ERROR | missing or invalid required option for Zeyos.com REST authentication or communication |