How Do I lookup information for a given BlueJeans User?

Using REST API's by Glenn Inn

Sometimes you may have an application that needs to lookup the account information given a BlueJeans username.

This step by step guide will walk you the search process using Meeting's enterprise search API

Things to keep in mind...

BlueJeans REST API messages must contain certain formatting values in order to be recognized as valid. Please ensure that each REST call has the following fields:

Step 1

Authenticating

Get Access to the Enterprise

The first step an application must do is get Administrative access to the enterprise.

Typically this type of authentication utilizes a Client_Code OAuth process. The OAuth call will yield a enterprise user access token which becomes your software passkey to make API calls with enterprise administrative privileges.

The keys used by a Client_Code API call are generated by through the Enterprise Administrator Web Portal. Your administrator can provide you with a set of keys dedicated just to your application. You can find more information here about keys and client authentication: How-to authenticate my applications.

BlueJeans uses the industry standard OAuth protocol for authentication.

API Specification
https://api.bluejeans.com/oauth2/token?Client
JSON Calling Parameters
{
  "grant_type": "client_credentials",
  "client_id": "anEnterpriseKey",
  "client_secret": "cc1c2...24a3f04"
}
				
The function of the JSON variables are:
  • grant_type - string constant, "client_credentials" to designate the type of authentication method
  • client_id - this is one of the specific keys created by your enterprise's BlueJeans administrator specifically for this application.
  • client_secret - this field is the key created by the BlueJeans Admin portal for this specific application.
JSON Return Values
{
  "access_token": "a61e6f2842e04b9c8254428628e0e7c4",
  "expires_in": 3600,
  "scope": {
    "enterprise": 28663,
    "partitionName": "z2",
    "partition": {
      "id": 2,
      "name": "z2"
    }
  }
}
				
The returned JSON variables are:
  • access_token - this is the time-bound enterprise-wide software "passkey" to manage resources of the enterprise.
  • expires_in - this is the duration (in seconds) for the access_token to remain valid.
  • scope - this Object contains information related to the breadth of access that the access_token can engage.
    • enterprise- this is the BlueJeans internal unique integer id number for the enterprise wherein this access token applies.
    • partitionName - this is a BlueJeans internal reference
    • partition - this JSON is also BlueJeans internal information
CURL
curl -X POST "https://api.bluejeans.com/oauth2/token?Client" -H "accept: application/json" -H "content-type: application/json" -d "{ \"grant_type\": \"client_credentials\", \"client_id\": \"anEnterpriseKey\", \"client_secret\": \"cc1c2...24a3f04\"}"

Step 2(a)

Searching

Look for user from a partial string name

Perhaps you need to find the account information for a user whose name is Stavros Jones. If you do not know Stavro's email address, you can do a string search instead.

For this search, we will use the partial string "Stav" to return all accounts whose username, first name, middle name, last name, or email address contain this string

BlueJeans will return Stavros' unique account id: 1483589

Along with this API call, you must pass the access_token obtained from the Authentication step.

API Specification
https://api.bluejeans.com/v1/enterprise/{enterpriseId}/users?fields=username...&textSearch=Stav&access_token=(your access token)
Query Parameters
fields=username,firstName,middleName,lastName,isEnterpriseAdmin,email
textSearch=Stav
pageSize=10
				
The function of the Query Parameters are:
  • fields - comma-separated string : The list of account fields the API should return.
  • textSearch - string : The string by which the API should search.
  • pageSize - integer : The maximum number of matches to return.
JSON Return Values
{
  "count": 2,
  "users": [
    {
      "firstName": "Stavros",
      "lastName": "Jones",
      "middleName": "",
      "id": 1483589,
      "isEnterpriseAdmin": true,
      "uri": "/v1/user/1483589",
      "email": "sjones@mycompany.com",
      "username": "sjones"
    },
    {
      "firstName": "Julianne",
      "lastName": "Donostavian",
      "middleName": "",
      "id": 460351,
      "isEnterpriseAdmin": false,
      "uri": "/v1/user/460351",
      "email": "jdonstavian@mycompany.com",
      "username": "jdonstavian"
    }
  ]
}				
				
The returned JSON data contain connections parameters for this PSTN dial-out.
  • count - This is the total number of matches returned by the API.
  • users - This is an array of JSON objects representing the user accounts that matched the search string.
  • various fields - The fields returned are those that were requested in the query parameters for the API call.
  • id - This is the unique account identifier for the user.
  • uri - This string is an BlueJeans internal reference identifier.
CURL
curl -X GET "https://api.bluejeans.com/v1/enterprise/28663/users?fields=username%2C%20firstName%2C%20middleName%2C%20lastName%2C%20isEnterpriseAdmin%2C%20enterpriseJoinDate%2C%20email&textSearch=Stav&access_token=2c3677...9d4f456014f" -H "accept: application/json"

Step 2(b)

Searching

Look for user by email address

Perhaps you know the email address of the account. Here you can search for the account information for sjones@mycompany.com.

BlueJeans will return Stavros' unique account id: 1483589

Along with this API call, you must pass the access_token obtained from the Authentication step.

API Specification
https://api.bluejeans.com/v1/enterprise/{enterpriseId}/users?emailId=sjones@mycompany.com&fields=firstName...&access_token=(your access token)
JSON Calling Parameters
fields=username,firstName,middleName,lastName,isEnterpriseAdmin,email
emailId=sjones@mycompany.com
pageSize=10
				
The function of the Query Parameters are:
  • fields - comma-separated string : The list of account fields the API should return.
  • emailId - string : The email address for the account being searched.
  • pageSize - integer : The maximum number of matches to return.
JSON Return Values
{
  "count": 1,
  "users": [
    {
      "firstName": "Stavros",
      "lastName": "Jones",
      "middleName": "",
      "id": 1483589,
      "isEnterpriseAdmin": true,
      "uri": "/v1/user/1483589",
      "email": "sjones@mycompany.com",
      "username": "sjones"
    }
  ]
}				
The returned JSON data contain connections parameters for this PSTN dial-out.
  • count - This is the total number of matches returned by the API.
  • users - This is an array of JSON objects representing the user accounts that matched the search string.
  • various fields - The fields returned are those that were requested in the query parameters for the API call.
  • id - This is the unique account identifier for the user.
  • uri - This string is an BlueJeans internal reference identifier.
CURL
curl -X GET "https://api.bluejeans.com/v1/enterprise/28663/users?fields=username%2C%20firstName%2C%20middleName%2C%20lastName%2C%20isEnterpriseAdmin%2C%20email&emailId=sjones%40mycompany.com&access_token={your access token}" -H "accept: application/json"

Step 3

Get User Details

Look-up full user information

Now that we have the Unique User ID number for Stavros, 1483589, we can retrieve his full account information.

Along with this API call, you must pass the access_token obtained from the Authentication step.

API Specification
https://api.bluejeans.com/v1/user/{userId}?access_token=(your access token)
API Path Calling Parameters
userId
				
The required API Path Parameters are:
  • userId - This is the BlueJeans unique User Id for Stavros.
JSON Return Values
{
  "id": 1483589,
  "username": "sjones",
  "firstName": "Stavros",
  "lastName": "Jones",
  "emailId": "sjones@mycompany.com",
  "company": "My Company",
  "middleName": "",
  "title": "Chief Muckraker",
  "language": "en",
  
. . . and many more ...
}				
The returned JSON data contains all the profile values for Stavros' account. For description of all the fields, refer to the Developer Site's API specification.
CURL
curl -X GET "https://api.bluejeans.com/v1/user/1483589?access_token={your access token}" -H "accept: application/json"