108 const OAuth2TokenUriPathSuffix =
"/oauth_token.do";
111 const DefaultApiVersion =
"now";
114 const RequestUriPathPrefix =
"/api/now";
121 string client_secret;
206 hash<auto> doRequest(
string m,
string path,
auto body, *reference<hash<auto>> info, softbool decode_errors = True,
208 if (client_id && !token);
210 return RestClient::doRequest(m, path, body, \info, decode_errors, hdr);
221 hash<auto>
sendAndDecodeResponse(*data body,
string m,
string path, hash<auto> hdr, *reference<hash<auto>> info, *softbool decode_errors);
266 "cls": Class::forName(
"ServiceNowRestConnection"),
267 "options": RestConnection::ConnectionScheme.options + {
268 "api": <ConnectionOptionInfo>{
270 "desc":
"the API version for ServiceNow; if not set the latest version is used",
273 "client_id": <ConnectionOptionInfo>{
275 "desc":
"the ServiceNow OAuth2 client ID",
277 "client_secret": <ConnectionOptionInfo>{
279 "desc":
"the ServiceNow OAuth2 client secret",
282 "password": <ConnectionOptionInfo>{
284 "desc":
"the ServiceNow password",
287 "username": <ConnectionOptionInfo>{
289 "desc":
"the ServiceNow username",
293 "required_options":
"username,password",
307 constructor(
string name,
string description,
string url, hash<auto> attributes = {}, hash<auto> options = {})
*string getApi()
returns the ServiceNow REST API version currently in use
const DefaultApiVersion
Default API version.
Definition: ServiceNowRestClient.qm.dox.h:111
constructor(hash< auto > opts, *softbool do_not_connect)
creates the object with the given options
*string getToken()
returns the access token, if any
static error(string fmt)
throws an exception due to an error
static hash< auto > getOptions(hash< auto > opts)
returns options for ServiceNowRestClient::ServiceNowRestClient::constructor()
static string getString(hash< auto > opts, string key)
gets a string option
hash< auto > sendAndDecodeResponse(*data body, string m, string path, hash< auto > hdr, *reference< hash< auto > > info, *softbool decode_errors)
sends the outgoing HTTP message and recodes the response to data
bool usingOAuth2()
Returns True if the client is using OAuth2 authentication.
loginIntern(*reference< hash< auto > > info)
performs authentication and authorization with SAP using the OAuth2 authorization URL
class for ServiceNow REST connections; returns ServiceNowRestClient objects
Definition: ServiceNowRestClient.qm.dox.h:261
string getType()
returns "snrest"
constructor(string name, string description, string url, hash< auto > attributes={}, hash< auto > options={})
creates the ServiceNowRestConnection object
DataProvider::AbstractDataProvider getDataProvider()
returns a data provider object for this connection
setChildCapabilities()
Sets child data provider capabilities.
ServiceNowRestClient getImpl(bool connect=True, *hash< auto > rtopts)
returns a ServiceNowRestClient object
bool hasDataProvider()
returns True as this connection returns a data provider with the getDataProvider() method
const ConnectionScheme
Connection entry info.
Definition: ServiceNowRestClient.qm.dox.h:265
hash< ConnectionSchemeInfo > getConnectionSchemeInfoImpl()
Returns the ConnectionSchemeInfo hash for this object.
the ServiceNowRestClient namespace contains all the objects in the ServiceNowRestClient module
Definition: ServiceNowRestClient.qm.dox.h:93