Skip to content
 
 

Repository files navigation

C2E Store Service Setup Guide

Please execute the folowing commands cefore starting the App for the first time.

npm install

npm run migrate

npx sequelize-cli db:seed:all

npm start

Curriki C2E Store Service API Documentation (Open API Specification)

Welcome to the Curriki C2E Store Service API documentation. 🎉 🎉 🎉

Table of Contents


Base URL

All endpoints are relative to the base URL:

https://service-host/api/v1


Authentication

API Key

All endpoints require an x-api-key header for authentication. Different roles have different API keys for access.


C2E Listing Routes

Create C2E Listing

Endpoint to create a new C2E Listing.

  • URL: /c2e-listings
  • Method: POST
  • Summary: Create C2E Listing
  • Parameters:
    • x-api-key (header) - API Key (role: cee-publisher-service)
      • Type: string
      • Default: API Key (role: cee-publisher-service)
      • Required: true
    • payload (body) - User credentials
      • Type: object
      • Properties:
        • ceeId (string) - C2E Id (Example: "5f5e2e3e-3e3e-4e4e-5e5e-6e6e7e7e7e7e")
        • name (string) - C2E Listing Name (Example: "C2E Listing Name")
        • subject (array of strings) - Educational subjects (Example: ["Mathematics"])
        • educationLevel (array of strings) - Education levels (Example: ["Grade 1"])
        • keywords (array of strings) - Keywords for the listing (Example: ["Mathematics", "Grade 1", "Addition", "Subtraction"])
  • Responses:
    • 200:
      • Description: Success
      • Schema:
        {
          "code": 200,
          "message": "Success",
          "result": "C2E Listing created successfully!"
        }
    • 400:
      • Description: Failed
      • Schema:
        {
          "code": 400,
          "message": "Failed to create C2E Listing!",
          "result": null
        }

C2E Subscription Routes

Get C2E Player Subscriptions Manifest

Endpoint to retrieve the C2E Player Subscriptions Manifest.

  • URL: /c2e-subscriptions/manifest
  • Method: GET
  • Summary: Get C2E Player Subscriptions Manifest
  • Parameters:
    • x-api-key (header) - API Key (role: cee-player-service)
      • Type: string
      • Default: API Key (role: cee-player-service)
      • Required: true
  • Responses:
    • 200:
      • Description: Success
      • Schema:
        {
          "code": 200,
          "message": "Success",
          "result": "C2E Player Subscriptions Manifest"
        }
    • 400:
      • Description: Failed
      • Schema:
        {
          "code": 400,
          "message": "Failed to show C2E Subscriptions!",
          "result": null
        }

Get C2E Stream Token

Endpoint to get a C2E Stream token.

  • URL: /stream/token
  • Method: GET
  • Summary: Get C2E Stream token (called from player service)
  • Parameters:
    • x-api-key (header) - Authentication and Authorization
      • Type: string
      • Default: APIKey (role: cee-player-service)
      • Required: true
    • subid (query) - C2E Subscription ID setup on the player service
      • Type: string
      • Required: true
  • Responses:
    • 200:
      • Description: Success
      • Schema:
        {
          "code": 200,
          "message": "Success",
          "result": [
            {
              "ceeId": "C2E ID",
              "token": "C2E Stream Token",
              "expiresAt": "C2E Stream Token Expiry Date"
            }
          ]
        }
    
    
    

Get C2E Manifest

Endpoint to get a C2E Manifest.

  • URL: /stream/manifest
  • Method: GET
  • Summary: Get C2E Manifest (called from player service)
  • Parameters:
    • x-api-key (header) - Authentication and Authorization
      • Type: string
      • Default: APIKey (role: cee-player-service)
      • Required: true
    • subid (query) - C2E Subscription ID
      • Type: string
      • Required: true
  • Responses:
    • 200:
      • Description: Success
      • Schema:
        {
          "code": 200,
          "message": "Success",
          "result": [
            {
              "ceeId": "C2E Subscription ID",
              "manifest": "C2E Manifest"
            }
          ]
        }

API Key Routes

Get API Keys

Endpoint to retrieve API Keys.

  • URL: /keys
  • Method: GET
  • Summary: Get API Keys
  • Parameters:
    • Authorization (header) - Authorization token
      • Type: string
      • Default: Bearer APIKey
      • Required: true
  • Responses:
    • 200:
      • Description: Success
      • Schema:
        {
          "code": 200,
          "message": "Success",
          "result": [
            {
              "key": "APIKey",
              "clientRole": "cee-publisher-service | cee-player-service",
              "clientEmail": "demo-c2e-store@curriki.org"
            }
          ]
        }

Swagger Documentation

Swagger Documentation can be found on following link https://service-host/api-docs/

Database Diagram

db

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages