Skip to content

Instantly share code, notes, and snippets.

@8bitDesigner
Last active February 13, 2017 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 8bitDesigner/2d51a17ad0b691b4d032265b7c54ee79 to your computer and use it in GitHub Desktop.
Save 8bitDesigner/2d51a17ad0b691b4d032265b7c54ee79 to your computer and use it in GitHub Desktop.
Print a list of Dropbox users

Usage:

./print-users.js <your API token here>

Prints out:

user1@fullscreen.com active
user3@fullscreen.com suspended
user1@fullscreen.com active
...

Installing

  1. Install NodeJS
  2. Git clone this repo (git@gist.github.com:2d51a17ad0b691b4d032265b7c54ee79.git)
  3. npm install
const request = require('request')
const token = process.argv[2]
request({
method: 'POST',
json: true,
headers: {
Authorization: `Bearer ${token}`
},
params: {
limit: 200,
include_removed: false
},
url: 'https://api.dropboxapi.com/2/team/members/list'
}, function (req, err, json) {
json.members.forEach(member => {
console.log(member.profile.email, member.profile.status['.tag'])
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment