TABLE OF CONTENTS
MITV API is here!

Getting started

How to get access token?

You have to obtain user specific unique access token. This token is valid until revoke or changed.

Assets

List of all assets GET

This method returns all assets to which the user has access. If user is admin, than all assetes are returned.

http://[url]/api/v1/asset

Example

curl http://[url]/api/v1/asset
  -H "Authorization: Bearer XqdB8oViKusAQVy8troAxoPFM7JjZ0vH"
http://[url]/api/v1/asset?token=XqdB8oViKusAQVy8troAxoPFM7JjZ0vH

HTTP Response

        
  200 OK
  401 Unauthorized - "User unauthorized."
      

OK Response

        
        [
          {
            TAG1: "Risanke",
            TAG2: "",
            TAG3: "",
            TAG4: "",
            THUMB_01: "5A2BBmo4jYgehn9Yh_01.jpg",
            THUMB_02: "5A2BBmo4jYgehn9Yh_02.jpg",
            THUMB_03: "5A2BBmo4jYgehn9Yh_03.jpg",
            createdBy: "4gF2W9B6MH8PagLd4",
            _id: "5A2BBmo4jYgehn9Yh",
            asset_type: "FILE",
            ca: false,
            content_type: "VIDEO",
            description: "A hot-shot race-car named Lightning McQueen gets waylaid in Radiator Springs, where he finds the true meaning of friendship and family. ",
            duration: "01:51:44",
            openin: "PLAYER",
            seekstamp: "",
            shortdesc: "A hot-shot race-car named Lightning McQueen gets waylaid in Radiator Springs, where he finds the true meaning of friendship and family. ",
            slug: "",
            sort_by: "TITLE",
            title: "Cars",
            url: ""
          },
          {
            TAG1: "",
            TAG2: "",
            TAG3: "",
            TAG4: "",
            THUMB_01: "6GpuYtkt7qnYmY6WF_01.png",
            THUMB_02: "6GpuYtkt7qnYmY6WF_02.png",
            THUMB_03: "6GpuYtkt7qnYmY6WF_03.jpg",
            _id: "6GpuYtkt7qnYmY6WF",
            createdBy: "4gF2W9B6MH8PagLd4",
            asset_type: "FILE",
            ca: false,
            content_type: "IMAGE",
            description: "",
            duration: "",
            openin: "PLAYER",
            seekstamp: "",
            shortdesc: "",
            slug: "",
            sort_by: "TITLE",
            title: "DS slika 2",
            url: "/content/6GpuYtkt7qnYmY6WF"
          },
          {...}
        ]
        
      

More API parameters

- Filter parameter
Filter assets that will be returned.

http://[url]/api/v1/asset?token=XqdB8oViKusAQVy8troAxoPFM7JjZ0vH&filter=parent:DfC5oKYr2fK3Fw8y4,asset_type:FILE

- Fileds parameter
Specify which parameters will be or will not be returned.

http://[url]/api/v1/asset?token=XqdB8oViKusAQVy8troAxoPFM7JjZ0vH&fields=ancestors:0,count:1

- Limit parameter
Limit the number of assets that will be returned.

http://[url]/api/v1/asset?token=XqdB8oViKusAQVy8troAxoPFM7JjZ0vH&limit=20

Asset metadata by ID GET

Get metadata by asset id.

http://[url]/api/v1/asset/ID

Example (asset ID = 5A2BBmo4jYgehn9Yh)

curl http://[url]/api/v1/asset/5A2BBmo4jYgehn9Yh
  -H "Authorization: Bearer XqdB8oViKusAQVy8troAxoPFM7JjZ0vH"
http://[url]/api/v1/asset/5A2BBmo4jYgehn9Yh?token=XqdB8oViKusAQVy8troAxoPFM7JjZ0vH

HTTP Response

        
  200 OK
  401 Unauthorized - "User unauthorized."
  403 Forbidden - "No permission."
  404 Not Found - "Asset not found."
      

OK Response

        
        {
          TAG1: "Risanke",
          TAG2: "",
          TAG3: "",
          TAG4: "",
          THUMB_01: "5A2BBmo4jYgehn9Yh_01.jpg",
          THUMB_02: "5A2BBmo4jYgehn9Yh_02.jpg",
          THUMB_03: "5A2BBmo4jYgehn9Yh_03.jpg",
          _id: "5A2BBmo4jYgehn9Yh",
            createdBy: "4gF2W9B6MH8PagLd4",
          asset_type: "FILE",
          ca: false,
          content_type: "VIDEO",
          description: "A hot-shot race-car named Lightning McQueen gets waylaid in Radiator Springs, where he finds the true meaning of friendship and family.",
          duration: "01:51:44",
          openin: "PLAYER",
          seekstamp: "",
          shortdesc: "A hot-shot race-car named Lightning McQueen gets waylaid in Radiator Springs, where he finds the true meaning of friendship and family. ",
          slug: "",
          sort_by: "TITLE",
          title: "Cars",
          url: ""
        }
        
      

List of all assets with advanced filter options POST

This method returns all assets to which the user has access. If user is admin, than all assetes are returned. User can defined advanced filter options.

http://[url]/api/v1/advanced/asset

Example

curl http://[url]/api/v1/advanced/asset
  -H "Authorization: Bearer XqdB8oViKusAQVy8troAxoPFM7JjZ0vH"
  -H "Content-Type: application/json"
  -d '{"filter": {"$or":[{"$and": [{"asset_type": "RECORD"},{"pg": {"$in": ["gteqopJGE5dyZcpD7"]}},{"created": {"$gt": "2016-11-23T12:00:00.000Z"}}]}]}, "options": {"limit": 10, "fields":{"shortdesc":1} }'
  -X POST
        
  Explanation:
  - filter (object): mongoDB query and projection operators
  - options (object): can contain limit witch defined number of returned assets and fields in which user can defined fields that will be returned.
      

HTTP Response

        
  200 OK
  401 Unauthorized - "User unauthorized."
      

OK Response

        
        [
          {
            TAG1: "Risanke",
            TAG2: "",
            TAG3: "",
            TAG4: "",
            THUMB_01: "5A2BBmo4jYgehn9Yh_01.jpg",
            THUMB_02: "5A2BBmo4jYgehn9Yh_02.jpg",
            THUMB_03: "5A2BBmo4jYgehn9Yh_03.jpg",
            createdBy: "4gF2W9B6MH8PagLd4",
            _id: "5A2BBmo4jYgehn9Yh",
            asset_type: "FILE",
            ca: false,
            content_type: "VIDEO",
            description: "A hot-shot race-car named Lightning McQueen gets waylaid in Radiator Springs, where he finds the true meaning of friendship and family. ",
            duration: "01:51:44",
            openin: "PLAYER",
            seekstamp: "",
            shortdesc: "A hot-shot race-car named Lightning McQueen gets waylaid in Radiator Springs, where he finds the true meaning of friendship and family. ",
            slug: "",
            sort_by: "TITLE",
            title: "Cars",
            url: ""
          },
          {
            TAG1: "",
            TAG2: "",
            TAG3: "",
            TAG4: "",
            THUMB_01: "6GpuYtkt7qnYmY6WF_01.png",
            THUMB_02: "6GpuYtkt7qnYmY6WF_02.png",
            THUMB_03: "6GpuYtkt7qnYmY6WF_03.jpg",
            _id: "6GpuYtkt7qnYmY6WF",
            createdBy: "4gF2W9B6MH8PagLd4",
            asset_type: "FILE",
            ca: false,
            content_type: "IMAGE",
            description: "",
            duration: "",
            openin: "PLAYER",
            seekstamp: "",
            shortdesc: "",
            slug: "",
            sort_by: "TITLE",
            title: "DS slika 2",
            url: "/content/6GpuYtkt7qnYmY6WF"
          },
          {...}
        ]
        
      

Create new asset POST

Create new asset, get ID and insert metadata.

http://[url]/api/v1/asset/

Example

curl http://[url]/api/v1/asset/
  -H "Authorization: Bearer XqdB8oViKusAQVy8troAxoPFM7JjZ0vH"
  -H "Content-Type: application/json"
  -d '{"title":"test","pg":["gteqopJGE5dyZcpD7"]}'
  -X POST
      

HTTP Response

        
  200 OK
  401 Unauthorized - "User unauthorized."
  403 Forbidden - "No permission."
        
      

OK Response

        
        {
          _id:"dii93z7LwqaAASZWb",
          title:"test",
          pg:["gteqopJGE5dyZcpD7"],
          createdBy:"rTwMpKiw5kP2xgxqH",
          seekstamp:""
        }
        
      

Update asset metadata by ID PUT

With this method you can update metadata of selected asset.

http://[url]/api/v1/asset/ID

Example (ID = 5A2BBmo4jYgehn9Yh)

curl http://[url]/api/v1/asset/5A2BBmo4jYgehn9Yh
  -H "Authorization: Bearer XqdB8oViKusAQVy8troAxoPFM7JjZ0vH"
  -H "Content-Type: application/json"
  -d '{"title" : "test2"}'
  -X PUT
      

HTTP Response

        
  200 OK
  401 Unauthorized - "User unauthorized."
  403 Forbidden - "No permission."
  404 Not Found - "Asset not found."
      

OK Response

        
        {
          _id:"dii93z7LwqaAASZWb",
          title:"test2",
          pg:["gteqopJGE5dyZcpD7"],
          createdBy:"rTwMpKiw5kP2xgxqH",
          seekstamp:"",
          modifiedBy:"rTwMpKiw5kP2xgxqH",
          lastModified:"2016-11-23T14:35:21.580Z"
        }
        
      

Upload asset file POST

http://[url]/api/v1/upload

Upload ZIP file and make asset if not exist admin only

Example (ID = 5A2BBmo4jYgehn9Yh)

curl -i
 -F _id=5A2BBmo4jYgehn9Yh
 -F filedata=@/path/to/test.zip http://[url]/api/v1/upload/
 -H "Authorization: Bearer XqdB8oViKusAQVy8troAxoPFM7JjZ0vH"
      

HTTP Response

        
  200 OK
  401 Unauthorized - "User unauthorized."
  403 Forbidden - "No permission."
        
      

OK Response

 
      HTTP/1.1 100 Continue

      HTTP/1.1 200 OK
      Server: nginx/1.4.4
      Date: Wed, 12 Feb 2014 12:05:33 GMT
      Content-Type: text/plain
      Transfer-Encoding: chunked
      Connection: keep-alive
      vary: Accept-Encoding

      received upload:

      { fields: { _id: '5A2BBmo4jYgehn9Yh' },
        files: 
         { filedata: 
            { domain: null,
              _events: {},
              _maxListeners: 10,
              size: 17653460,
              path: '/tmp/0fbfe513d8706fc85ac80d2e3f04c755',
              name: 'test.zip',
              type: 'application/octet-stream',
              hash: null,
              lastModifiedDate: Wed Feb 12 2014 13:05:33 GMT+0100 (CET),
              _writeStream: [Object] 
            }
          }
      }
      

Upload poster (THUMB_01) or thumbnail (THUMB_02) on specific asset

Example (ID = 5A2BBmo4jYgehn9Yh) (THUMB_01)

curl -i
 -F _id=5A2BBmo4jYgehn9Yh
 -F THUMB_01=true
 -F filedata=@/path/to/test.jpg http://[url]/api/v1/upload/
 -H "Authorization: Bearer XqdB8oViKusAQVy8troAxoPFM7JjZ0vH"
      

HTTP Response

        
  200 OK
  401 Unauthorized - "User unauthorized."
  403 Forbidden - "No permission."
  404 Not Found - "Asset not found."
  500 Forbidden - "Internal Server Error."
        
      

OK Response

 
      HTTP/1.1 100 Continue

      HTTP/1.1 200 OK
      Server: nginx/1.4.4
      Date: Wed, 12 Feb 2014 12:05:33 GMT
      Content-Type: text/plain
      Transfer-Encoding: chunked
      Connection: keep-alive
      vary: Accept-Encoding

      received upload:

      { fields: { _id: '5A2BBmo4jYgehn9Yh', 'THUMB_02':'true'}},
        files: 
         { filedata: 
            { domain: null,
              _events: {},
              _maxListeners: 10,
              size: 17653460,
              path: '/tmp/0fbfe513d8706fc85ac80d2e3f04c755',
              name: 'test.jpg',
              type: 'application/octet-stream',
              hash: null,
              lastModifiedDate: Wed Feb 12 2014 13:05:33 GMT+0100 (CET),
              _writeStream: [Object] 
            }
          }
      }
      

Upsert multiple assets metadata PUT

With this method you can update (if _id parameter is specified) or insert asset metadata. Metadata for specific asset must be in object combined in array.

http://[url]/api/v1/asset/

Example (asset with ID=5A2BBmo4jYgehn9Yh will be updated and new asset with title "Toys" will be created)

curl http://[url]/api/v1/asset/
  -H "Authorization: Bearer XqdB8oViKusAQVy8troAxoPFM7JjZ0vH"
  -H "Content-Type: application/json"
  -d '[{_id: "5A2BBmo4jYgehn9Yh", title: "Cars"},{title: "Toys"}]'
  -X PUT
    

HTTP Response

        
  200 OK
  400 Bad request - "Incorrect structure of payload (not array)."
  401 Unauthorized - "User unauthorized."

        
      

OK Response

        
        [
          {
            updated:"B7dxZM5nh3nCJZLWe",
            created: "z7W4hnExTrGAGgFYy"
          }
        ]
        
      

Delete asset DELETE

Simply delete asset by ID.

http://[url]/api/v1/asset/ID

Example (asset ID = C2398ct63uBBAhpFs)

curl http://[url]/api/v1/asset/C2398ct63uBBAhpFs
  -H "Authorization: Bearer XqdB8oViKusAQVy8troAxoPFM7JjZ0vH"
  -X DELETE
      

HTTP Response

        
  200 OK
  401 Unauthorized - "User unauthorized."
  403 Forbidden - "No permission."
  404 Not Found - "Asset not found."
      

OK Response

 
  1
      

Get asset PDF proxy by ID GET

Get PDF by asset id. *

http://[url]/api/v1/pdf/ID?token=XqdB8oViKusAQVy8troAxoPFM7JjZ0vH

Example (asset ID = 5A2BBmo4jYgehn9Yh)

curl http://[url]/api/v1/pdf/5A2BBmo4jYgehn9Yh
  -H "Authorization: Bearer XqdB8oViKusAQVy8troAxoPFM7JjZ0vH"
http://[url]/api/v1/pdf/5A2BBmo4jYgehn9Yh?token=XqdB8oViKusAQVy8troAxoPFM7JjZ0vH

* Command is only valid for “_print” templates.


Comments

List of comments GET

This method returns all comments. If user is admin, than all comments are returned.

https://[url]/api/v1/comments

Example

curl https://[url]/api/v1/comments
        -H "Authorization: Bearer XqdB8oViKusAQVy8troAxoPFM7JjZ0vH"
            
https://[url]/api/v1/comments?token=XqdB8oViKusAQVy8troAxoPFM7JjZ0vH

HTTP Response

200 OK
401 Unauthorized - "User unauthorized."

Advanced GET filter, fields and limit

?filter=aid:dcsdfdsf
?fields=aid:1,uid:1
?limit=100

Users

Obain access token POST

http://[url]/api/v1/users/login

Example

curl http://[url]/api/v1/users/login
  -H "Content-Type: application/json"
  -d '{"email":"test@example.com","password": "xxxxxx"}'
  -X POST
      

OK Response


    {
       _id: "BqDdf2QErNwhvAkWe",
       access_token: "XqdB8oViKusAQVy8troAxoPFM7JjZ0vH"
    }
        
      

List of all users GET admin only

http://[url]/api/v1/user/

Example

curl http://[url]/api/v1/user
  -H "Authorization: Bearer XqdB8oViKusAQVy8troAxoPFM7JjZ0vH"
http://[url]/api/v1/user?token=XqdB8oViKusAQVy8troAxoPFM7JjZ0vH

OK Response


  [
    {
      _id: "BqDdf2QErNwhvAkWe",
      emails: [
        {
          address: "info@mediainteractive.tv",
          verified: false
        }
      ],
      profile: {
        access_token: "XqdB8oViKusAQVy8troAxoPFM7JjZ0vH",
        email: "info@mediainteractive.tv",
        isadmin: false,
        name: "Media Interactive",
        online: false,
        pg: [
          "mitv"
        ],
        picture: "/avatar_normal.jpg",
        status: "new"
      }
    },
    {
      _id: "re6PLqc29EgTGAQG9",
      profile: {
        access_token: "yPuzc8TywEFlgKJfxAVp0XD1HjDGLexH",
        commentsNr: 34,
        email: "roman.ursic@gmail.com",
        isadmin: true,
        name: "Roman Uršič",
        online: false,
        pg: [
          "meteor"
        ],
        picture: "/photo.jpg",
        status: "new"
      }
    }
  ]        
        
      

User metadata by ID GET admin only

http://[url]/api/v1/user/ID

Example (user ID = 4gF2W9B6MH8PagLd4)

curl http://[url]/api/v1/user/4gF2W9B6MH8PagLd4
  -H "Authorization: Bearer XqdB8oViKusAQVy8troAxoPFM7JjZ0vH"
http://[url]/api/v1/user/4gF2W9B6MH8PagLd4?token=XqdB8oViKusAQVy8troAxoPFM7JjZ0vH

OK Response

        
  {
    _id: "4gF2W9B6MH8PagLd4",
    emails: [
      {
        address: "info@mediainteractive.tv",
        verified: false
      }
    ],
    profile: {
      isadmin: true,
      name: "Media Interactive",
      online: false,
      pg: [
        "mitv"
      ]
    }
  }         
        
      

Update user metadata PUT admin only

http://[url]/api/v1/user/ID

Example (user ID = 4gF2W9B6MH8PagLd4)

curl http://[url]/api/v1/user/jtoqhWpav9v9NQR4j
  -H "Authorization: Bearer XqdB8oViKusAQVy8troAxoPFM7JjZ0vH"
  -H "Content-Type: application/json"
  -d '{"profile.pg" : ["meteor", "mitv"]}'
  -X PUT
      

OK Response


  {
    _id: "4gF2W9B6MH8PagLd4",
    emails: [
      {
        address: "info@mediainteractive.tv",
        verified: false
      }
    ],
    profile: {
      isadmin: true,
      name: "Media Interactive",
      online: false,
      pg: [
        "meteor",
        "mitv"
      ]
    }
  }  
        
      

Delete user DELETE admin only

http://[url]/api/v1/user/ID

Example (user ID = 4gF2W9B6MH8PagLd4)

curl http://[url]/api/v1/user/jtoqhWpav9v9NQR4j
  -H "Authorization: Bearer XqdB8oViKusAQVy8troAxoPFM7JjZ0vH"
  -X DELETE
      

OK Response


  1
        
      

Methods

Post method endpoint POST admin only

https://[server]/api/v1/method/

addPasswordless

Invite users and send passwordless login email.

Body sample (group ID = 4HyoaFe8gCefiNNke)

{
  "method": "addPasswordless", 
  "aid": "4HyoaFe8gCefiNNke",  
  "email": "true", 
  "msg": "Msg", 
  "user": {
    "email":"xxx@gmail.com",
    "username":"xxx@gmail.com", 
    "profile.name": "Joža Gulikoža"
  }, 
  "role": "Moderator"
}

addGroup

Create or update group

Body sample (create or update group by unique custom metadata field idNumber):

{ 
  "method": "addGroup", 
  "asset": {
    "title": "Method123",
    "idNumber":"123”
  }, 
  "unique": {
    "idNumber": "123"
  }
}

addUserToGroups

Add users to one or many groups.

Body sample for 2 group IDs (THeBQPw4siBhD9Tdn,fqY8sEhBHvpSqLFCz):

{
  "method": "addUserToGroups",
  "groups": [
      "THeBQPw4siBhD9Tdn",
      "fqY8sEhBHvpSqLFCz"
  ],
  "email": "xxx.xxx@mediainteractive.tv",
  "params": {
      "role": {
          "addAsset": false,
          "addPG": false,
          "addUser": false,
          "WebRTC": false,
          "controlWebRTC": false,
          "deleteAsset": false,
          "deleteUser": false,
          "presence": false,
          "statistics": false,
          "updateUser": false,
          "chat": true,
          "updateAsset": false,
          "WSadmin": false,
          "roleName": "Attendee",
          "pg": true
      },
      "name": "John Woo", // optional
      "noEmail": true // do not send invitation email
  }
}


removeUserFromGroups

Remove users from one or many groups.

Body sample for 2 group IDs (THeBQPw4siBhD9Tdn,fqY8sEhBHvpSqLFCz):

{
  "method": "removeUserFromGroups",
  "email": "xxx.xxx@mediainteractive.tv",
  "groups": [
      "THeBQPw4siBhD9Tdn",
      "fqY8sEhBHvpSqLFCz"
  ]
}


Webhooks

Webhook on Transcode complete admin only

Enter a valid url for us to contact

config.transcoder.webhookComplete="http://REMOTE_URL/"

How to add to your existing configuration (config.js)

 
  Config.update({_id: "CONFIGID"},{$set:{"transcoder.webhookComplete": "http://echo.mitv.si/api/transcode_complete"}});

                

Post

 {"_id":"YL7BKaLgKHuDMASwM","status":"Ready"}

Webhook on Asset update admin only

Enter a valid url for us to contact

config.webhookAssetUpdate="http://REMOTE_URL/"

How to add to your existing configuration (config.js)

 
  Config.update({_id: "CONFIGID"},{$set:{"transcoder.webhookAssetUpdate": "http://echo.mitv.si/api/asset_update"}});

                

Post

 {"_id":"YL7BKaLgKHuDMASwM","status":"Ready"}

Alerts

Post alert POST admin only

Send a script or text to a specific user (can be custom javascript, alert, ...)

http://[url]/api/v1/alert/

Example (send Javascript message)

curl "http://[url]/api/v1/alert/"
   -H "Authorization: Bearer ySEOatREUosZqlEsQswWyoVUv7kP4TXc"
   -H "Content-Type: application/json"
   -d '{"script":"alert(\"message\")", "uid": "5vRRqmqS8FGwKXsug"}'
   -X POST

Response

 
  {"_id":"gwPhH4qB2gtx4WCxW"}
       

Example (send simple message alert)

curl "http://[url]/api/v1/alert/"
   -H "Authorization: Bearer XqdB8oViKusAQVy8troAxoPFM7JjZ0vH"
   -H "Content-Type: application/json"
   -d '{"text" : "message", "uid": "jtoqhWpav9v9NQR4j" }'
   -X POST

Response

 
  {"_id":"gwPhH4qB2gtx4WCxW"}
        

Get alerts GET admin only

Get a list of all alerts

http://[url]/api/v1/alert/

Example

curl "http://[url]/api/v1/alert/"
   -H "Authorization: Bearer XqdB8oViKusAQVy8troAxoPFM7JjZ0vH"
http://[url]/api/v1/alert/?token=XqdB8oViKusAQVy8troAxoPFM7JjZ0vH

Response

 
  [
      {
          "uid":"5vRRqmqS8FGwKXsug",
          "text":"fg sfdg sdfg",
          "_id":"aSmeeyCjvYS3pzTv2",
          "createdBy":"mvNGTMNwaRWEseh2A"

      },
      {
          "uid":"5vRRqmqS8FGwKXsug",
          "script":"alert(\"message\")",
          "_id":"ejDKxvxzuoYRA8auq",
          "createdBy":"mvNGTMNwaRWEseh2A"
      },
      {
          "uid":"5vRRqmqS8FGwKXsug",
          "text":"fg sfdg sdfg",
          "_id":"ExZeGm44MGvhsfMqq",
          "createdBy":"mvNGTMNwaRWEseh2A"
      },
      {
          "uid":"5vRRqmqS8FGwKXsug",
          "text":"fg sfdg sdfg",
          "_id":"s7ywcBh8uwX4Ro5Xf",
          "createdBy":"mvNGTMNwaRWEseh2A"
      }
  ]
        

Get alert by ID GET admin only

Get alert by id

http://[url]/api/v1/alert/ID

Example (alert ID = uuFNt8yuFPDup9D9k)

curl "http://[url]/api/v1/alert/uuFNt8yuFPDup9D9k"
   -H "Authorization: Bearer XqdB8oViKusAQVy8troAxoPFM7JjZ0vH"
http://[url]/api/v1/alert/uuFNt8yuFPDup9D9k?token=XqdB8oViKusAQVy8troAxoPFM7JjZ0vH

Response

 
  {
         "uid":"5vRRqmqS8FGwKXsug",
          "text":"fg sfdg sdfg",
          "_id":"ExZeGm44MGvhsfMqq"
  }
        

Delete alert DELETE admin only

Delete alert by ID

http://[url]/api/v1/alert/ID

Example

curl "http://[url]/api/v1/alert/duwGpe9kYv3rNQdwn"
   -H "Authorization: Bearer XqdB8oViKusAQVy8troAxoPFM7JjZ0vH"
   -X DELETE

Response OK

 
  {"statusCode": 1 }
        

Response NOT FOUND

 
  {"statusCode": 0 }
        

Filter alerts GET admin only

Filter alerts by variety of fields or text

http://[url]/api/v1/alert/

Example (Print alerts on specific uid)

curl "http://[url]/api/v1/alert/" 
   -H "Authorization: Bearer XqdB8oViKusAQVy8troAxoPFM7JjZ0vH" 
   -H "Content-Type: application/json" 
   -d '{"filter" :{"uid": "RxW4ikwpPWPQm3FDb"}}'
   -X GET

Example (Print alerts that contain text "message")

curl "http://[url]/api/v1/alert/" 
   -H "Authorization: Bearer XqdB8oViKusAQVy8troAxoPFM7JjZ0vH" 
   -H "Content-Type: application/json" 
   -d '{"filter" :{"text": "message"}}' 
   -X GET

Example (Print alerts that was created by specific uid)

curl "http://[url]/api/v1/alert/" 
   -H "Authorization: Bearer XqdB8oViKusAQVy8troAxoPFM7JjZ0vH"
   -H "Content-Type: application/json" 
   -d '{"filter" :{"createdBy": "RxW4ikwpPWPQm3FDb"}}'
   -X GET

Response

 
  {
         "uid":"RxW4ikwpPWPQm3FDb",
          "text":"message",
          "_id":"ExZeGm44MGvhsfMqq",
          "createdBy": "RxW4ikwpPWPQm3FDb"
  }
        


Records

Get records GET admin only

Get course records about user status

http://[url]/api/v1/records/:id

Example (get records for one user only)

curl "http://[url]/api/v1/records/8XgZmvgSLhXRXxe5J?token=XqdB8oViKusAQVy8troAxoPFM7JjZ0vH&email=guest1@mediainteractive.tv"

Response


          [{"_id":"HCppokNPjBT2sMnK5",
            "aid":"2CbYqBuwFGLyTR3NG",
            "pg":["2CbYqBuwFGLyTR3NG"],
            "email":"mirko.orehek@mediainteractive.tv",
            "uid":"icnMWCud6taknrdAo",
            "status":"Complete",
            "course_complete":true,
            "course_complete_time":"2022-01-10T15:52:38.724Z",
            "certificate":true,
            "certificate_link":"https://meteor.mitv.si/certificate/verify/2CbYqBuwFGLyTR3NG?type=pdf"
          }]
       


Settings

Advanced settings admin only

Set Mixpanel URL (for admin menu link)
Config.update({_id: "7YT4fkDvoj4wBw4Yg"},{$set:{statUrl: "http://www.mixpanel.com"}})
Set E-cho URL (for admin menu link) - example disables and hides link
Config.update({_id: "7YT4fkDvoj4wBw4Yg"},{$set:{"echo.url": false}})
Globaly enable content tabs (true)
Config.update({_id: "7YT4fkDvoj4wBw4Yg"},{$set:{"client.contenttab.enabled": true}})
Only one user per user ID present on platform
Config.update({_id: "7YT4fkDvoj4wBw4Yg"},{$set:{"singleUser": true}})
Set weather location via alert (UID = F5FfA52cAmnCZdX5k)
Alerts.insert({uid:"F5FfA52cAmnCZdX5k", script: "localStorage.setItem('location', 'EUR|SI|SI000|KOPER')"});
Reload platform for user (UID = F5FfA52cAmnCZdX5k)
Alerts.insert({uid:"F5FfA52cAmnCZdX5k", script: "window.location.reload()"});

Add OAuth configuration ADD admin only

Accounts.loginServiceConfiguration.find().fetch()

Facebook

First, you'll need to register your app on Facebook. Follow these steps:
  1. Visit https://developers.facebook.com/apps
  2. Create New App (Only a name is required.)
  3. Set "Sandbox Mode" to "Disabled"
  4. Under "Select how your app integrates with Facebook", expand "Website with Facebook Login".
  5. Set Site URL to your MITV project site url (example): http://[url]
db.meteor_accounts_loginServiceConfiguration.find()
{ 
         "service" : "facebook", 
         "appId" : "132969083562926", 
         "secret" : "097b92dee0806c3f0eac6694faf35eb4", 
         "_id" : "4uDw22jin6G4m4Csd"
  }

Facebook

First, you'll need to register your app on Facebook. Follow these steps:
  1. Visit https://developers.facebook.com/apps
  2. Create New App (Only a name is required.)
  3. Set "Sandbox Mode" to "Disabled"
  4. Under "Select how your app integrates with Facebook", expand "Website with Facebook Login".
  5. Set Site URL to your MITV project site url.
db.meteor_accounts_loginServiceConfiguration.find()
{ 
         "service" : "facebook", 
         "appId" : "132969083562926", 
         "secret" : "097b92dee0806c3f0eac6694faf35eb4", 
         "_id" : "4uDw22jin6G4m4Csd"
  }

Google Plus

First, you'll need to get a Google Client ID. Follow these steps:
  1. Visit https://code.google.com/apis/console/
  2. If necessary, "Create Project"
  3. Click "APIs & auth" and "Registered apps" on the left
  4. Click the "Register App" button
  5. Choose "Web application" as the type
  6. Click "Register"
  7. Expand the "OAuth 2.0 Client ID section"
  8. Set Web Origin to (example): http://[url]/
  9. Set Redirect URI to (example): http://[url]/_oauth/google?close
  10. Click "Generate"
db.meteor_accounts_loginServiceConfiguration.find()
{
         "service" : "google", 
         "clientId" : "458163311152.apps.googleusercontent.com",
         "secret" : "8lyQhbKOtZBc90IDPhK-z2eo",
         "_id" : "qYFiFMn952fpTrNPW" 
  }

Twitter

First, you'll need to register your app on Twitter. Follow these steps:
  1. Visit https://dev.twitter.com/apps/new
  2. Set Callback URL to (example): http://[url]/_oauth/twitter?close
db.meteor_accounts_loginServiceConfiguration.find()
{
       "service" : "twitter",
       "consumerKey" : "kIJlfArjMiOxUD7kgNQ0g",
       "secret" : "fLs3rmJINZmeStwgMZjwcSK8UHiLB9i7y2CtDdazOQ",
       "_id" : "boeQHPk2MsNubNJ2k" 
  }