Follow

How do I send an xAPI statement to SCORM Cloud using Postman

Avatar

When implementing xAPI, a helpful first step can be to send a simple xAPI statement to SCORM Cloud so that you can see how the request works. This guide explains how to send a simple xAPI statement to SCORM Cloud using Postman.

Please note: When implementing xAPI in your application, it is recommended to use a code library that will handle the API calls and some statement syntax validation.

Create API Authorization Credentials

Before you can send an xAPI statement, you will need to get an endpoint, key and secret from SCORM Cloud as well as set up an Activity Provider. This is explained in How to find your AppID, Secret Key and endpoint URL in SCORM Cloud and Setting Up Activity Providers In SCORM Cloud

Write an xAPI statement

You will also need to write an xAPI statement. xAPI statements are records of an individual learner interaction. You can read about statement design in How to Implement xAPI.

Hint: You can also use xAPI Lab to build and send an example statement.

For this example we can use a simple statement like this:

{
"actor": {
"mbox": "mailto:new.learner@mail.com",
"name": "Learner Name",
"objectType": "Agent"
},
"verb": {
"id": "http://adlnet.gov/expapi/verbs/answered",
"display": {
"en-US": "answered"
}
},
"object": {
"id": "http://adlnet.gov/expapi/activities/example",
"definition": {
"name": {
"en-US": "Example Activity"
},
"description": {
"en-US": "Example activity description"
}
},
"objectType": "Activity"
}
}


Send the Statement using Postman

To send the statement using Postman, set the method to POST and enter the Endpoint from SCORM Cloud in the Request URL, followed by "statements".

Screen_Shot_2022-10-25_at_7.10.31_PM.png

On the Authorization tab, select Basic Auth and enter the Activity Provider Key and Secret from SCORM Cloud as the Username and Password.

Screen_Shot_2022-10-25_at_7.16.36_PM.png

On the Headers tab, the Authorization will be automatically populated using the key and secret you provided. Add an X-Experience-API-Version header with a value of "1.0.3" and a Content-Type header with a value of "application/json".

mceclip4.png

On the Body tab, select raw and set the type to JSON (application/json). Paste in the statement to send.

Screen_Shot_2022-10-25_at_7.18.11_PM.png


Click the blue Send button to send the statement.

 

Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request
Powered by Zendesk