The core of the Experience API is sending statements, which happens over http. Wax complies with the latest version of the specification, 1.0.1, and supports both Basic and OAuth authentication. The http request must include the 1.0.x version header, too.


Retrieving statements using curl and Basic auth:

  

curl -H "Content-Type: application/json" --user username:password -H "x-experience-api-version: 1.0.0" https://MYLRS.waxlrs.com/TCAPI/statements 

  

Uploading statements using curl and Basic auth:

 

curl -X POST --data @statements.json -H "Content-Type: application/json" --user username:password -H "x-experience-api-version: 1.0.0" https://MYLRS.waxlrs.com/TCAPI/statements

  

You need to have statements.json in the same directory you run the command, and it must contain a single or list of 0.95 xAPI statements. If your statements don't validate, read the returned error: it will often tell you what the problem is specifically.


Example of what statements.json might look like:

  

[ 
   { 
      "verb":{ 
         "id":"http://example.com/verbs/sailed", 
         "display":{ 
            "en":"sailed" 
         } 
      }, 
      "result":{ 
         "completion":true, 
         "success":true 
      }, 
      "context":{ 
         "contextActivities":{ 
            "other":{ 
               "id":"http://example.com/activities/oceanrelated" 
            } 
         }, 
         "instructor":{ 
            "mbox":"mailto:sam@example.com", 
            "name":"Sam" 
         } 
      }, 
      "timestamp":"2011-05-25T20:34:05.787000+00:00", 
      "object":{ 
         "id":"http://example.com/activities/sailingcourse" 
      }, 
      "actor":{ 
         "objectType":"Group", 
         "member":[ 
            { 
               "mbox":"mailto:a@b.com", 
               "name":"Bob" 
            }, 
            { 
               "mbox":"mailto:b@c.com", 
               "name":"Jones" 
            } 
         ], 
         "name":"Team ABC" 
      } 
   }, 
   { 
      "verb":{ 
         "id":"http://example.gov/verbs/transported", 
         "display":{ 
            "en":"transported" 
         } 
      }, 
      "context":{ 
         "contextActivities":{ 
            "grouping":{ 
               "id":"http://example.com/topics/lading" 
            } 
         } 
      }, 
      "timestamp":"2011-06-25T20:34:05.787000+00:00", 
      "object":{ 
         "id":"http://example.com/coconut" 
      }, 
      "actor":{ 
         "objectType":"Agent", 
         "openid":"https://africanoreuropean.com", 
         "name":"Martin Hirun" 
      } 
   } 
]


We'll be expanding this Quick Reference with more basic use of the API over time. If you run into something you think should be covered, let us know and we'll look into adding it.