-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathcreate_jobs.js
More file actions
30 lines (25 loc) · 852 Bytes
/
create_jobs.js
File metadata and controls
30 lines (25 loc) · 852 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const { Client } = require('@xdevplatform/xdk');
// The code below sets the bearer token from your environment variables
// To set environment variables on macOS or Linux, run the export command below from the terminal:
// export BEARER_TOKEN='YOUR-TOKEN'
const token = process.env.BEARER_TOKEN;
const client = new Client({ bearerToken: token });
// For User Compliance Job, replace type value with users instead of tweets
// Also replace the name value with your desired job name
const data = {
type: "tweets",
name: 'my_batch_compliance_job'
};
(async () => {
try {
// Make request
const response = await client.compliance.createJobs(data);
console.dir(response, {
depth: null
});
} catch (e) {
console.log(e);
process.exit(-1);
}
process.exit();
})();