Skip to content

Instantly share code, notes, and snippets.

@Miaababikir
Last active October 15, 2019 08:56
Show Gist options
  • Save Miaababikir/71800ecf832d4cff35ef1d1e6fc8ed10 to your computer and use it in GitHub Desktop.
Save Miaababikir/71800ecf832d4cff35ef1d1e6fc8ed10 to your computer and use it in GitHub Desktop.

Main Dashboard API Doc

Register new Parent

  • URL

    /api/parents

  • Method:

    POST

  • Success Response:

    • Code: 200
      Content:

          [
            "parent": {
                  "id": 1,
                  "created_at": "2019-07-06 06:32:53",
                  "updated_at": "2019-07-06 06:32:53",
              }
          ]

Register new Kid

  • URL

    /api/kids

  • Method:

    POST

    Required:

    name=[string]

  • Success Response:

    • Code: 200
      Content:

          [
            "kid": {
                  "id": 1,
                  "parent_id": null
                  "created_at": "2019-07-06 06:32:53",
                  "updated_at": "2019-07-06 06:32:53",
              }
          ]

Link Kid account to Parent account

  • URL

    /api/parents/{parent_id}/kids/{kid_id}

  • Method:

    POST

  • Success Response:

    • Code: 200
      Content:

          {
            name: "Kid name"
          }

Unlink Kid account to Parent account

  • URL

    /api/parents/{parent_id}/kids/{kid_id}

  • Method:

    DELETE

  • Success Response:

    • Code: 200

Getting Parent Kids

  • URL

    /api/parents/{parent_id}/kids

  • Method:

    GET

  • Success Response:

    • Code: 200
      Content:

          [
            {
              "kid_id": 1,
            },
            {
              "kid_id": 2,
            },
      
          ]

Getting Kid Parent

  • URL

    /api/kids/{kid_id}/parents

  • Method:

    GET

  • Success Response:

    • Code: 200
      Content:

          {
            "parent_id": 1,
          }

Set kid paused status

  • URL

    /api/kids/{kid_id}/paused

  • Method:

    PUT

    Required:

    paused=[boolean]

  • Success Response:

    • Code: 200

Check kid paused status

  • URL

    /api/kids/{kid_id}/paused

  • Method:

    GET

  • Success Response:

    • Code: 200
      Content:

          {
            "paused": false
          }

Get Kid allowance data

  • URL

    /api/kids/{kid_id}/allowances

  • Method:

    GET

  • Success Response:

    • Code: 200
      Content:

          [
            "parent_id": 1,
            "kid_id": 1,
            "saturday_start": "12",
            "saturday_end": "18"
            ...
          ]

Set Kid allowance time

  • URL

    /api/kids/{kid_id}/allownaces

  • URL Params

    Required:

    day=[0 - 6] start=[string] end=[string] allowance_id=[intger]

  • Method:

    PUT

  • Success Response:

    • Code: 200
      Content:

          [
            error: true // If the account is not connected
            ...
          ]

Delete Kid allowance time

  • URL

    /api/kids/{kid_id}/allownaces/{allowance_id}

  • URL Params

    Required:

    day=[0 - 6]

  • Method:

    DELETE

  • Success Response:

    • Code: 200

Add and update most used app

  • URL

    /api/most-used-apps

  • URL Params

    Required:

    kid_id=[integer] name=[string] package_name=[string] time=[string]

Request Example

        [
          apps: [
            {
              accessible: 1,
              name: "Lorem Ipsum",
              package_name: "www.test.io",
              ...
            },
            {
              accessible: 1,
              name: "Lorem Ipsum",
              package_name: "www.test.io",
              ...
            }
          ]
        ];
  • Method:

    POST

  • Success Response:

    • Code: 200

Get most used app

  • URL

    /api/kids/{kid_id}/most-used-apps

  • Method:

    GET

  • Success Response:

    • Code: 200

        [
          {
            id: 1,
            name: "Lorem Ipsum",
            package_name: "www.test.io",
            ...
          }
        ];

Getting all app permissions

  • URL

    /api/kids/{kid_id}/apps-permissions

  • URL Params

  • Method:

    GET

  • Success Response:

    • Code: 200

Add app permission to kid

  • URL

    /api/kids/{kid_id}/apps

  • URL Params

    Required:

    accessible=[boolean] package_name=[string] name=[string] blocked=[boolean]

    Request Example

         [
           permissions: [
             {
               accessible: 1,
               name: "Lorem Ipsum",
               package_name: "www.test.io",
               blocked: 0
               ...
             },
             {
               accessible: 1,
               name: "Lorem Ipsum",
               package_name: "www.test.io",
               blocked: 1
               ...
             }
           ]
         ];
  • Method:

    POST

  • Success Response:

    • Code: 200

Update app permission to kid

  • URL

    /api/kids/{kid_id}/apps/{permission_id}

  • URL Params

    Required:

    accessible=[boolean]

  • Method:

    PUT

  • Success Response:

    • Code: 200

Delete app permission

  • URL

    /api/kids/{kid_id}/apps/{package_name}

  • Method:

    DELETE

  • Success Response:

    • Code: 200

Get allowed apps for Kid

  • URL

    /api/kids/{kid_id}/apps

  • Method:

    GET

  • Success Response:

    • Code: 200
      Content:

      [
        {
          id: 1,
          name: "Lorem Ipsum",
          package_name: "www.test.io",
          accessible: false,
          blocked: true
          created_at: "2019-07-06 06:32:53",
          updated_at: "2019-07-06 06:32:53"
        }
      ];

Set Kid schedule

  • URL

    /api/kids/{kid_id}/schedules

  • URL Params

    Required:

    title=[integer] start_time=[string] end_time=[string] saturday_active=[boolean]

  • Method:

    POST

  • Success Response:

    • Code: 200

Get Kid schedule

  • URL

    /api/kids/{kid_id}/schedules

  • Method:

    GET

  • Success Response:

    • Code: 200
      Content:

          {
              "id": 1,
              "title": 747,
              "start_time": "1990,1,1",
              "end_time": "1999,1,1",
              "saturday_active": true,
              ...
              "created_at": "2019-07-06 06:32:53",
              "updated_at": "2019-07-06 06:32:53",
          }

Getting All Videos URL

  • URL

    /api/videos

  • Method:

    GET

  • Success Response:

    • Code: 200
      Content:

      [
        {
          id: 1,
          name: "Lorem Ipsum",
          url: "www.test.io",
          created_at: "2019-07-06 06:32:53",
          updated_at: "2019-07-06 06:32:53"
        }
      ];

Getting All Store Apps

  • URL

    /api/store-apps

  • Method:

    GET

  • Success Response:

    • Code: 200
      Content:

      [
        {
          id: 1,
          name: "Lorem Ipsum",
          url: "www.test.io",
          accessible: false,
          icon: "url/to/icon",
          download_link: "url/to/apk",
          apk_size: 2131232,
          version: "asdasdsad",
          version_code: "adsadsad",
          category: "sadsada",
          created_at: "2019-07-06 06:32:53",
          updated_at: "2019-07-06 06:32:53"
        }
      ];

Getting All Device Apps

  • URL

    /api/device-apps

  • Method:

    GET

  • Success Response:

    • Code: 200
      Content:

      [
        {
          id: 1,
          name: "Lorem Ipsum",
          package_name: "www.test.io",
          accessible: false,
          created_at: "2019-07-06 06:32:53",
          updated_at: "2019-07-06 06:32:53"
        }
      ];

Getting Data

  • URL

    /api/videos --- /api/playlists --- /api/musics

Search for store app

  • URL

    /api/store-apps/{name}

  • Method:

    GET

  • Success Response:

    • Code: 200
      Content:

      [
        {
          id: 1,
          name: "Lorem Ipsum",
          created_at: "2019-07-06 06:32:53",
          updated_at: "2019-07-06 06:32:53"
        }
      ];

Search for playlist

  • URL

    /api/playlists/{name}

  • Method:

    GET

  • Success Response:

    • Code: 200
      Content:

      [
        {
          id: 1,
          name: "Lorem Ipsum",
          created_at: "2019-07-06 06:32:53",
          updated_at: "2019-07-06 06:32:53"
        }
      ];

Search for musics

  • URL

    /api/musics/{name}

  • Method:

    GET

  • Success Response:

    • Code: 200
      Content:

      [
        {
          id: 1,
          name: "Lorem Ipsum",
          created_at: "2019-07-06 06:32:53",
          updated_at: "2019-07-06 06:32:53"
        }
      ];

Add and update app icon

  • URL

    /api/app-icons

  • URL Params

    Required:

    icons=[array]

    Request Example

         [
           icons: [
             {
               package_name: "www.test.io",
               icon: 'icon'
               ...
             },
             {
               package_name: "www.test.io",
               icon: 'icon'
               ...
             },
           ]
         ];
  • Method:

    POST

  • Success Response:

    • Code: 200

    Update app icon

  • URL

    /api/app-icons/{icon_id}

  • URL Params

    Required:

    icon=[file] package_name=[string]

  • Method:

    POST

  • Success Response:

    • Code: 200

Get app icon file

  • URL

    /api/app-icons/{package_name}

  • URL Params

  • Method:

    GET

  • Success Response:

    • Code: 200

Getting all app icons

  • URL

    /api/app-icons

  • Method:

    GET

  • Success Response:

    • Code: 200
      Content:

      [
        {
          id: 1,
          package_name: "Lorem Ipsum",
          icon: "url-to-icon",
          created_at: "2019-07-06 06:32:53",
          updated_at: "2019-07-06 06:32:53"
        }
      ];

*Getting youtube videos

  • URL

    /api/youtube_api

  • Method:

    GET

  • Success Response:

    • Code: 200
      Content:

      [];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment