## block_exaport_get_items

Returns categories and items for a particular level
type: read
Params:

level | int | null | required |  | id of level/parent category

Returns:

    [
        {
            "id": "int null (id of item)",
            "name": "text null (title of item)",
            "type": "text null (title of item (note,file,link,category))",
            "parent": "text null (iff item is a cat, parent-cat is returned)",
            "amount": "int null (iff item is a cat, amount of items in the category, otherwise 0)",
            "courseid": "int null (id of the course this category belongs to)"
        },
        "..."
    ]

## block_exaport_get_item

Returns detailed information for a particular item
type: read
Params:

itemid | int | null | required |  | id of item

Returns:

    {
        "id": "int null (id of item)",
        "name": "text null (title of item)",
        "type": "text null (type of item (note,file,link,category))",
        "category": "text null (title of category)",
        "url": "text null (url)",
        "intro": "raw null (description of item)",
        "filename": "text null (title of item)",
        "file": "url null (file url)",
        "isimage": "bool null (true if file is image)",
        "mimetype": "text null (mimetype)",
        "comments": [
            {
                "id": "int null ()",
                "userid": "int null ()",
                "userfullname": "text null ()",
                "timemodified": "int null ()",
                "entry": "text null ()"
            },
            "..."
        ]
    }

## block_exaport_add_item

Adds a new item to the users portfolio
type: write
Params:

title | text | null | required |  | item title
categoryid | int | null | required |  | categoryid
url | url | null | required |  | url
intro | raw | null | required |  | introduction
type | text | null | optional | default: string(0) "" | type of item (note,file,link)
fileitemid | int | null | optional | default: NULL | itemid for draft-area files; for "private" files is ignored
filename | text | null | optional | default: string(0) "" | deprecated (was used for upload into private files)

Returns:

    {
        "success": "bool null (status)"
    }

## block_exaport_update_item

Edit an item from the users portfolio
type: write
Params:

id | int | null | required |  | item id
title | text | null | required |  | item title
url | text | null | required |  | url
intro | raw | null | required |  | introduction
type | text | null | optional | default: string(0) "" | type of item (note,file,link)
fileitemid | int | null | optional | default: NULL | itemid for draft-area files; for "private" files is ignored, use '0' to delete the file
filename | text | null | optional | default: string(0) "" | deprecated (was used for upload into private files)

Returns:

    {
        "success": "bool null (status)"
    }

## block_exaport_delete_item

Delete an item from the users portfolio
type: write
Params:

id | int | null | required |  | item id

Returns:

    {
        "success": "bool null (status)"
    }

## block_exaport_add_item_comment

Add a comment to an item
type: read
Params:

itemid | int | null | required |  |
entry | raw | null | required |  |

Returns:

    {
        "success": "bool null (status)"
    }

## block_exaport_list_competencies

List all available competencies
type: read
Params:

Returns:

    [
        {
            "id": "int null (id of subject)",
            "name": "text null (title of subject)",
            "topics": [
                {
                    "id": "int null (id of topic)",
                    "name": "text null (title of topic)",
                    "descriptors": [
                        {
                            "id": "int null (id of descriptor)",
                            "name": "text null (name of descriptor)"
                        },
                        "..."
                    ]
                },
                "..."
            ]
        },
        "..."
    ]

## block_exaport_set_item_competence

assign a competence to an item
type: read
Params:

itemid | int | null | required |  | item id
descriptorid | int | null | required |  | descriptor id
val | int | null | required |  | 1 to assign, 0 to unassign

Returns:

    {
        "success": "bool null (status)"
    }

## block_exaport_get_views

Return available views
type: read
Params:

Returns:

    [
        {
            "id": "int null (id of view)",
            "name": "text null (title of view)",
            "description": "raw null (description of view)"
        },
        "..."
    ]

## block_exaport_get_view

Return detailed view
type: read
Params:

id | int | null | required |  | view id

Returns:

    {
        "id": "int null (id of view)",
        "name": "text null (title of view)",
        "description": "raw null (description of view)",
        "items": [
            {
                "id": "int null (id of item)",
                "name": "text null (title of item)",
                "type": "text null (title of item (note,file,link,category))"
            },
            "..."
        ]
    }

## block_exaport_add_view

Add a new view to the users portfolio
type: write
Params:

name | text | null | required |  | view title
description | text | null | required |  | description

Returns:

    {
        "success": "bool null (status)"
    }

## block_exaport_update_view

Edit a view from the users portfolio
type: write
Params:

id | int | null | required |  | view id
name | text | null | required |  | view title
description | text | null | required |  | description

Returns:

    {
        "success": "bool null (status)"
    }

## block_exaport_delete_view

Delete a view from the users portfolio
type: write
Params:

id | int | null | required |  | view id

Returns:

    {
        "success": "bool null (status)"
    }

## block_exaport_get_all_items

Return all items, independent from level
type: read
Params:

Returns:

    [
        {
            "id": "int null (id of category)",
            "pid": "text null (parentid)",
            "name": "text null (title of category)",
            "items": [
                {
                    "id": "int null (id of item)",
                    "name": "text null (title of item)",
                    "type": "text null (type of item (note,file,link,category))",
                    "url": "text null (url)",
                    "intro": "raw null (description of item)",
                    "filename": "text null (title of item)",
                    "file": "url null (file url)",
                    "isimage": "bool null (true if file is image)",
                    "mimetype": "text null (mimetype)"
                },
                "..."
            ]
        },
        "..."
    ]

## block_exaport_add_view_item

Add item to a view
type: write
Params:

viewid | int | null | required |  | view id
itemid | int | null | required |  | item id

Returns:

    {
        "success": "bool null (status)"
    }

## block_exaport_delete_view_item

Remove item from a view
type: write
Params:

viewid | int | null | required |  | view id
itemid | int | null | required |  | item id

Returns:

    {
        "success": "bool null (status)"
    }

## block_exaport_view_grant_external_access

Grant external access to a view
type: write
Params:

id | int | null | required |  | view id
val | int | null | required |  | 1 for check, 0 for uncheck

Returns:

    {
        "success": "bool null (status)"
    }

## block_exaport_view_get_available_users

Get users who can get access
type: read
Params:

Returns:

    [
        {
            "id": "int null (id of user)",
            "firstname": "text null (firstname of user)",
            "lastname": "text null (lastname of user)"
        },
        "..."
    ]

## block_exaport_view_grant_internal_access_all

Grant internal access to a view to all users
type: write
Params:

id | int | null | required |  | view id
val | int | null | required |  | 1 for check, 0 for uncheck

Returns:

    {
        "success": "bool null (status)"
    }

## block_exaport_view_grant_internal_access

Grant internal access to a view to one user
type: write
Params:

viewid | int | null | required |  | view id
userid | int | null | required |  | user id
val | int | null | required |  | 1 for check, 0 for uncheck

Returns:

    {
        "success": "bool null (status)"
    }

## block_exaport_get_category

Get category infor
type: read
Params:

categoryid | int | null | required |  | cat id

Returns:

    {
        "name": "text null (title of category)",
        "items": "int null (amount of category items)"
    }

## block_exaport_delete_category

Delete category
type: write
Params:

categoryid | int | null | required |  | cat id

Returns:

    {
        "success": "bool null (status)"
    }

## block_exaport_get_competencies_by_item

Get competence ids for a ePortfolio item
type: read
Params:

itemid | int | null | required |  | item id

Returns:

    [
        {
            "competenceid": "int null (id of competence)"
        },
        "..."
    ]

## block_exaport_get_users_by_view

Get view users
type: read
Params:

viewid | int | null | required |  | view id

Returns:

    [
        {
            "userid": "int null (id of user)"
        },
        "..."
    ]

## block_exaport_export_file_to_externalportfolio

Export file to external portfolio
type: write
Params:

component | raw | null | required |  | filestorage - component
filearea | raw | null | required |  | filestorage - filearea
filename | raw | null | required |  | filestorage - filename
filepath | raw | null | required |  | filestorage - filepath
itemid | int | null | required |  | filestorage - itemid

Returns:

    {
        "success": "text null (status)",
        "linktofile": "text null (link to file)"
    }

## block_exaport_login

webservice called through token.php
type: read
Params:

app | int | null | required |  | app accessing this service (eg. dakora)
app_version | int | null | required |  | version of the app (eg. 4.6.0)
services | int | null | optional | default: string(33) "moodle_mobile_app,exaportservices" | wanted webservice tokens (eg. exacomp,exaport)

Returns:

    {
        "user": {
            "id": "int null (ID of the user)",
            "username": "raw null (The username)",
            "firstname": "notags null (The first name(s) of the user)",
            "lastname": "notags null (The family name of the user)",
            "fullname": "notags null (The fullname of the user)",
            "email": "text null (An email address - allow email as root@localhost)",
            "firstaccess": "int null (first access to the site (0 if never))",
            "lastaccess": "int null (last access to the site (0 if never))",
            "auth": "plugin null (Auth plugins include manual, ldap, imap, etc)",
            "confirmed": "int null (Active user: 1 if confirmed, 0 otherwise)",
            "lang": "safedir null (Language code such as \"en\", must exist on server)",
            "url": "url null (URL of the user)",
            "profileimageurlsmall": "url null (User image profile URL - small version)",
            "profileimageurl": "url null (User image profile URL - big version)"
        },
        "config": [],
        "tokens": [
            {
                "service": "text null (name of service)",
                "token": "text null (token of the service)"
            },
            "... requested tokens ..."
        ]
    }