For a deep dive into actors in xAPI statements see: https://xapi.com/blog/deep-dive-actor-agent/


SINGLE ACTOR

All our statements send the same actor information. Generally, the main actor for a statement is the learner, and if an observer or coach is involved then they are sent as a secondary actor called instructor, under the context attribute of the statement.

1 - We can set up a custom actor format for you. This is very common in real solutions, and usually accommodates a custom attribute for your solution like Employee ID, which we can get from an integration with, for example, your HR system, and which is often the best unique identifier for people in your organisation. Here’s an example of a custom actor format using Employee ID:

{
  "name": "Joe Bloggs",
  "objectType": "Agent",
  "account": {
    "name": "E1023099",
    "homePage": "https://myorg.example.com/empid"
  }
}

2 - Otherwise, if the person in xapiapps (learner or observer) has an email address and has the custom attribute “use_email_for_xapi” set to true, then we use the standard email actor format:

{
  "name": "Sally Glider",
  "mbox": "mailto:sally@example.com"
}

3 - Otherwise, if the person has a login name, then the xapiapps login name format is used:

{
  "name": "Emily Snow",
  "objectType": "Agent",
  "account": {
    "homePage": "https://acme.xapiapps.com/l",
    "name": "emily.snow"
  }
}

4 - Lastly, if none of the above conditions apply, then the xapiapps user key format is used:

{
  "name": "Emily Snow",
  "objectType": "Agent",
  "account": {
    "homePage": "http://acme.xapiapps.com/k",
    "name": "d5f55057-b5e7-4753-9290-4d795c461287"
  }
}

GROUP ACTOR

In our Group Training application, roll call statements can be about groups of actors (everyone on the roll). To accommodate this, we use group actors. This is simply the standard format for groups of actors in xAPI, containing details for each individual actor as above. eg:


{
  "name": "Test Training",
  "objectType": "Group",
  "account": {
    "homePage": "https://acme.xapiapps.com/g",
    "name": "0df81c16-71d2-f424-78f5-df8fa9c756b3"
  },
  "member": [
    {
      "account": {
        "homePage": "https://acme.xapiapps.com/k",
        "name": "d5f55057-b5e7-4753-9290-4d795c461287"
      },
      "name": "Emily Snow",
      "objectType": "Agent"
    },
    {
      "account": {
        "homePage": "https://acme.xapiapps.com/k",
        "name": "bca0d9d4-6dd9-1840-7665-72267d9e5f66"
      },
      "name": "Melanie Moggs",
      "objectType": "Agent"
    }
  ]
}