This is the core functionality of Xrm-WebApi-Client
No instantiation needed, it's a singleton.
- Source:
Classes
Members
(static) WebApiClient.ApiVersion
- Source:
The API version that will be used when sending requests. Default is "8.0"
(static) WebApiClient.Async
- Source:
Set to false for sending all requests synchronously. True by default.
(static) WebApiClient.ClientUrl
- Source:
Connection to use when being used in a single page app.
(static) WebApiClient.PrettifyErrors
- Source:
Set to true for retrieving formatted error in style 'xhr.statusText: xhr.error.Message'. If set to false, error json will be returned.
(static) WebApiClient.ReturnAllPages
- Source:
Checks for more pages when retrieving results. If set to true, all pages will be retrieved, if set to false, only the first page will be retrieved.
(static) WebApiClient.Token
- Source:
Token to use for authenticating when being used in a single page app.
(static) WebApiClient.Version
- Source:
Informs about which version of WebApiClient you're using
Methods
(static) AppendToDefaultHeaders(…var_args) → {void}
- Source:
Function for building the set name of a given entity name.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
var_args |
Object |
<repeatable> |
Headers as variable arguments |
Returns:
- Type
- void
(static) Associate(parameters) → {Promise.<String>|String}
- Source:
Associates given records in CRM.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parameters |
Object | Parameters for associating records Properties
|
Returns:
- Returns Promise
if async, just String if sent synchronously.
- Type
- Promise.<String> | String
(static) Configure(configuration) → {void}
- Source:
Applies configuration to WebApiClient.
Parameters:
Name | Type | Description |
---|---|---|
configuration |
Object | Object with keys named after WebApiClient Members, such as "Token"s |
Returns:
- Type
- void
(static) Create(parameters) → {Promise.<String>|Promise.<object>|String|Object}
- Source:
Creates a given record in CRM.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parameters |
Object | Parameters for creating record Properties
|
Returns:
- Returns Promise
- Type
- Promise.<String> | Promise.<object> | String | Object
(static) Delete(parameters) → {Promise.<String>|String}
- Source:
Deletes a given record in CRM.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parameters |
Object | Parameters for deleting record Properties
|
Returns:
- Returns Promise
if async, just String if sent synchronously.
- Type
- Promise.<String> | String
(static) Disassociate(parameters) → {Promise.<String>|String}
- Source:
Disassociates given records in CRM.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parameters |
Object | Parameters for disassociating records Properties
|
Returns:
- Returns Promise
if async, just String if sent synchronously.
- Type
- Promise.<String> | String
(static) Execute(request) → {Promise.<Object>|Object}
- Source:
Executes the given request in CRM.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object | Request to send, must be in prototype chain of WebApiClient.Requests.Request. Properties
|
Returns:
- Returns Promise
- Type
- Promise.<Object> | Object
(static) Expand(parameters) → {Promise.<Object>|Object}
- Source:
Expands all odata.nextLink (deferred) properties for an array of records.
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parameters |
Object | Configuration for expanding Properties
|
Returns:
- Returns Promise
- Type
- Promise.<Object> | Object
(static) GetApiUrl() → {String}
- Source:
Gets the current base API url that is used.
Returns:
- Type
- String
(static) GetDefaultHeaders() → {Array.<{key: String, value:String}>}
- Source:
Returns array of default headers.
Returns:
- Type
- Array.<{key: String, value:String}>
(static) GetSetName(entityName, overriddenSetNameopt) → {String}
- Source:
Builds the set name of a given entity name.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
entityName |
String | Logical name of the entity, such as "account" |
|
overriddenSetName |
String |
<optional> |
Override set name if it can't be infered from plural rules |
Returns:
- Type
- String
(static) Retrieve(parameters) → {Promise.<object>|Object}
- Source:
Retrieves records from CRM
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parameters |
Object | Parameters for retrieving records Properties
|
Returns:
- Returns Promise
- Type
- Promise.<object> | Object
(static) SendBatch(batch) → {Promise.<Object>|Object}
- Source:
Sends the given batch to CRM.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
batch |
Object | Batch to send to CRM Properties
|
Returns:
- Returns Promise
- Type
- Promise.<Object> | Object
(static) SendRequest(method, url, payloadopt, parametersopt) → {Promise.<Object>|Object}
- Source:
Sends request using given parameters.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
method |
String | Method type of request to send, such as "GET" |
|||||||||||||
url |
String | Target URL for request. |
|||||||||||||
payload |
Object |
<optional> |
Payload for request. |
||||||||||||
parameters |
Object |
<optional> |
Parameters for sending the request Properties
|
Returns:
- Type
- Promise.<Object> | Object
(static) Update(parameters) → {Promise.<String>|Promise.<object>|String|Object}
- Source:
Updates a given record in CRM.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parameters |
Object | Parameters for updating record Properties
|
Returns:
- Returns Promise
- Type
- Promise.<String> | Promise.<object> | String | Object