305 "oauth_url_auth":
"https://login.salesforce.com/services/oauth2/authorize",
306 "oauth_url_token":
"https://login.salesforce.com/services/oauth2/token",
307 "oauth_url_revoke":
"https://login.salesforce.com/services/oauth2/revoke",
309 "oauth2_grant_type":
"password",
313 const DefaultSendEncoding =
"gzip";
316 const RequiredOptions = ...;
320 const AsyncDataloadNs =
"http://www.force.com/2009/06/asyncapi/dataload";
323 const JobInfoAttributes = {
325 "xmlns": AsyncDataloadNs,
465 hash<auto>
patch(
string path,
auto body, *reference<hash<auto>> info, *hash<auto> hdr);
512 hash<auto>
doRequest(
string m,
string path,
auto body, *reference<hash<auto>> info, softbool decode_errors = True, *hash<auto> hdr);
561 hash<auto>
doBulkRequest(
string m,
string path,
auto body, *reference<hash<auto>> info, softbool decode_errors = True, *hash<auto> hdr);
607 hash<auto>
bulkGet(
string path,
auto body, *reference<hash<auto>> info, *hash<auto> hdr);
653 hash<auto>
bulkPost(
string path,
auto body, *reference<hash<auto>> info, *hash<auto> hdr);
688 hash<auto>
bulkJobCreate(
string operation,
string object,
string job_content_type, *reference<hash<auto>> info, *hash<auto> hdr);
723 hash<auto>
bulkJobAddBatch(
string jobid, data batch_data,
string job_content_type, *reference<hash<auto>> info, *hash<auto> hdr);
752 hash<auto>
bulkJobClose(
string jobid, *reference<hash<auto>> info, *hash<auto> hdr);
906 "cls": Class::forName(
"SalesforceRestConnection"),
908 "api": <ConnectionOptionInfo>{
910 "desc":
"the Salesforce API to use; use `auto` (the default) to use the latest API version",
913 "client_id": RestConnection::ConnectionScheme.options.oauth2_client_id + <ConnectionOptionInfo>{
914 "desc":
"The OAuth2 client_id and also the Salesforce \"consumer key\" for the Connected App",
916 "client_secret": RestConnection::ConnectionScheme.options.oauth2_client_secret + <ConnectionOptionInfo>{
917 "desc":
"The OAuth2 client_secret and also the Salesforce \"consumer secret\" for the Connected "
921 "data": RestConnection::ConnectionScheme.options.
"data" + <ConnectionOptionInfo>{
922 "default_value":
"json",
924 "instance_url": <ConnectionOptionInfo>{
926 "desc":
"the Salesforce.com instance URL returned in the OAuth2 login process",
928 "oauth_url_auth": RestConnection::ConnectionScheme.options.oauth2_auth_url + <ConnectionOptionInfo>{
931 "oauth_url_token": RestConnection::ConnectionScheme.options.oauth2_token_url + <ConnectionOptionInfo>{
934 "oauth_url_revoke": <ConnectionOptionInfo>{
936 "desc":
"the OAuth logout / revoke token URL",
939 "oauth2_grant_type": RestConnection::ConnectionScheme.options.oauth2_grant_type
940 + <ConnectionOptionInfo>{
943 "oauth2_scopes": RestConnection::ConnectionScheme.options.oauth2_scopes
944 + <ConnectionOptionInfo>{
947 "password": RestConnection::ConnectionScheme.options.
"password" + <ConnectionOptionInfo>{
948 "desc":
"the Salesforce.com password (will override any password in the URL)",
951 "ping_method": RestConnection::ConnectionScheme.options.
"ping_method" + <ConnectionOptionInfo>{
952 "default_value":
"GET",
954 "ping_path": RestConnection::ConnectionScheme.options.
"ping_path" + <ConnectionOptionInfo>{
955 "default_value":
"/services/data",
957 "username": RestConnection::ConnectionScheme.options.
"username" + <ConnectionOptionInfo>{
958 "desc":
"the Salesforce.com username (will override any username in the URL)",
962 "required_options":
"client_id,client_secret",
971 "oauth2_auto_refresh":
"oauth2_auto_refresh",
972 "oauth2_auth_args":
"oauth2_auth_args",
973 "oauth_url_auth":
"oauth2_auth_url",
974 "client_id":
"oauth2_client_id",
975 "client_secret":
"oauth2_client_secret",
976 "oauth2_redirect_url":
"oauth2_redirect_url",
977 "oauth2_refresh_token":
"oauth2_refresh_token",
978 "oauth2_scopes":
"oauth2_scopes",
979 "oauth_url_token":
"oauth2_token_url",
980 "password":
"password",
981 "username":
"username",
999 constructor(
string name,
string description,
string url, hash<auto> attributes = {}, hash<auto> options = {})
1103 gotOAuth2LoginInfo(hash<auto> h);
*hash< auto > getUpdateOptionsAfterLogin(hash< auto > h)
Returns options to update after an OAuth2 login.
constructor(*hash< auto > opts, *softbool do_not_connect)
creates the object with the given options
setOAuth2LoginInfo(hash< auto > h)
Sets options from the OAuth2 login response on the local object.
static string getBulkDate(date d)
returns a date string for use with Salesforce.com Bulk REST API requests
checkLogin(*reference< hash< auto > > info)
Checks if a login is necessary; if so, then the login is performed.
hash< auto > bulkJobAddBatch(string jobid, data batch_data, string job_content_type, *reference< hash< auto > > info, *hash< auto > hdr)
add a batch to a job using the Bulk REST API
login(*reference< hash< auto > > info)
logs in to Salesforce.com with the credentials provided in the constructor()
*hash< auto > getOAuth2AuthHeaders()
Returns headers to use with OAuth2 authorization / token requests.
*string getApi()
returns the Salesforce.com REST API version currently in use
static hash getOptions(*hash< auto > opts)
returns options for the RestClient::constructor()
static string getGmtDate(date d)
returns a date string in GMT for use in Salesforce.com requests
string oauth_url_revoke
Salesforce.com OAuth2 Revoke Token URL.
Definition: SalesforceRestClient.qm.dox.h:337
processApis(*list< auto > apis)
Process the API response from Salesforce and set / verify the client's API level.
string api_used
Salesforce.com REST API version currently in use.
Definition: SalesforceRestClient.qm.dox.h:352
setVerifyApi()
Sets / verifies the api level and sets the application URL accordingly.
logout(*reference< hash< auto > > info)
logs out of Salesforce.com by revoking the access token
hash< auto > bulkGet(string path, auto body, *reference< hash< auto > > info, *hash< auto > hdr)
sends an HTTP GET request to the REST server using the Salesforce.com Bulk REST API and returns the r...
checkClientOptions(hash< auto > opts)
verifies that the options passed match the configured options
hash< string, hash< auto > > api_hash
hash of APIs retrieved from GET /services/data; keyed by API version string; values: "label",...
Definition: SalesforceRestClient.qm.dox.h:358
string client_secret
Salesforce.com "consumer secret".
Definition: SalesforceRestClient.qm.dox.h:346
string client_id
Salesforce.com "consumer key".
Definition: SalesforceRestClient.qm.dox.h:343
hash< auto > bulkPost(string path, auto body, *reference< hash< auto > > info, *hash< auto > hdr)
sends an HTTP POST request to the REST server using the Salesforce.com Bulk REST API and returns the ...
hash< auto > doBulkRequest(string m, string path, auto body, *reference< hash< auto > > info, softbool decode_errors=True, *hash< auto > hdr)
sends a Bulk API REST request to the Salesforce.com server using "rawxml" serialization and returns t...
Mutex m()
Mutex for token acquisition.
const Defaults
defaults for direct member values
Definition: SalesforceRestClient.qm.dox.h:304
string oauth_url_auth
Salesforce.com OAuth2 Authorization URL.
Definition: SalesforceRestClient.qm.dox.h:331
string api
Salesforce.com REST API version to be used ("auto" = latest version)
Definition: SalesforceRestClient.qm.dox.h:349
hash< auto > bulkJobClose(string jobid, *reference< hash< auto > > info, *hash< auto > hdr)
sends a Bulk REST API job close POST request to the server and returns the deserialized result messag...
hash< auto > patch(string path, auto body, *reference< hash< auto > > info, *hash< auto > hdr)
sends an HTTP PATCH request to the Salesforce.com REST server and returns the response; performs an i...
setApi()
Checks the API and sets the final URL.
hash< auto > loginIntern(*reference< hash > info)
performs authentication and authorization with Salesforce.com using the OAuth2 authorization URL
hash< auto > bulkJobCreate(string operation, string object, string job_content_type, *reference< hash< auto > > info, *hash< auto > hdr)
creates a Salesforce.com batch job and returns the job information as a hash
hash< auto > doRequest(string m, string path, auto body, *reference< hash< auto > > info, softbool decode_errors=True, *hash< auto > hdr)
sends an HTTP request to the REST server and returns the response; performs an implicit login to Sale...
string instance_url
The instance URL.
Definition: SalesforceRestClient.qm.dox.h:355
string oauth_url_token
Salesforce.com OAuth2 Get Token URL.
Definition: SalesforceRestClient.qm.dox.h:334
*hash< string, hash< auto > > getApis()
Return available APIs as a hash.
class for Salesforce.com REST connections; returns SalesforceRestClient::SalesforceRestClient objects
Definition: SalesforceRestClient.qm.dox.h:901
SalesforceRestClient getImpl(bool connect=True, *hash< auto > rtopts)
returns a SalesforceRestClient::SalesforceRestClient object
const OAuth2Options
Maps Salesforce REST options to standard options.
Definition: SalesforceRestClient.qm.dox.h:970
const OAuth2AuthRequestOptions
options required to support the OAuth2 authorization code grant flow
Definition: SalesforceRestClient.qm.dox.h:966
constructor(string name, string description, string url, hash< auto > attributes={}, hash< auto > options={})
creates the SalesforceRestConnection connection object
hash< ConnectionSchemeInfo > getConnectionSchemeInfoImpl()
Returns the ConnectionSchemeInfo hash for this object.
Qore::AbstractPollOperation startPollConnect()
Called to start a non-blocking polling ping operation on the remote REST server.
string getType()
returns "sfrests"
hash< auto > getOAuth2Options()
Returns OAuth2 options in a standard format.
const ConnectionScheme
Connection entry info.
Definition: SalesforceRestClient.qm.dox.h:905
const OAuth2DifferentOptionMap
Different OAuth2 option map; standard name => extern name.
Definition: SalesforceRestClient.qm.dox.h:988
setChildCapabilities()
Sets child data provider capabilities.
*hash< auto > processOAuth2TokenResponseImpl(hash< auto > resp)
Processes OAuth2 login responses and returns updated options.
bool hasDataProvider()
returns True as this connection returns a data provider with the getDataProvider() method
checkAuthCodeFeature()
Sets the auth code feature if supported.
const OAuth2StandardToSalesforceOptionMap
Maps standard option names to Salesforce REST option names.
Definition: SalesforceRestClient.qm.dox.h:985
DataProvider::AbstractDataProvider getDataProvider()
returns a data provider object for this connection
string getOAuth2OptionName(string opt)
Returns the OAuth2 option name for this connection.
REST ping polling I/O class with OAuth2 authentication.
Definition: SalesforceRestClient.qm.dox.h:1083
const SPS_GET_APIS
Get available APIs.
Definition: SalesforceRestClient.qm.dox.h:1088
const BulkJobZipCsv
Salesforce.com bulk job "ZIP_CSV" content type.
Definition: SalesforceRestClient.qm.dox.h:227
const BulkJobCsv
Definition: SalesforceRestClient.qm.dox.h:218
const BulkJobXml
Salesforce.com bulk job "XML" content type.
Definition: SalesforceRestClient.qm.dox.h:224
const BulkJobJson
Salesforce.com bulk job "JSON" content type.
Definition: SalesforceRestClient.qm.dox.h:221
const BulkJobZipJson
Salesforce.com bulk job "ZIP_JSON" content type.
Definition: SalesforceRestClient.qm.dox.h:230
const BulkJobZipXml
Salesforce.com bulk job "ZIP_XML" content type.
Definition: SalesforceRestClient.qm.dox.h:233
const BulkJobQuery
Definition: SalesforceRestClient.qm.dox.h:183
const BulkJobUpsert
Salesforce.com bulk job "upsert" operation.
Definition: SalesforceRestClient.qm.dox.h:192
const BulkJobDelete
Salesforce.com bulk job "delete" operation.
Definition: SalesforceRestClient.qm.dox.h:195
const BulkJobInsert
Salesforce.com bulk job "insert" operation.
Definition: SalesforceRestClient.qm.dox.h:186
const BulkJobUpdate
Salesforce.com bulk job "update" operation.
Definition: SalesforceRestClient.qm.dox.h:189
the SalesforceRestClient namespace contains all the objects in the SalesforceRestClient module
Definition: SalesforceRestClient.qm.dox.h:178
const BulkJobContentTypes
a hash of Salesforce.com bulk job content types; keys are Salesforce.com Bulk REST API Job Content Ty...
Definition: SalesforceRestClient.qm.dox.h:245
const BulkJobOperations
a hash of Salesforce.com bulk job operations; keys are Salesforce.com Bulk REST API Job Operations
Definition: SalesforceRestClient.qm.dox.h:206