Qore CdsRestClient Module Reference
1.0
|
this class provides the REST client API for communication with Microsoft Dynamics 365 Common Data Service servers More...
Public Member Methods | |
constructor (hash< auto > opts, *softbool do_not_connect) | |
creates the object with the given options More... | |
string | getApi () |
returns the CDS REST API version currently in use | |
*string | getToken () |
returns the access token | |
Static Public Member Methods | |
static | error (string fmt) |
throws an exception due to an error | |
static hash< auto > | getOptions (hash< auto > opts) |
returns options for the CdsRestClient::constructor() | |
static string | getString (hash< auto > opts, string key) |
gets a string option | |
Public Attributes | |
const | DefaultApiVersion = "9.1" |
Default API version. | |
const | OAuth2AuthUrl = "https://login.microsoftonline.com" |
OAuth2 auth URL. | |
const | OAuth2TokenUriPathSuffix = "/oauth2/v2.0/token" |
OAuth2 token URI path suffix. | |
const | RequestUriPathPrefix = "/api/data/v" |
Request URI path prefix. | |
Private Member Methods | |
loginIntern (*reference< hash< auto >> info) | |
performs authentication and authorization with SAP using the OAuth2 authorization URL | |
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 | |
this class provides the REST client API for communication with Microsoft Dynamics 365 Common Data Service servers
This class requires the following options for Microsoft Dynamics 365 Common Data Service authentication and authorization to the target server:
client_id:
the OAuth2 client IDclient_secret:
the OAuth2 client secrettenant:
the tenant IDErrors returned from Dynamics will have the following format:
err:
will be the hex error code from Dynamics (ex: 0x8006088a
)desc:
the exception message (ex: Resource not found for the segment 'WhoAmi'.
)arg:
the error hash from the server plus a decoded_body
argument with any decoded message body CdsRestClient::CdsRestClient::constructor | ( | hash< auto > | opts, |
*softbool | do_not_connect | ||
) |
creates the object with the given options
opts | valid options are:
|
do_not_connect | if False (the default), then a connection will be immediately established to the remote server |
RESTCLIENT-ERROR | invalid option passed to constructor, unsupported data serialization, etc |
CDSRESTCLIENT-ERROR | missing or invalid required option for REST authentication or communication |