Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yetanalytics/xapi-post-client
https://github.com/yetanalytics/xapi-post-client
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/yetanalytics/xapi-post-client
- Owner: yetanalytics
- License: apache-2.0
- Created: 2023-06-13T18:40:39.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-23T21:32:06.000Z (12 months ago)
- Last Synced: 2024-01-24T22:38:13.445Z (12 months ago)
- Language: Clojure
- Size: 777 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# xapi-post-client
## Description
This is a client library for POSTing xAPI statements to the specified Learning Record Store (LRS). The function
takes EDN format and outputs JSON format to the LRS.## Usage
The library includes the function `post-statement` with the parameters `(post-statement endpoint key secret statement)`
`endpoint`: The URI of the LRS including the host and the port. "/statements" is automatically added to the end of the endpoint.
`key` and `secret`: The key and secret to the specified LRS.
`statement`: The EDN formatted xAPI statement to POST
Note: When there are no errors thrown, `post-statement` returns a list of ID(s) of the inserted statement(s)
## Example Usage
```
(def stmt-0
{"id" "00000000-0000-4000-8000-000000000000"
"actor" {"objectType" "Agent"
"name" "Eva Kim"
"mbox" "mailto:[email protected]"}
"verb" {"id" "http://adlnet.gov/expapi/verbs/voided"
"display" {"en-US" "voided"}}
"object" {"objectType" "StatementRef"
"id" "e3612d97-3900-4bef-92fd-d8db73e79e1b"}})
```Below is an example of POSTing using `post-statement`:
`(post-statement "http://localhost:8080" "username" "password" stmt-0)`
## Makefile
`make test-unit` runs all the unit-tests in `postclient_test.clj`
## License
Copyright © 2023-2024 Yet Analytics, Inc.
Distributed under the Apache License version 2.0.