Skip to content

Instantly share code, notes, and snippets.

@Aldaviva
Last active September 13, 2016 02:50
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 Aldaviva/d61d521662e928384cf03e36785f9f80 to your computer and use it in GitHub Desktop.
Save Aldaviva/d61d521662e928384cf03e36785f9f80 to your computer and use it in GitHub Desktop.
Get a Blue Jeans meeting owner's name by meeting ID

Get the Owner's Name of a Blue Jeans Meeting

Inputs

  • (required) Blue Jeans numeric Meeting ID, e.g. 494435558
  • (required for meetings with a passcode) Blue Jeans meeting passcode, can be either the participant passcode or the moderator passcode, e.g. 3691

Outputs

  • Full name of the owner of the meeting, e.g. John Doe

1. Generate an OAuth Token

Request example

POST https://api.bluejeans.com/oauth2/token HTTP/1.1
Content-Type: application/json
Host: api.bluejeans.com
Content-Length: 65

{
  "grant_type": "meeting_passcode",
  "meetingNumericId": "494435558",
  "meetingPasscode": "3691"
}

If the meeting is passcodeless, omit the meetingPasscode property from the request body.

Response example

HTTP/1.1 200 OK
Server: BlueJeans Proxy
Content-Type: application/json; charset=UTF-8

{
  "access_token": "564lgo0njiejl9tj85z2cl25b8tzk2hd@z2",
  "expires_in": 86400,
  "scope": {
    "meeting": {
      "id": 123,
      "leaderId": 4835,
      "meetingNumericId": "494435558",
      "meetingUri": "\/v1\/user\/4835\/live_meetings\/494435558",
      "isModerator": false,
      "endpointUriSet": [
        
      ],
      "meetingId": "72660"
    },
    "partitionName": "z2",
    "partition": {
      "id": 2,
      "name": "z2"
    }
  }
}

The important properties of the response are access_token and scope.meeting.leaderId, which you will use for the next request.

2. Get the meeting info

In this request, use the access_token, scope.meeting.leaderId, and meetingNumericId values from before.

Request URL template

https://api.bluejeans.com/v1/user/{scope.meeting.leaderId}/live_meetings/{meetingNumericId}/preferences?access_token={access_token}

Request example

GET https://api.bluejeans.com/v1/user/4835/live_meetings/494435558/preferences?access_token=564lgo0njiejl9tj85z2cl25b8tzk2hd@z2 HTTP/1.1
Host: api.bluejeans.com

The leaderId and meetingNumericId appear as path parameters, and the access_token is a query parameter.

Response example

HTTP/1.1 200 OK
Server: BlueJeans Proxy
Content-Type: application/json; charset=UTF-8

{
  "userProfilePictureUrl": "",
  "userAttributes": [ ],
  "userGroups": [ ],
  "userSecurityProfile": { },
  "userRoom": { },
  "enterpriseGroups": [ ],
  "meetingInfo": [ ],
  "leader": {
    "id": 4835,
    "username": "username",
    "firstName": "John",
    "lastName": "Doe",
    "emailId": "johndoe@mycompany.com",
    "company": "My Company, Inc.",
    "middleName": "",
    "title": "Employee",
    "phone": "",
    "profilePicture": "images/profile_pictures/username_firstname.jpg",
    "timezone": "US/Pacific",
    "timeFormat": 12,
    "language": "en",
    "skypeId": "",
    "gtalkId": "username@gmail.com",
    "defaultEndpoint": "DESKTOP",
    "passwordChangeRequired": false,
    "marketoId": 1234,
    "optOutOffers": false,
    "optOutNews": false,
    "geoInfo": "omitted",
    "howDidYouHear": "",
    "sfdcToken": "",
    "linkedinProfileUrl": null,
    "lastLogin": 1468020121000,
    "dateJoined": 1320702113000,
    "jid": null,
    "primaryPhone": null,
    "channel_id": 1
  },
  "meeting": { },
  "numbers": { },
  "pluginConfiguration": [ ],
  "enterprise": { },
  "billingDetails": { }
}

The response is actually quite large, so I have omitted most of the values.

Get the leader.firstName, leader.middleName, and leader.lastName from the response JSON body, then combine them to form the owner's full name.

Be aware that leader.middleName is the empty string for many users, so you will want more than a simple concatenation. Here's are some sample implementations in JavaScript:

var ownerFullName = leader.firstName +
    (leader.middleName ? (" " + leader.middleName + " ") : " ") +
    leader.lastName;
var ownerFullName = (leader.firstName + leader.middleName + leader.lastName).replace(/ +/g, " ");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment