eLabSDK.API
call(options)
Basic method to make any kind of API call. See {{#crossLink "eLabSDK.API.Call"}}{{/crossLink}} for the options that you can set.
Note: include body in the options object to add a request body.
Kind: global function
Returns: XMLHttpRequest
- The XHR object which was used to execute the call.
Param | Type | Description |
---|---|---|
options | object | See {{#crossLink "eLabSDK.API.Call"}}{{/crossLink}}. May include a 'body' parameter. |
Example
eLabSDK.API.call({
method: 'POST',
path: 'samples',
body: {
sampleTypeID: 123,
name: 'My sample'
},
onSuccess: function (xhr, status, response) {
// response is an integer indicating the new sample's ID.
var newSampleID = response;
}
});
© 2023 eLabNext
Updated 10 months ago