xAPI.js
  • xAPI.js
  • xAPI Wrapper Library
    • Introduction
    • Getting Started
    • The XAPI Class
    • Statement Resource
    • State Resource
    • Activity Profile Resource
    • Agent Profile Resource
    • About Resource
    • Agents Resource
    • Activities Resource
    • Helpers
    • Verbs
    • Attachment Usages
  • cmi5 Profile Library
    • Introduction
    • Getting Started
    • The Cmi5 Class
    • "cmi5 defined" Statement methods
    • "cmi5 allowed" Statement methods
    • Helpers
Powered by GitBook
On this page
  • getAgent
  • Example
  • Parameters
  • Returns

Was this helpful?

  1. xAPI Wrapper Library

Agents Resource

Gets agent information about a particular person.

getAgent

Gets all agents used by a single person.

Example

const agent: Agent = {
  objectType: "Agent",
  name: "Test Agent",
  mbox: "mailto:test@agent.com"
};

xapi.getAgent({
  agent: agent
}).then((result: AxiosResponse<Person>) => {
  const person: Person = result.data;
  // do stuff with person
});

Parameters

Parameter

Type

Required

Description

agent

true

The agent experiencing the AU.

useCacheBuster

boolean

false

Enables cache busting.

Returns

PreviousAbout ResourceNextActivities Resource

Last updated 3 years ago

Was this helpful?

This method returns an AxiosPromise with the success data containing the if successful.

Person
Agent