# Get All Portals Accessible To User

## Overview
The Get All Portals Accessible to User API allows a user to fetch all portals accessible to user across all department.
* If no access tags are specified for a portal, then any user can access the portal.
* If access tags are specified for a portal, users with a user profile that allows access have access to the portal. For users with multiple user profiles, the user profile that allows access does not need to be the active user profile.
* All the global users(partition) cannot be assigned user profiles; their access is limited to portals without access restrictions.
* The only articles returned are associated to an Article type when the parameter, “Include in browse on portals” is set to "Yes".
* When the "shortUrlTemplate" query parameter is provided, the API filters accessible portals according to the specified language and template name. Portal Short URL specific to to the "shortUrlTemplate" query parameter value is returned in the response.
* When there is no short URL available for a specific language, the API returns a portal object with an empty "shortURL" field.

Endpoint: GET /myportals
Security: oAuthUser, oAuthOnBehalfOfUser

## Description:

  - `Overview` ()
    The Get All Portals Accessible to User API allows a user to fetch all portals accessible to user across all department. * If no access tags are specified for a portal, then any user can access the portal.
* If access tags are specified for a portal, users with a user profile that allows access have access to the portal. For users with multiple user profiles, the user profile that allows access does not need to be the active user profile.
* All the global users(partition) cannot be assigned user profiles; their access is limited to portals without access restrictions.
* The only articles returned are associated to an Article type when the parameter, “Include in browse on portals” is set to "Yes".
* When the "shortUrlTemplate" query parameter is provided, the API filters accessible portals according to the specified language and template name. Portal Short URL specific to to the "shortUrlTemplate" query parameter value is returned in the response.
* When there is no short URL available for a specific language, the API returns a portal object with an empty "shortURL" field.

## Security:

  - `oAuthUser` (unknown)
    oauth2 scopes: https://api.egain.cloud/auth/knowledge.portalmgr.read

  - `oAuthOnBehalfOfUser` (unknown)
    oauth2 scopes: https://api.egain.cloud/auth/knowledge.portalmgr.onbehalfof.read

## Query parameters:

  - `$lang` (string, required)
    The language used for a resource. Resources available in different languages may differ from each other.

  - `department` (string)
    The Name of the department for which portals are to be fetched

  - `filterText` (string)
    Portal name starting with a specific character are considered to filter the result.

  - `shortUrlTemplate` (string)
    The Name of the template used while creating Short URL.

  - `$sort` (string)
    Objects returned in server response are sorted based on the attribute supplied under $sort. *Default value*: name.

  - `$order` (string)
    Common query parameter $order.*Default value*: asc

  - `$pagenum` (integer)
    Pagination parameter that specifies the page number of results to be returned. Used in conjunction with $pagesize.

  - `$pagesize` (integer)
    Pagination parameter that specifies the number of results per page. Used in conjunction with $pagenum.Valid range of 5-75*Default value*: 25

## Header parameters:

  - `Accept-Language` (string, required)
    The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).

## Response 200:

  - `200` (unknown)
    Success

## Response 200 fields (application/json):

  - `portal` (array)
    portals

  - `portal.id` (string)
    ID of portal. A Portal ID is composed of a 2-4 letter prefix, followed by a dash and 4-15 digits.

  - `portal.name` (string)
    Name of portal

  - `portal.description` (string)
    Description of portal

  - `portal.department` (object)

  - `portal.department.id` (string)
    ID of department
    Example: 1000001035

  - `portal.department.name` (string)
    Name of Department

  - `portal.shortURL` (array)

  - `portal.shortURL.id` (string)
    The alphanumeric ID of the short URL.A portal ID is composed of a 2-4 letter prefix, followed by a dash and 4-15 digits.

  - `portal.shortURL.templateName` (string)
    Name of template

  - `portal.shortURL.shortURLName` (string)
    Name of ShortURL

  - `portal.shortURL.isDefault` (boolean)

  - `paginationInfo` (object)

  - `paginationInfo.count` (integer, required)
    The total number of items.

  - `paginationInfo.pagenum` (integer, required)
    The page number requested. Page numbers start from 1.

  - `paginationInfo.pagesize` (integer, required)
    The number of objects requested per page. The maximum number of objects per page is 75.

  - `paginationInfo.link` (array)
    Can include the *prev* and *next* link.

  - `paginationInfo.link.rel` (string)
    Defines the relationship between a linked resource and the current object—for example a resource type name such as *article* or *topic* as defined by the API for that link.

  - `paginationInfo.link.href` (string)
    The URL that specifies the link's destination.

## Response 204:

  - `204` (unknown)
    No Content If all the portals are personalized and user does not have any profile assigned

## Response 400:

  - `400` (unknown)
    Bad Request

## Response 400 fields (application/json):

  - `code` (string, required)
    A string that follows the pattern *{integer}-{integer}*.
The first *{integer}* is the http status code.  This code as a whole is unique.
* For example, error codes "400-101" and "404-101" are distinctly different.

  - `developerMessage` (string, required)
    A summary of the error.

  - `details` (array)

  - `details.key` (string, required)

  - `details.value` (string)

  - `userMessage` (string)
    UI friendly messages are only supported by some APIs.
* The client must explicitly request UI friendly messages by passing the
*X-egain-error-message=yes*
 header.

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `code` (string, required)
    A string that follows the pattern *{integer}-{integer}*.
The first *{integer}* is the http status code.  This code as a whole is unique.
* For example, error codes "400-101" and "404-101" are distinctly different.

  - `developerMessage` (string, required)
    A summary of the error.

  - `details` (array)

  - `details.key` (string, required)

  - `details.value` (string)

  - `userMessage` (string)
    UI friendly messages are only supported by some APIs.
* The client must explicitly request UI friendly messages by passing the
*X-egain-error-message=yes*
 header.

## Response 403:

  - `403` (unknown)
    Forbidden

## Response 403 fields (application/json):

  - `code` (string, required)
    A string that follows the pattern *{integer}-{integer}*.
The first *{integer}* is the http status code.  This code as a whole is unique.
* For example, error codes "400-101" and "404-101" are distinctly different.

  - `developerMessage` (string, required)
    A summary of the error.

  - `details` (array)

  - `details.key` (string, required)

  - `details.value` (string)

  - `userMessage` (string)
    UI friendly messages are only supported by some APIs.
* The client must explicitly request UI friendly messages by passing the
*X-egain-error-message=yes*
 header.

## Response 404:

  - `404` (unknown)
    Not Found

## Response 404 fields (application/json):

  - `code` (string, required)
    A string that follows the pattern *{integer}-{integer}*.
The first *{integer}* is the http status code.  This code as a whole is unique.
* For example, error codes "400-101" and "404-101" are distinctly different.

  - `developerMessage` (string, required)
    A summary of the error.

  - `details` (array)

  - `details.key` (string, required)

  - `details.value` (string)

  - `userMessage` (string)
    UI friendly messages are only supported by some APIs.
* The client must explicitly request UI friendly messages by passing the
*X-egain-error-message=yes*
 header.

## Response 406:

  - `406` (unknown)
    Not acceptable

## Response 406 fields (application/json):

  - `code` (string, required)
    A string that follows the pattern *{integer}-{integer}*.
The first *{integer}* is the http status code.  This code as a whole is unique.
* For example, error codes "400-101" and "404-101" are distinctly different.

  - `developerMessage` (string, required)
    A summary of the error.

  - `details` (array)

  - `details.key` (string, required)

  - `details.value` (string)

  - `userMessage` (string)
    UI friendly messages are only supported by some APIs.
* The client must explicitly request UI friendly messages by passing the
*X-egain-error-message=yes*
 header.

## Response 500:

  - `500` (unknown)
    Internal server error

## Response 500 fields (application/json):

  - `code` (string, required)
    A string that follows the pattern *{integer}-{integer}*.
The first *{integer}* is the http status code.  This code as a whole is unique.
* For example, error codes "400-101" and "404-101" are distinctly different.

  - `developerMessage` (string, required)
    A summary of the error.

  - `details` (array)

  - `details.key` (string, required)

  - `details.value` (string)

  - `userMessage` (string)
    UI friendly messages are only supported by some APIs.
* The client must explicitly request UI friendly messages by passing the
*X-egain-error-message=yes*
 header.

## Response 200 examples:

  - `All Portal with only default Short URL` (unknown)
    By default, shortURL only contains single object

  - `All Portal with default/non-default Short URL` (unknown)
    If shortUrlTemplate name is passed in parameter then shortURL might contains multiple objects

## Response 400 examples:

  - `Required Attribute missing` (unknown)
    Required query parameter is missing.

  - `Unallowed attribute value` (unknown)
    One of the attributes has a value which is not allowed.

## Response 401 examples:

  - `Invalid Authorization` (unknown)
    Invalid or expired authorization. Generate a new authorization header and try again.

## Response 403 examples:

  - `Required Scope Missing` (unknown)
    User doesn't have the required scope to call this API. Refer to the API documentation regarding user scope assignment for more information.

## Response 404 examples:

  - `Resource Not Found` (unknown)
    Resource not found.

## Response 406 examples:

  - `Not Acceptable` (unknown)

## Response 500 examples:

  - `Internal Server Error` (unknown)

