4.3.1. ProjectsList

Description

The method returns a list of available projects for the user with the specified user_id. Also it displays additional information about the user’s role, the number of active probes and tasks in the project.

Request

{
  "user_id":(number),
  "methods":[
    {
      "method":"ProjectsList",
      "params":{
        "type":(string),
        "limit_value":(number),
        "page":(number)
      }
    }
  ]
}

where:

  • user_id — an integer value, a user identifier;

  • type (optional field) — a string, project list filter. List of filters:

    • own — a list of projects owned by the current user,

    • shared — a list of projects which the current user has been granted access to,

    • all — a list of all projects which the user has access to (default value).

  • limit_value (optional field) — an integer value, the maximum number of projects in the reply, allows you to split the result into pages. Default value is 25;

  • page (optional field) — an integer value, select pages with results. Default value is 1.

Reply

{
"reply":[
    {
    "method":"ProjectsList",
    "result":{
        "projects":[
        {
            "id":(number),
            "name":(string),
            "founder":(string),
            "role":(string),
            "live_apps_count":(number),
            "live_channels_count":(number),
            "live_streams_count":(number)
        }
        ],
        "current_page":(number),
        "total_pages":(number),
        "limit_value":(number)
      }
    }
  ]
}

where:

  • id — an integer value, a user identifier;

  • name — a string, a project name;

  • founder — a string, name of the project owner or his email;

  • role — a string, user role in the project (for more details see Project Sharing):

    • owner — the user is the owner of the project,

    • admin — the user has been granted shared access to the project with administrator rights,

    • user — the user has been granted shared access to the project with user rights,

    • unknown — the role is not defined. The request is made for a user with Superadmin rights (has access to all projects, see Global roles ).

  • live_apps_count — an integer value, number of active probes in the project;

  • live_channels_count — an integer value, number of active tasks in the project;

  • live_streams_count — an integer value, number of licensed streams (see Licensing System);

  • current_page — an integer value, number of the displayed result page;

  • total_pages — an integer value, the total number of result pages for a given limit_value;

  • limit_value — an integer value, maximum number of projects in reply.

Example

Request by the cURL utility
curl http://172.16.1.41/ctrl_api/v1/json \
   -H "Content-Type: application/json" \
   --data '{"user_id":1,"methods":[{"method":"ProjectsList","params":{"type":"all","limit_value":20,"page":1}}]}'
Reply
 {
   "reply": [
     {
       "method": "ProjectsList",
       "result": {
         "projects": [
           {
             "id": 1,
             "name": "Boro VoD Test",
             "founder": "Superadmin",
             "role": "owner",
             "live_apps_count": 2,
             "live_streams_count": 0,
             "live_channels_count": 0
           }
         ],
         "current_page": 1,
         "total_pages": 1,
         "limit_value": 20
       }
     }
   ]
 }