-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
24 lines (22 loc) · 643 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
var request = require('request');
let config = require('./config.json');
var options = {
'method': 'POST',
'url': `${config.url}/api/application/users`,
'headers': {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': `Bearer ${config.token}`
},
body: JSON.stringify({
"email": "example10@example.com",
"username": "exampleuser",
"first_name": "Example",
"last_name": "User"
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
console.log(`User created with id: ${JSON.parse(response.body).id}`);
});