Skip to content

Commit

Permalink
add team management api calls
Browse files Browse the repository at this point in the history
  • Loading branch information
delabiejochen committed Mar 24, 2023
1 parent a2b1c48 commit 05d1d03
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 0 deletions.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,48 @@ Retrieves all screenshots previously generate with your account
api.getScreenshotList(function(error, screenshots) {}, offset, limit);
```

### getTeam
Retrieves team information

```javascript
api.getTeam(function(error, data) {});
```

### getUsersInTeam
Get all users in your team

```javascript
api.getUsersInTeam(function(error, users) {});
```

### getUserFromTeam
Retrieves information about a specific user in your team

```javascript
api.getUserFromTeam(userId, function(error, user) {});
```

### createUserInTeam
Add a user to your team. You need ADMIN rights for this.

```javascript
api.createUserInTeam(user, function(error, result) {});
```

### updateUserInTeam
Update a user in your team. You need ADMIN rights for this.

```javascript
api.updateUserInTeam(userId, userData, function(error, result) {});
```

### resetCredentials
Resets credentials for a specific user in your team. You need ADMIN rights for this.

```javascript
api.resetCredentials(userId, function(error, result) {});
```

## Tests

``npm test``
Expand Down
48 changes: 48 additions & 0 deletions lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,54 @@ TestingBot.prototype.uploadFile = function(localFilePath, callback) {
});
};

TestingBot.prototype.getTeam = function(callback) {
this.request({
method: 'GET',
url: '/team-management'
}, callback);
};

TestingBot.prototype.getUsersInTeam = function(callback) {
this.request({
method: 'GET',
url: '/team-management/users'
}, callback);
};

TestingBot.prototype.getUserFromTeam = function(userId, callback) {
this.request({
method: 'GET',
url: '/team-management/users/' + userId
}, callback);
};

TestingBot.prototype.createUserInTeam = function(user, callback) {
this.request({
method: 'POST',
url: '/team-management/users/',
data: {
user: user
}
}, callback);
};

TestingBot.prototype.updateUserInTeam = function(userId, userData, callback) {
this.request({
method: 'PUT',
url: '/team-management/users/' + userId,
data: {
user: userData
}
}, callback);
};

TestingBot.prototype.resetCredentials = function(userId, callback) {
this.request({
method: 'POST',
url: '/team-management/users/' + userId + '/reset-keys'
}, callback);
};

TestingBot.prototype.getStorageFile = function(appUrl, callback) {
this.request({
method: 'GET',
Expand Down

0 comments on commit 05d1d03

Please sign in to comment.