Pulsar General Information API

General Information

userInfo

The userInfo query returns the following information about the currently logged in user:

  • Salesforce Username

  • Salesforce UserId

  • Salesforce User Locale

  • Salesforce User Language

  • Salesforce User Full Name

  • Salesforce User Profile Id

  • Salesforce User Profile Name (if available)

  • Salesforce User Role Id

  • Salesforce User Role Name (if available)

  • Salesforce Org Id

  • Salesforce Session Id

  • Salesforce Instance URL

  • Pulsar Last Successful Sync date (or "1970-01-01T00:00:00.000Z" if never synced)

  • Pulsar Version

  • Device Language

Pulsar 9.0+ also includes

  • Pulsar Last Failed Sync date (or "1970-01-01T00:00:00.000Z" if never synced)

  • Salesforce User small photo URL

  • Salesforce User full photo URL

Example Response:

{ "type": "userInfoResponse", "object": "", "data": { "devicelanguage": "en", "instanceurl": "https://mycompanydemo.my.salesforce.com/", "lastfailedsync": "1970-01-01T00:00:00.000Z", "lastsuccessfulsync": "1970-01-01T00:00:00.000Z", "locale": "en_US", "organizationid": "00D6A000001dc2eAAA", "sessionid": "00D6A000001dc2e!ABCDEFG1tC2a3gaJIkss4YkqdBc56eLWp7qvtylTPZFu8PW9aaFzcwWaVHc0FvebtMA1W2pfV_yBX7yPJyFm3fl4xHElVniN", "userFullPhoto": "http://127.0.0.1:12345/images/userPhoto/full", "userSmallPhoto": "http://127.0.0.1:12345/images/userPhoto/small", "userfullname": "John Doe", "userid": "0056A000001bCD2ABC", "userlanguage": "en_US", "username": "johndoe@mycompany.demo", "userprofileid": "00e6A0000001bcDEFG", "userprofilename": "Standard User", "userroleid": "00E6A0000002cdEFGH", "userrolename": "SVP, Customer Service & Support", "version": "9.0.0.0" } }

Usage:

var request = { "type" : "userInfo", "data" : { } // empty object- this is required in the current API }; bridge.sendRequest(request, function (results) { console.log('Javascript got its response: ' + results); if (results.type === "userInfoResponse") { username = results.data.username; userid = results.data.userid; userlocale = results.data.locale; fullname = results.data.userfullname; /* additional fields available in response not shown in this example */ } else if (results.type == 'error') { errStr = results.data; alert('A problem occurred:\n' + errStr); } });

userPhoto

The userPhoto query returns the following information about the currently logged in user:

  • Salesforce User small photo URL

  • Salesforce User full photo URL

var request = { "type" : "userPhoto", "data" : { } // empty object- this is required in the current API }; bridge.sendRequest(request, function (results) { console.log('Javascript got its response: ' + results); if (results.type === "userPhotoResponse") { smallPhoto = results.data.smallphoto; fullPhoto = results.data.fullphoto; } else if (results.type == 'error') { errStr = results.data; alert('A problem occurred:\n' + errStr); } });

getDevServerEnabled

The getDevServerEnabled API returns "TRUE" or "FALSE" depending on whether the Local Development Server is currently enabled for the current user, and (optional) given document Id.

getPlatform

getLocation

getCustomLabels

Logging

logMessage