Users

Manage individual user accounts.

Register user

Register a user account.

Request
Request Body schema: application/json
email
string
invitationToken
string
name
string
optIntoMarketingEmail
string
password
string
Responses
200

OK

put/api/user
Request samples
application/json
{
  • "email": "stan@example.com",
  • "invitationToken": "ca7a096c9e9d549fffdc2bc01623dc446ac2925040639d6c7dde64d437bd6005",
  • "name": "stan",
  • "optIntoMarketingEmail": "true",
  • "password": "Password1"
}
Response samples
application/json
{
  • "id": "58980a25a77b4d7bf459d100",
  • "username": "stella",
  • "name": "Stella",
  • "email": "stella@example.com"
}

Get User

Retrieve user account details.

Request
path Parameters
username
required
string
Example: stan
Responses
200

OK

get/api/user/{username}
Response samples
application/json
{
  • "id": "58980a25a77b4d7bf459d100",
  • "username": "stella",
  • "name": "Stella",
  • "email": "stella@example.com"
}

Update user

Update user account details.

Request
query Parameters
username
required
string
Example: username=stan
Request Body schema: application/json
tags
string
avatar
string

An avatar URL for this user. This must be the same URL as provided by a [File Upload][].

background
string
company.address
string
company.businessType
string
company.city
string
company.clientId
string
company.companySize
string
company.dateFounded
string
company.email
string
company.fax
string
company.first
string
company.industry
string
company.last
string
company.markets
string
company.phone
string
company.privacy.community.blackListIds
any

list of company ids

company.privacy.community.whiteListIds
any

list of company ids

company.privacy.network.blackListIds
any

list of company ids

company.privacy.network.whiteListIds
any

list of company ids

company.regionalInternetRegistry
string
company.state
string
company.website
string
company.zip
string
headline
string
location
string
name
string

The new name for this user account

optIntoMarketingEmail
boolean
phone
string
role
string
settings
object

Settings object, corresponding with the settings retrieved from the GET method.

summary
string
Responses
200

OK

post/api/user/{username}
Request samples
application/json
{
  • "tags": "",
  • "avatar": "",
  • "background": "",
  • "company.address": "",
  • "company.businessType": "",
  • "company.city": "",
  • "company.clientId": "",
  • "company.companySize": "",
  • "company.dateFounded": "",
  • "company.email": "",
  • "company.fax": "",
  • "company.first": "",
  • "company.industry": "",
  • "company.last": "",
  • "company.markets": "",
  • "company.phone": "",
  • "company.privacy.community.blackListIds": [ ],
  • "company.privacy.community.whiteListIds": [ ],
  • "company.privacy.network.blackListIds": [ ],
  • "company.privacy.network.whiteListIds": [ ],
  • "company.regionalInternetRegistry": "",
  • "company.state": "",
  • "company.website": "",
  • "company.zip": "",
  • "headline": "",
  • "location": "",
  • "name": "",
  • "optIntoMarketingEmail": false,
  • "phone": "",
  • "role": "",
  • "settings": { },
  • "summary": ""
}
Response samples
application/json
{
  • "id": "58980a25a77b4d7bf459d100",
  • "username": "stella",
  • "name": "Stella",
  • "email": "stella@example.com"
}

Socket.io Updates

All user responses have a online boolean added on. This reflects weather or not they are connected to the server over socket.io on the /user namespace. To go online as a user & subscribe to other users' connection updates:

var userIO = io.connect('http://api.brant.dev.eng.iix.net/user');
var username = 'CURRENT_LOGGED_IN_USERNAME';
var token = 'CURRENT_LOGGED_IN_PORTAL_TOKEN';

userIO.on('connect', function() {

    // Signal that you are online
    userIO.emit('online', {
       'username': username,
       'portal-token': token
    });

    socket.on('online-status-changed', function ( _data ) {
        console.log('User "' + _data.username + '" has gone ' + ( _data.online ? 'online' : 'offline' ));
    });

});
Responses
200

OK

get/user
Response samples
text/event-stream