NAV Navbar
shell

Introduction

My Kinder Moments API allows schools to register teachers, students, parents and assign appropriate user permissions.

Terminology used in this document:

Server Address


$ curl https://www.mykindermoments.com

Run in Postman

Authentication

Request Authorization Token


$ curl  https://www.mykindermoments.com/api/login \
-X POST \
-H "Content-Type: application/json" \
-d '{
        "username":"xxx",
        "password":"xxx"
    }' 

Successful Response:

{
  "username": "example@me.com",
  "roles": [
    "ROLE_ORG"
  ],
  "token_type": "Bearer",
  "access_token": "1l4sp5i1s5so6c2done0qv4ma4hpv67p"
}

Error Response: 400

My Kinder Moments expects Authorization token and API key to be included in all API requests in the http header section.

Example:

Authorization: Bearer 1l4sp5i1s5so6c2done0qv4ma4hpv67p

api_key : 18af1916-5a18-4a20-92a5-d25634b360db-school.com.au

You can get the Authorization token via a rest call.

For developer api key, please contact us @ info@mykindermoments.com

Get all organisations

Get all organisations associated with the account.

Request All Organisations:


$ curl  https://www.mykindermoments.com/api/get/organisations \
-X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer xxx" \
-H "api_key: xxx" 

Successful Response:

{
  "status": "ok",
  "result": [
    {
      "name": "Haileybury - Keysborough",
      "organisationId": "f4236f3a-4ef7-4b5b-8265-f4e5bac213c1",
      "self": "https://www.mykindermoments.com/api/get/enrollments/f422613a-4ef7-4b5b-1285-f4e5bac213c1"
    },
    {
      "name": "Haileybury - Brighton",
      "organisationId": "fbc204c0-aeb3-4494-bdb6-858d6e7bcecb",
      "self": "https://www.mykindermoments.com/api/get/enrollments/v4a36f3a-4ef7-4b5b-8265-f4e5bac213c1"
    }
  ]
}  

This endpoint retrieves all organisations associated with the account.

HTTP Request

GET https://www.mykindermoments.com/api/get/organisations

Get all enrollments

Get all classroom enrollments for the given organisation id

Request All Enrollments:


$ curl  https://www.mykindermoments.com/api/get/enrollments/:id \
-X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer xxx" \
-H "api_key: xxx" 

Successful Response:

{
  "organisationId": "f4236f3a-4ef7-4b5b-8265-f4e5bac213c1",
  "name": "Haileybury - Keysborough",
  "enrollments": [
    {
      "enrollmentId": "10ffe954-9f6a-4881-8942-2cd3efdd2762",
      "organisationId": "f4236f3a-4ef7-4b5b-8265-f4e5bac213c1",
      "name": "Reception C",
      "archived": false,
      "students" :[{
          "studentId": "5230ec16-0c8b-4a3f-aca9-5eb0f3f9c914",
          "externalStudentId": "haileyburyprofile#11",
          "lastUpdated": "2016-11-24T08:31:01Z",
          "organisationId": "f4236f3a-4ef7-4b5b-8265-f4e5bac213c1",
          "notes": "",
          "address": "",
          "dob": "2010-11-04T00:00:00Z",
          "studentName": "John Appleseed",
          "status": "active",
          "contactNo": "0423974617"
        },
        {
          "studentId": "c6e92a34-01ab-4856-9329-13c66734335f",
          "externalStudentId": "haileyburyprofile#12",
          "lastUpdated": "2016-11-24T08:54:39Z",
          "organisationId": "f4236f3a-4ef7-4b5b-8265-f4e5bac213c1",
          "notes": "",
          "address": "",
          "dob": "2010-11-05T00:00:00Z",
          "studentName": "Lisa Stevenson",
          "status": "active",
          "contactNo": ""
        },],
      "displayDate": 2016
    },
    {
      "enrollmentId": "51426b25-3845-4b08-a2e4-2dfa97264b48",
      "organisationId": "f4236f3a-4ef7-4b5b-8265-f4e5bac213c1",
      "name": "Pre Prep - S",
      "archived": false,
      "students" :[],
      "displayDate": 2016
    }
  ]
}

This endpoint retrieves enrollment associated with the organisation.

HTTP Request

GET https://www.mykindermoments.com/api/get/enrollments/:id

:id = Organisation Id

Add teacher

Add teacher to the organisation

Request:


$ curl  https://www.mykindermoments.com/api/add/teacher/:id \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer xxx" \
-H "api_key: xxx" \
-d '{ 
        "userPermission": {
            "accessLevel": "ORG_TEACHER"
        },
        "user": {
        "externalUserId":"100001",
        "firstName": "Lisa",
        "lastName": "Christine",
        "email": "lisa.christine@school.com",
        "roles":[
          {"id":"ROLE_ORG","selected":true}
         ]
        }  
    }' 

Successful Response

{ 
"status":"ok","username":"haileyburyprofile#100003"
}

Error Response

{ 
"status": "error",
"error": "User 100001 already exists (haileyburyprofile#100001)"
}

This end point allows teacher to be added to the organisation

HTTP Request

POST https://www.mykindermoments.com/api/add/teacher/:id

:id = Organisation Id

Data Parameters

JSON field Mandatory Description
userPermission yes Teacher user permission object
userPermission.accessLevel yes AccessLevel must be ORG_TEACHER or ORG_ADMIN
user yes User object
user.externalUserId yes Must be unique to the organisation
user.firstName yes First name
user.lastName yes Last name
user.email yes Valid email address
user.roles yes User roles (role.id must be ‘ROLE_ORG’ role.selected must be true or false)

Add student

Add student to the classroom.

Request:


$ curl  https://www.mykindermoments.com/api/add/student/:id \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer xxx" \
-H "api_key: xxx" \
-d '{ 
        "student":
        {
            "externalStudentId": "1001",
            "studentName": "John Apple Seed",
            "dob":"2009-11-04T00:00:00Z",
            "status":"active",
            "notes" :"",
            "contactNo" :"",
            "address":"address"
        }
    }' 

Successful Response

{ 
    "status":"ok",
    "id":"db5326d7-b4b0-46f0-bc41-92ef4a9eeefb"
}

Error Response

{
    "status":"error",
    "error":"Student already associated with the enrollment 
    (db5326d7-b4b0-46f0-bc41-92ef4a9eeefb) name(John Apple Seed) -
     dob(Wed Nov 04 11:00:00 AEDT 2009) - haileyburyprofile#1001"
}

This end point allows student to be added to the classroom

HTTP Request

POST https://www.mykindermoments.com/api/add/teacher/:id

:id = Enrollment Id

Data Parameters

JSON field Mandatory Description
student yes student object
student.externalStudentId yes Must be unique to the organisation
student.studentName yes Student full name
student.dob yes Student date of birth, must be in UTC format (Example: yyyy-MM-ddTHH:mm:ssZ / 2009-11-04T00:00:00Z)
student.status yes Student status (Value: active)
student.notes no Additional notes.
student.contactNo no Student contact no
student.address no Student address

Add parent and assign permission

Add parent to the classroom and assign permission to access student moments.

Request:


$ curl  https://www.mykindermoments.com/api/add/parent/:id \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer xxx" \
-H "api_key: xxx" \
-d '{ 
        "student": [{"externalStudentId":"1001"}],  
        "user": {
        "externalUserId":"parent3",
        "firstName": "parent firstname",
        "lastName": "parent lastname",
        "email": "parent3@me.com",
        "roles":[
            {"id":"ROLE_PARENT","selected":true}
            ]
        }
    }' 

Successful Response

{ 
    "status":"ok",
    "id":"ab5d26d7-b4b0-46f0-bc41-92ef4a9eeefb"
}

Error Response

{
    "status": "error",
    "error": "User parent3 already exists (haileyburyprofile#parent3)"
}

This end point allows parent to be associated with the classroom and student

HTTP Request

POST https://www.mykindermoments.com/api/add/parent/:id

:id = Enrollment Id

Data Parameters

JSON field Mandatory Description
student yes student object
student.externalStudentId yes Must be unique to the organisation, and already been added to my kinder moments.
user yes User object
user.externalUserId yes Must be unique to the organisation
user.firstName yes First name
user.lastName yes Last name
user.email yes Valid email address
user.roles yes User roles (role.id must be 'ROLE_PARENT’ role.selected must be true or false)

Update parent permission

Update parent permission

Request:


$ curl  https://www.mykindermoments.com/api/update/parent/userPermission/:id \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer xxx" \
-H "api_key: xxx" \
-d '{   "externalStudentIds":["1001","1002"],
        "userPermission":{"accessLevel":"ENR_PARENT"},  
        "user": {
        "externalUserId":"100003"
        }  
    }' 

Successful Response

[
    {    
        "status":"ok",
        "id":"ab5d26d7-b4b0-46f0-bc41-92ef4a9eeefb"
    }
]

Error Response

[
    {
      "status": "error",
      "error": "User doesn't exists for the given externalUserId - 100003"
    }
]

This end point allows to add parents permission.

HTTP Request

POST https://www.mykindermoments.com/api/update/parent/userPermission/:id

:id = Enrollment Id

Data Parameters

JSON field Mandatory Description
externalStudentIds yes External Student Id array.
userPermission yes User Permission object
userPermission.accessLevel yes AccessLevel must be ENR_PARENT.
user yes User object
user.externalUserId yes Must be unique to the organisation

Update teacher permission

Update teacher permission

Request:


$ curl  https://www.mykindermoments.com/api/update/teacher/userPermission/:id \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer xxx" \
-H "api_key: xxx" \
-d '{ 
        "userPermission":{"accessLevel":"ORG_TEACHER"}, 
        "user": {
        "externalUserId":"100001"
        }  
    }' 

Successful Response

{ 
    "status":"ok",
    "id":"ab5d26d7-b4b0-46f0-bc41-92ef4a9eeefb"
}

Error Response

{
  "status": "error",
  "error": "User doesn't exists for the given externalUserId - 100001"
}

This end point allows to update teacher permission.

HTTP Request

POST https://www.mykindermoments.com/api/update/teacher/userPermission/:id

:id = Organisation Id

Data Parameters

JSON field Mandatory Description
userPermission yes User Permission object
userPermission.accessLevel yes AccessLevel must be ORG_TEACHER or ORG_ADMIN.
user yes User object
user.externalUserId yes Must be unique to the organisation

Update Parent or Teacher

Update Parent or Teacher

Request:


$ curl  https://www.mykindermoments.com/api/update/user/:id \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer xxx" \
-H "api_key: xxx" \
-d '{ 
        "user": 
        {
            "externalUserId":"100001",
            "email":"lisa.christine@school.com",
            "firstName":"Lisa",
            "lastName":"Christine",
            "roles":[{"id":"ROLE_ORG","selected":true}]
        }  
    }' 

Successful Response

{ 
    "status":"ok",
    "username":"school#100001"
}

Error Response

{
  "status": "error",
  "error": "Invalid externalUserId"
}

This end point allows to update teacher or parent user details

HTTP Request

POST https://www.mykindermoments.com/api/update/user/:id

:id = Organisation Id

Data Parameters

JSON field Mandatory Description
user yes User object
user.externalUserId yes Must be unique to the organisation
user.email no User email address
user.firstName no User first name
user.lastName no User last name
user.roles no User roles (role.id must be 'ROLE_ORG’ or 'ROLE_PARENT’. Role.selected must be true or false)

Update student details

Update student details

Request:


$ curl  https://www.mykindermoments.com/api/update/student/:id \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer xxx" \
-H "api_key: xxx" \
-d '{
    "student": {
        "externalStudentId": "1001",
        "studentName": "Lisa Stevenson",
        "status":"active",
        "dob": "2009-11-05T00:00:00Z",
        "notes" :"",
        "contactNo" :"042382681",
        "address":""
    }
}' 

Successful Response

{ 
    "status":"ok",
    "id":"4833b120-64d1-4d17-bdd2-5946c3dc2a41"
}

Error Response

{
  "status": "error",
  "error": "Missing external studentId."
}

This end point allows to update student details

HTTP Request

POST https://www.mykindermoments.com/api/update/student/:id

:id = Organisation Id

Data Parameters

JSON field Mandatory Description
student yes Student object
student.externalStudentId yes Must be unique to the organisation
student.studentName no Student name
student.status no Status (ex: active or inactive)
student.dob no Student date of birth in UTC format.(Ex: yyyy-MM-ddTHH:mm:ssZ / 2009-11-04T00:00:00Z)
student.notes no Additional notes.
student.contactNo no Student contact no
student.address no Student address

Delete teacher permission

Delete teacher permission

Request:


$ curl  https://www.mykindermoments.com/api/delete/teacher/userPermission/:id \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer xxx" \
-H "api_key: xxx" \
-d '{
    "user": {
        "externalUserId": "1001"
    }
}' 

Successful Response

{ 
    "status":"deleted",
}

Error Response

{
  "status": "error",
  "error": "Missing user externalUserId field"
}

This end point allows to delete teacher permission

HTTP Request

POST https://www.mykindermoments.com/api/delete/teacher/userPermission/:id

:id = Organisation Id

Data Parameters

JSON field Mandatory Description
user yes User object
user.externalUserId yes User id - Must be unique to the organisation

Delete parent permission

Delete parent permission

Request:


$ curl  https://www.mykindermoments.com/api/delete/parent/userPermission/:id \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer xxx" \
-H "api_key: xxx" \
-d '{
    "user": {
        "externalUserId": "1001"
    }
}' 

Successful Response

{ 
  [
    "status":"deleted",
  ] 
}

Error Response

{
  "status": "error",
  "error": "Missing user externalUserId field"
}

This end point allows to delete parent permission

HTTP Request

POST https://www.mykindermoments.com/api/delete/parent/userPermission/:id

:id = Enrolment Id

Data Parameters

JSON field Mandatory Description
user yes User object
user.externalUserId yes User id - Must be unique to the organisation

Delete student

Delete student

Request:


$ curl  https://www.mykindermoments.com/api/delete/student/:id \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer xxx" \
-H "api_key: xxx" \
-d '{
    "student": {
        "externalStudentId": "1001"
    }
}' 

Successful Response

{ 
    "status":"ok",
    "id: "4833b920-64d1-4d17-bdd2-5946c3dc2a40"
}

Error Response

{
  "status": "error",
  "error": "Missing external studentId"
}

This end point allows to delete student

HTTP Request

POST https://www.mykindermoments.com/api/delete/student/:id

:id = Enrollment Id

Data Parameters

JSON field Mandatory Description
student yes Student object
student.externalStudentId yes Student id - Must be unique to the organisation