MeiroDocs

User Roles

Required feature: **settings/roles**

Section: Group User Roles. Base URL: https://instance_name.meiro.io/api/.

User Roles [/users/user_roles{?limit,offset,order_by,order_dir}]

List All Users' Roles [GET]

Required feature: settings/roles

  • Parameters

    • limit (number, optional) - Limit of the number of records returned
    • offset (number, optional) - Offset for the number of records returned
    • order_by (string, optional) - Ordered column name
    • order_dir (string, optional) - Ordering direction
  • Request

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

{
    "roles": [
        {
            "id": 100,
            "name": "Example Role",
            "description": "",
            "features": [
                "Feature A",
                "Feature B"
            ],
            "invisible_attributes_tag_ids": [
                "tag_a"
            ],
            "disabled": 0,
            "deleted": 0,
            "created": "2017-01-01 15:35:00",
            "modified": "2017-01-01 15:00:00",
            "last_modified_by": 1
        }
    ],
    "selection_settings": {
        "limit": 20,
        "offset": null,
        "order_by": "id",
        "order_dir": "ASC"
    }
}

Create a User Role [POST]

Required feature: settings/roles

  • Attributes

    • name: Example Role (string)
    • features: ["Feature A"] (array)
    • invisible_attributes_tag_ids: ["tag_a"] (array)
    • description: role description (string) - optional
    • disabled: 0 (number) - optional
  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 201 (application/json)

{
    "role": {
        "id": 100,
        "name": "Example Role",
        "description": "role description",
        "features": [
            "Feature A"
        ],
        "invisible_attributes_tag_ids": [
            "tag_a"
        ],
        "disabled": 0,
        "deleted": 0,
        "created": "2017-01-01 15:35:00",
        "modified": "2017-01-01 15:00:00",
        "last_modified_by": 1
    }
}

User Role [/users/user_roles/{role_id}]

Retrieve a User Role [GET]

Required feature: settings/roles

  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

{
    "role": {
        "id": 100,
        "name": "Example Role",
        "description": "role description",
        "features": [
            "Feature A"
        ],
        "invisible_attributes_tag_ids": [
            "tag_a"
        ],
        "disabled": 0,
        "deleted": 0,
        "created": "2017-01-01 15:35:00",
        "modified": "2017-01-01 15:00:00",
        "last_modified_by": 1
    }
}

Modify a User Role [PATCH]

Required feature: settings/roles

  • Attributes

    • name: Example Role (string)
    • features: ["Feature A"] (array)
    • invisible_attributes_tag_ids: ["tag_a"] (array)
    • description: role description (string) - optional
    • disabled: 0 (number) - optional
  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

{
    "role": {
        "id": 100,
        "name": "Example Role",
        "description": "role description",
        "features": [
            "Feature A"
        ],
        "invisible_attributes_tag_ids": [
            "tag_a"
        ],
        "disabled": 0,
        "deleted": 0,
        "created": "2017-01-01 15:35:00",
        "modified": "2017-01-01 15:00:00",
        "last_modified_by": 1
    }
}

Delete a User Role [DELETE]

Required feature: settings/roles

  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

{
    "message": "OK"
}

Trashed User Roles [/users/user_roles/trash{?limit,offset,order_by,order_dir}]

List All Trashed User Roles [GET]

Required feature: settings/users

  • Parameters

    • limit (number, optional) - Limit of the number of records returned
    • offset (number, optional) - Offset for the number of records returned
    • order_by (string, optional) - Ordered column name
    • order_dir (string, optional) - Ordering direction
  • Request

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

{
    "trashed_user_roles": [
        {
            "id": 100,
            "name": "Example Role",
            "description": "role description",
            "features": [
                "Feature A"
            ],
            "disabled": 0,
            "deleted": 0,
            "created": "2017-01-01 15:35:00",
            "modified": "2017-01-01 15:00:00",
            "last_modified_by": 1
        }
    ],
    "selection_settings": {
        "limit": 20,
        "offset": null,
        "order_by": "id",
        "order_dir": "ASC"
    }
}

Trashed User Role [/users/user_roles/trash/{role_id}]

Restore a Trashed User Role [PATCH]

Required feature: settings/users

  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

{
    "user_role": {
        "id": 100,
        "name": "Example Role",
        "description": "role description",
        "features": [
            "Feature A"
        ],
        "disabled": 0,
        "deleted": 0,
        "created": "2017-01-01 15:35:00",
        "modified": "2017-01-01 15:00:00",
        "last_modified_by": 1
    }
}

On this page