README
dropsolid-personalisation-sdk-node
Node module which works as a wrapper for dropsolid's personalisation API.
:::info The uuid values used in these examples are not the actual values. :::
Build
- Open the folder
cd dropsolid-personalisation-sdk-node/
- Install dependencies
npm install
- Build the module
npm run build
Connect to the API
You can connect to the API using the connectAPI
function:
import { connectAPI } from "../node_modules/dropsolid-personalisation-sdk-node";
const baseUrl = "https://api.example.com";
const bearerToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c";
const apisdk = connectAPI({
url: baseUrl,
auth: {
bearerToken: bearerToken
}
});
Functions
Cdp
getAll
Get all cdps.
Usage
const sortOrder = <string>;
const limit = <int>;
const offset = <int>;
apisdk.cdp.getAll(sortOrder, limit, offset);
Response
// success
{
statusCode: 200,
responseData: <object>
}
// no success
{
statusCode: <int>,
errorMessage: <string>,
errors: <object[]>,
exception: <string | null>,
response: <object>
}
// exception in module
{
statusCode: 500,
errorMessage: <string>,
errors: <object[]>,
exception: <string>,
response: {
method: <string>,
url: <string>,
body: <object | null>,
successStatus: <int>
}
}
Real World Example
const sortOrder = "asc";
const limit = 10;
const offset = 0;
const cdps = apisdk.cdp.getAll(sortOrder, limit, offset);
cdps.then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});
get
Get a cdp.
Usage
const cdpUuid = <string>;
apisdk.cdp.get(cdpUuid);
Response
// success
{
statusCode: 200,
responseData: <object>
}
// no success
{
statusCode: <int>,
errorMessage: <string>,
errors: <object[]>,
exception: <string | null>,
response: <object>
}
// exception in module
{
statusCode: 500,
errorMessage: <string>,
errors: <object[]>,
exception: <string>,
response: {
method: <string>,
url: <string>,
body: <object | null>,
successStatus: <int>
}
}
Real World Example
const cdpUuid = "f302827e-4276-11ea-b77f-2e728ce88125";
const cdp = apisdk.cdp.get(cdpUuid);
cdp.then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});
create
Create a cdp.
Usage
const body = {
uuid: <string>,
billing_label: <string>,
domains: <string[]>,
unomi_base_url: <string>,
region: <string>,
process_captures: <string>,
num_workers: <string>,
max_workers: <string>,
machine_type: <string>,
session_gap: <string>,
after_count: <string>,
features: [
{
"_name": <string>,
"_order": <number>
}
]
};
apisdk.cdp.create(body);
Response
// success
{
statusCode: 201,
responseData: <object>
}
// no success
{
statusCode: <int>,
errorMessage: <string>,
errors: <object[]>,
exception: <string | null>,
response: <object>
}
// exception in module
{
statusCode: 500,
errorMessage: <string>,
errors: <object[]>,
exception: <string>,
response: {
method: <string>,
url: <string>,
body: <object | null>,
successStatus: <int>
}
}
Real World Example
const body = {
uuid: "f302827e-4276-11ea-b77f-2e728ce88125",
billing_label: "company_a",
domains: [
"www.example.com",
"example.com",
"www.example.be",
"example.be"
],
unomi_base_url: "https://unomi.example.com",
region: "europe-west1",
process_captures: "on",
num_workers: "1",
max_workers: "3",
machine_type: "n1-standard-1",
session_gap: "22",
after_count: "1",
features: [
{
"_name": "language_detection",
"_order": 1
},
{
"_name": "geolocation"
}
]
};
const cdp = apisdk.cdp.create(body);
cdp.then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});
update
Update a cdp in the database.
:::warning This will not affect the personalisation components for the CDP.
See the set
functions below to change a property of a personalisation component.
:::
Usage
const cdpUuid = <string>;
const body = {
billing_label: <string>,
created: <string>,
region: <string>,
state: <string>
};
apisdk.cdp.update(cdpUuid, body);
Response
// success
{
statusCode: 200,
responseData: <object>
}
// no success
{
statusCode: <int>,
errorMessage: <string>,
errors: <object[]>,
exception: <string | null>,
response: <object>
}
// exception in module
{
statusCode: 500,
errorMessage: <string>,
errors: <object[]>,
exception: <string>,
response: {
method: <string>,
url: <string>,
body: <object | null>,
successStatus: <int>
}
}
Real World Example
const cdpUuid = "f302827e-4276-11ea-b77f-2e728ce88125";
const body = {
billing_label: "company_a",
created: "2020-02-01 09:15:28",
region: "europe-west1",
state: "UPDATING"
};
const cdp = apisdk.cdp.update(cdpUuid, body);
cdp.then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});
setBillingLabel
Update billing label of a cdp.
Usage
const cdpUuid = <string>;
const body = {
billing_label: <string>
};
apisdk.cdp.setBillingLabel(cdpUuid, body);
Response
// success
{
statusCode: 201,
responseData: <object>
}
// no success
{
statusCode: <int>,
errorMessage: <string>,
errors: <object[]>,
exception: <string | null>,
response: <object>
}
// exception in module
{
statusCode: 500,
errorMessage: <string>,
errors: <object[]>,
exception: <string>,
response: {
method: <string>,
url: <string>,
body: <object | null>,
successStatus: <int>
}
}
Real World Example
const cdpUuid = "f302827e-4276-11ea-b77f-2e728ce88125";
const body = {
billing_label: "company_a"
};
const cdp = apisdk.cdp.setBillingLabel(cdpUuid, body);
cdp.then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});
setDomains
Update domains of a cdp.
Usage
const cdpUuid = <string>;
const body = {
domains: <string[]>
};
apisdk.cdp.setDomains(cdpUuid, body);
Response
// success
{
statusCode: 201,
responseData: <object>
}
// no success
{
statusCode: <int>,
errorMessage: <string>,
errors: <object[]>,
exception: <string | null>,
response: <object>
}
// exception in module
{
statusCode: 500,
errorMessage: <string>,
errors: <object[]>,
exception: <string>,
response: {
method: <string>,
url: <string>,
body: <object | null>,
successStatus: <int>
}
}
Real World Example
const cdpUuid = "f302827e-4276-11ea-b77f-2e728ce88125";
const body = {
domains: [
"www.example.com",
"example.com",
"www.example.be",
"example.be"
]
};
const cdp = apisdk.cdp.setDomains(cdpUuid, body);
cdp.then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});
setUnomiBaseUrl
Update unomi base url of a cdp.
Usage
const cdpUuid = <string>;
const body = {
unomi_base_url: <string>
};
apisdk.cdp.setUnomiBaseUrl(cdpUuid, body);
Response
// success
{
statusCode: 201,
responseData: <object>
}
// no success
{
statusCode: <int>,
errorMessage: <string>,
errors: <object[]>,
exception: <string | null>,
response: <object>
}
// exception in module
{
statusCode: 500,
errorMessage: <string>,
errors: <object[]>,
exception: <string>,
response: {
method: <string>,
url: <string>,
body: <object | null>,
successStatus: <int>
}
}
Real World Example
const cdpUuid = "f302827e-4276-11ea-b77f-2e728ce88125";
const body = {
unomi_base_url: "https://unomi.example.com"
};
const cdp = apisdk.cdp.setUnomiBaseUrl(cdpUuid, body);
cdp.then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});
setProcessCaptures
Update capture process status of a cdp.
Usage
const cdpUuid = <string>;
const body = {
process_captures: <string>
};
apisdk.cdp.setProcessCaptures(cdpUuid, body);
Response
// success
{
statusCode: 201,
responseData: <object>
}
// no success
{
statusCode: <int>,
errorMessage: <string>,
errors: <object[]>,
exception: <string | null>,
response: <object>
}
// exception in module
{
statusCode: 500,
errorMessage: <string>,
errors: <object[]>,
exception: <string>,
response: {
method: <string>,
url: <string>,
body: <object | null>,
successStatus: <int>
}
}
Real World Example
const cdpUuid = "f302827e-4276-11ea-b77f-2e728ce88125";
const body = {
process_captures: "on"
};
const cdp = apisdk.cdp.setProcessCaptures(cdpUuid, body);
cdp.then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});
setFeatures
Update features of a cdp.
Usage
const cdpUuid = <string>;
const body = {
features: [
{
"_name": <string>,
"_order": <number>
}
]
};
apisdk.cdp.setFeatures(cdpUuid, body);
Response
// success
{
statusCode: 201,
responseData: <object>
}
// no success
{
statusCode: <int>,
errorMessage: <string>,
errors: <object[]>,
exception: <string | null>,
response: <object>
}
// exception in module
{
statusCode: 500,
errorMessage: <string>,
errors: <object[]>,
exception: <string>,
response: {
method: <string>,
url: <string>,
body: <object | null>,
successStatus: <int>
}
}
Real World Example
const cdpUuid = "f302827e-4276-11ea-b77f-2e728ce88125";
const body = {
features: [
{
"_name": "language_detection",
"_order": 1
},
{
"_name": "geolocation"
}
]
};
const cdp = apisdk.cdp.setFeatures(cdpUuid, body);
cdp.then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});
setNumWorkers
Update number of workers of a cdp.
Usage
const cdpUuid = <string>;
const body = {
num_workers: <string>
};
apisdk.cdp.setNumWorkers(cdpUuid, body);
Response
// success
{
statusCode: 201,
responseData: <object>
}
// no success
{
statusCode: <int>,
errorMessage: <string>,
errors: <object[]>,
exception: <string | null>,
response: <object>
}
// exception in module
{
statusCode: 500,
errorMessage: <string>,
errors: <object[]>,
exception: <string>,
response: {
method: <string>,
url: <string>,
body: <object | null>,
successStatus: <int>
}
}
Real World Example
const cdpUuid = "f302827e-4276-11ea-b77f-2e728ce88125";
const body = {
num_workers: "1"
};
const cdp = apisdk.cdp.setNumWorkers(cdpUuid, body);
cdp.then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});
setMaxWorkers
Update maximum number of workers of a cdp.
Usage
const cdpUuid = <string>;
const body = {
max_workers: <string>
};
apisdk.cdp.setMaxWorkers(cdpUuid, body);
Response
// success
{
statusCode: 201,
responseData: <object>
}
// no success
{
statusCode: <int>,
errorMessage: <string>,
errors: <object[]>,
exception: <string | null>,
response: <object>
}
// exception in module
{
statusCode: 500,
errorMessage: <string>,
errors: <object[]>,
exception: <string>,
response: {
method: <string>,
url: <string>,
body: <object | null>,
successStatus: <int>
}
}
Real World Example
const cdpUuid = "f302827e-4276-11ea-b77f-2e728ce88125";
const body = {
max_workers: "3"
};
const cdp = apisdk.cdp.setMaxWorkers(cdpUuid, body);
cdp.then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});
setMachineType
Update worker machine type of a cdp.
Usage
const cdpUuid = <string>;
const body = {
machine_type: <string>
};
apisdk.cdp.setMachineType(cdpUuid, body);
Response
// success
{
statusCode: 201,
responseData: <object>
}
// no success
{
statusCode: <int>,
errorMessage: <string>,
errors: <object[]>,
exception: <string | null>,
response: <object>
}
// exception in module
{
statusCode: 500,
errorMessage: <string>,
errors: <object[]>,
exception: <string>,
response: {
method: <string>,
url: <string>,
body: <object | null>,
successStatus: <int>
}
}
Real World Example
const cdpUuid = "f302827e-4276-11ea-b77f-2e728ce88125";
const body = {
machine_type: "n1-standard-1"
};
const cdp = apisdk.cdp.setMachineType(cdpUuid, body);
cdp.then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});
setSessionGap
Update session gap of a cdp.
Usage
const cdpUuid = <string>;
const body = {
session_gap: <string>
};
apisdk.cdp.setSessionGap(cdpUuid, body);
Response
// success
{
statusCode: 201,
responseData: <object>
}
// no success
{
statusCode: <int>,
errorMessage: <string>,
errors: <object[]>,
exception: <string | null>,
response: <object>
}
// exception in module
{
statusCode: 500,
errorMessage: <string>,
errors: <object[]>,
exception: <string>,
response: {
method: <string>,
url: <string>,
body: <object | null>,
successStatus: <int>
}
}
Real World Example
const cdpUuid = "f302827e-4276-11ea-b77f-2e728ce88125";
const body = {
session_gap: "22"
};
const cdp = apisdk.cdp.setSessionGap(cdpUuid, body);
cdp.then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});
setAfterCount
Update count until classification of a cdp.
Usage
const cdpUuid = <string>;
const body = {
after_count: <string>
};
apisdk.cdp.setAfterCount(cdpUuid, body);
Response
// success
{
statusCode: 201,
responseData: <object>
}
// no success
{
statusCode: <int>,
errorMessage: <string>,
errors: <object[]>,
exception: <string | null>,
response: <object>
}
// exception in module
{
statusCode: 500,
errorMessage: <string>,
errors: <object[]>,
exception: <string>,
response: {
method: <string>,
url: <string>,
body: <object | null>,
successStatus: <int>
}
}
Real World Example
const cdpUuid = "f302827e-4276-11ea-b77f-2e728ce88125";
const body = {
after_count: "1"
};
const cdp = apisdk.cdp.setAfterCount(cdpUuid, body);
cdp.then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});
delete
Delete a cdp.
:::danger This deletes everything related to the cdp in the personalisation cloud environment. :::
Usage
const cdpUuid = <string>;
apisdk.cdp.delete(cdpUuid);
Response
// success
{
statusCode: 204,
responseData: <object>
}
// no success
{
statusCode: <int>,
errorMessage: <string>,
errors: <object[]>,
exception: <string | null>,
response: <object>
}
// exception in module
{
statusCode: 500,
errorMessage: <string>,
errors: <object[]>,
exception: <string>,
response: {
method: <string>,
url: <string>,
body: <object | null>,
successStatus: <int>
}
}
Real World Example
const cdpUuid = "f302827e-4276-11ea-b77f-2e728ce88125";
const cdp = apisdk.cdp.delete(cdpUuid);
cdp.then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});
Model
getAll
Get all models.
Usage
const cdpUuid = <string>;
const sortOrder = <string>;
const orderBy = <string>;
const limit = <int>;
const offset = <int>;
apisdk.model.getAll(cdpUuid, sortOrder, orderBy, limit, offset);
Response
// success
{
statusCode: 200,
responseData: <object>
}
// no success
{
statusCode: <int>,
errorMessage: <string>,
errors: <object[]>,
exception: <string | null>,
response: <object>
}
// exception in module
{
statusCode: 500,
errorMessage: <string>,
errors: <object[]>,
exception: <string>,
response: {
method: <string>,
url: <string>,
body: <object | null>,
successStatus: <int>
}
}
Real World Example
const cdpUuid = "f302827e-4276-11ea-b77f-2e728ce88125";
const sortOrder = "asc";
const orderBy = "created";
const limit = 10;
const offset = 0;
const models = apisdk.model.getAll(cdpUuid, sortOrder, orderBy, limit, offset);
models.then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});
get
Get a model.
Usage
const cdpUuid = <string>;
const modelUuid = <string>;
apisdk.model.get(cdpUuid, modelUuid);
Response
// success
{
statusCode: 200,
responseData: <object>
}
// no success
{
statusCode: <int>,
errorMessage: <string>,
errors: <object[]>,
exception: <string | null>,
response: <object>
}
// exception in module
{
statusCode: 500,
errorMessage: <string>,
errors: <object[]>,
exception: <string>,
response: {
method: <string>,
url: <string>,
body: <object | null>,
successStatus: <int>
}
}
Real World Example
const cdpUuid = "f302827e-4276-11ea-b77f-2e728ce88125";
const modelUuid = "7094dd40-4281-11ea-aaef-0800200c9a66";
const model = apisdk.model.get(cdpUuid, modelUuid);
model.then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});
generate
Generate a model.
:::warning In the body keys start_date, end_date and past_days must be present.
If start_date and end_date are filled in, past_days will be ignored in the back-end.
If start_date and/or end_date are not filled in, past_days will be used in the back-end. :::
Usage
const cdpUuid = <string>;
const body = {
start_date: <string>,
end_date: <string>,
past_days: <int>,
groups_amount: <int>,
word_amount: <int>,
name: <string>
};
apisdk.model.generate(cdpUuid, body);
Response
// success
{
statusCode: 202,
responseData: <object>
}
// no success
{
statusCode: <int>,
errorMessage: <string>,
errors: <object[]>,
exception: <string | null>,
response: <object>
}
// exception in module
{
statusCode: 500,
errorMessage: <string>,
errors: <object[]>,
exception: <string>,
response: {
method: <string>,
url: <string>,
body: <object | null>,
successStatus: <int>
}
}
Real World Example
const cdpUuid = "f302827e-4276-11ea-b77f-2e728ce88125";
const body = {
start_date: "2020-01-01",
end_date: "2020-01-15",
past_days: 14
groups_amount: 4,
word_amount: 10,
name: "test-personalisation-01",
};
const model = apisdk.model.generate(cdpUuid, body);
model.then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});
activate
Activate a model.
:::warning If there is an active model in memorystore, it will be overwritten. :::
Usage
const cdpUuid = <string>;
const modelUuid = <string>;
apisdk.model.activate(cdpUuid, modelUuid);
Response
// success
{
statusCode: 204,
responseData: <object>
}
// no success
{
statusCode: <int>,
errorMessage: <string>,
errors: <object[]>,
exception: <string | null>,
response: <object>
}
// exception in module
{
statusCode: 500,
errorMessage: <string>,
errors: <object[]>,
exception: <string>,
response: {
method: <string>,
url: <string>,
body: <object | null>,
successStatus: <int>
}
}
Real World Example
const cdpUuid = "f302827e-4276-11ea-b77f-2e728ce88125";
const modelUuid = "7094dd40-4281-11ea-aaef-0800200c9a66";
const model = apisdk.model.activate(cdpUuid, modelUuid);
model.then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});
delete
Delete a model.
:::warning You cannot delete the model which is active in memorystore. :::
Usage
const cdpUuid = <string>;
const modelUuid = <string>;
apisdk.model.delete(cdpUuid, modelUuid);
Response
// success
{
statusCode: 204,
responseData: <object>
}
// no success
{
statusCode: <int>,
errorMessage: <string>,
errors: <object[]>,
exception: <string | null>,
response: <object>
}
// exception in module
{
statusCode: 500,
errorMessage: <string>,
errors: <object[]>,
exception: <string>,
response: {
method: <string>,
url: <string>,
body: <object | null>,
successStatus: <int>
}
}
Real World Example
const cdpUuid = "f302827e-4276-11ea-b77f-2e728ce88125";
const modelUuid = "7094dd40-4281-11ea-aaef-0800200c9a66";
const model = apisdk.model.delete(cdpUuid, modelUuid);
model.then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});
rename
Rename a model.
Usage
const cdpUuid = <string>;
const modelUuid = <string>;
const body = {
name: <string>
};
apisdk.model.rename(cdpUuid, modelUuid, body);
Response
// success
{
statusCode: 204,
responseData: <object>
}
// no success
{
statusCode: <int>,
errorMessage: <string>,
errors: <object[]>,
exception: <string | null>,
response: <object>
}
// exception in module
{
statusCode: 500,
errorMessage: <string>,
errors: <object[]>,
exception: <string>,
response: {
method: <string>,
url: <string>,
body: <object | null>,
successStatus: <int>
}
}
Real World Example
const cdpUuid = "f302827e-4276-11ea-b77f-2e728ce88125";
const modelUuid = "7094dd40-4281-11ea-aaef-0800200c9a66";
const body = {
name: "new-test-personalisation-01"
};
const model = apisdk.model.rename(cdpUuid, modelUuid, body);
model.then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});
Classification
getAll
Get all classifications for a model.
Usage
const cdpUuid = <string>;
const modelUuid = <string>;
apisdk.classification.getAll(cdpUuid, modelUuid);
Response
// success
{
statusCode: 200,
responseData: <object>
}
// no success
{
statusCode: <int>,
errorMessage: <string>,
errors: <object[]>,
exception: <string | null>,
response: <object>
}
// exception in module
{
statusCode: 500,
errorMessage: <string>,
errors: <object[]>,
exception: <string>,
response: {
method: <string>,
url: <string>,
body: <object | null>,
successStatus: <int>
}
}
Real World Example
const cdpUuid = "f302827e-4276-11ea-b77f-2e728ce88125";
const modelUuid = "7094dd40-4281-11ea-aaef-0800200c9a66";
const classifications = apisdk.classification.getAll(cdpUuid, modelUuid);
classifications.then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});
get
Get a classification for a model.
Usage
const cdpUuid = <string>;
const classificationUuid = <string>;
apisdk.classification.get(cdpUuid, classificationUuid);
Response
// success
{
statusCode: 200,
responseData: <object>
}
// no success
{
statusCode: <int>,
errorMessage: <string>,
errors: <object[]>,
exception: <string | null>,
response: <object>
}
// exception in module
{
statusCode: 500,
errorMessage: <string>,
errors: <object[]>,
exception: <string>,
response: {
method: <string>,
url: <string>,
body: <object | null>,
successStatus: <int>
}
}
Real World Example
const cdpUuid = "f302827e-4276-11ea-b77f-2e728ce88125";
const classificationUuid = "3bb3e3b0-4285-11ea-aaef-0800200c9a66";
const classification = apisdk.classification.get(cdpUuid, classificationUuid);
classification.then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});
rename
Rename a classification for a model.
Usage
const cdpUuid = <string>;
const modelUuid = <string>;
const classificationUuid = <string>;
const body = {
name: <string>
};
apisdk.classification.rename(cdpUuid, modelUuid, classificationUuid, body);
Response
// success
{
statusCode: 204,
responseData: <object>
}
// no success
{
statusCode: <int>,
errorMessage: <string>,
errors: <object[]>,
exception: <string | null>,
response: <object>
}
// exception in module
{
statusCode: 500,
errorMessage: <string>,
errors: <object[]>,
exception: <string>,
response: {
method: <string>,
url: <string>,
body: <object | null>,
successStatus: <int>
}
}
Real World Example
const cdpUuid = "f302827e-4276-11ea-b77f-2e728ce88125";
const modelUuid = "7094dd40-4281-11ea-aaef-0800200c9a66";
const classificationUuid = "3bb3e3b0-4285-11ea-aaef-0800200c9a66";
const body = {
name: "new-group-1"
};
const classification = apisdk.classification.rename(cdpUuid, modelUuid, classificationUuid, body);
classification.then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});
Job
getAll
Get all jobs.
Usage
const cdpUuid = <string>;
const sortOrder = <string>;
const limit = <int>;
const offset = <int>;
apisdk.job.getAll(cdpUuid, sortOrder, limit, offset);
Response
// success
{
statusCode: 200,
responseData: <object>
}
// no success
{
statusCode: <int>,
errorMessage: <string>,
errors: <object[]>,
exception: <string | null>,
response: <object>
}
// exception in module
{
statusCode: 500,
errorMessage: <string>,
errors: <object[]>,
exception: <string>,
response: {
method: <string>,
url: <string>,
body: <object | null>,
successStatus: <int>
}
}
Real World Example
const cdpUuid = "f302827e-4276-11ea-b77f-2e728ce88125";
const sortOrder = "asc";
const limit = 10;
const offset = 0;
const jobs = apisdk.job.getAll(cdpUuid, sortOrder, limit, offset);
jobs.then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});
get
Get a job.
Usage
const cdpUuid = <string>;
const jobUuid = <string>;
apisdk.job.get(cdpUuid, jobUuid);
Response
// success
{
statusCode: 200,
responseData: <object>
}
// no success
{
statusCode: <int>,
errorMessage: <string>,
errors: <object[]>,
exception: <string | null>,
response: <object>
}
// exception in module
{
statusCode: 500,
errorMessage: <string>,
errors: <object[]>,
exception: <string>,
response: {
method: <string>,
url: <string>,
body: <object | null>,
successStatus: <int>
}
}
Real World Example
const cdpUuid = "f302827e-4276-11ea-b77f-2e728ce88125";
const jobUuid = "e4a05bd8-6388-11ea-bc55-0242ac130003";
const job = apisdk.job.get(cdpUuid, jobUuid);
job.then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});
Features
getAll
Get all features.
Usage
apisdk.feature.getAll();
Response
// success
{
statusCode: 200,
responseData: <object>
}
// no success
{
statusCode: <int>,
errorMessage: <string>,
errors: <object[]>,
exception: <string | null>,
response: <object>
}
// exception in module
{
statusCode: 500,
errorMessage: <string>,
errors: <object[]>,
exception: <string>,
response: {
method: <string>,
url: <string>,
body: <object | null>,
successStatus: <int>
}
}
Real World Example
const features = apisdk.feature.getAll();
features.then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});
Task
get
Get a task.
Usage
const cdpUuid = <string>;
const taskUuid = <string>;
apisdk.task.get(cdpUuid, taskUuid);
Response
// success
{
statusCode: 200,
responseData: <object>
}
// no success
{
statusCode: <int>,
errorMessage: <string>,
errors: <object[]>,
exception: <string | null>,
response: <object>
}
// exception in module
{
statusCode: 500,
errorMessage: <string>,
errors: <object[]>,
exception: <string>,
response: {
method: <string>,
url: <string>,
body: <object | null>,
successStatus: <int>
}
}
Real World Example
const cdpUuid = "f302827e-4276-11ea-b77f-2e728ce88125";
const taskUuid = "8f478662-0f8f-4ec3-a09c-481975e50d5e";
const task = apisdk.task.get(cdpUuid, taskUuid);
task.then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});