Documentation

Documentation to build on the Passmarked platform

User

When using the system, a token can check the identity it represents returning the users/team information to either display or confirm.

Installing the JAVASCRIPT WEB API

To enable the Passmarked Client side API in your project, add the following script:

<script src="//jsapi.passmarked.com/v1.js"></script>

For more details, see github.com/passmarked/js on the project itself.

After adding the script, the passmarked object will become available for use

Creating a token

When generating token, options are given to decide the scope of the token. There are 2 scopes that can be selected, depending on which token will have specific permissions:

fullRepresenting the full user, these tokens can see the user's profile, balance and running reports using the credits of the owning user
limitThe token can only create report runs using the credits of the owning user, and not view any other details

To access the user profile (as detailed here), the token must be full, which will allow access to the users' profile.

Request

To request the user profile, the .getUser() function is provided. The function is called as follows:

passmarked.getUser({
  token: '(token-here)'
}, function(err, user) {
  if(err) {
    console.error(err);
  } else {
    console.log('user id: ' + user.getID());
  }
});

The function supports and expects a few parameters as follows:

NameTypeDescription
tokenstringThe token that will be used to authenticate with the API

Response

The function will return a User object that has the following functions:

NameTypeDescription
.getID()stringReturns the ID of the user
.getName()stringThe full name of the user
.getFirstname()stringThe firstname of the user
.getSurname()stringThe surname of the user
.getEmail()stringThe email of the user
.getAccounts()array[string]Array of connected account keys, like "github" / "twitter" / "google"
.getCreated()datetimeThe timestamp of when the user was created
.getLastLogin()datetimeThe timestamp of when the user last logged into Passmarked.com
.getLastUpdated()datetimeThe timestamp of when the user was last updated
Signup icon
Ready to see how well your site scores?

Passmarked works best when you have an account. It allows you to keep a dashboard with saved data of the sites you have run through the system, we’ll alert you about important updates and you get access to the Passmarked Slack forum.

Sign up to get started