Documentation

AP

Methods

clearMessage(id)

clears a message by id in the host application

Parameters:
Name Type Description
id String

the message id

Example
AP.clearMessage('123');

fireEvent(id, props)

fire an analytics event

Parameters:
Name Type Description
id

the event id. Will be prepended with the prefix "p3.iframe."

props

the event properties

This functionality is deprecated and may be removed in the future.

getLocation(callback)

get the location of the host page

Parameters:
Name Type Description
callback function

function (location) {...}

Example
AP.getLocation(function(location){
  alert(location); 
});

getTimeZone(callback)

get current timezone - if user is logged in then this will retrieve user's timezone the default (application/server) timezone will be used for unauthorized user

Parameters:
Name Type Description
callback function

function (user) {...}

Example
AP.getTimeZone(function(timezone){
  console.log(timezone);
});

getUser(callback)

get a user object containing the user's id and full name

Parameters:
Name Type Description
callback function

function (user) {...}

Example
AP.getUser(function(user){ 
  console.log(user);
});

resize(width, height)

resize this iframe

Parameters:
Name Type Description
width String

the desired width

height String

the desired height

showMessage(id, title, body)

shows a message with body and title by id in the host application

Parameters:
Name Type Description
id String

the message id

title String

the message title

body string

the message body

Example
AP.showMessage('123', 'Hello world title', 'Hello world body');