# Class PortalUri

A Portal URI, which is a special URI in the form "portal://item-id" or "portal://portal-id/item-id".

#####
Index

### Constructors

constructor

### Properties

itemId
portalId

### Methods

fetchData
toFullyQualifiedUri
toPortalItem
toString

##
Constructors

### constructor

- new PortalUri(uri?): PortalUri

- Creates a new PortalUri object.

  #### Parameters

  - `Optional` uri: string

    An optional string representation of a portal:// URI to build from.

  #### Returns PortalUri

##
Properties

### itemId

itemId: string

The item's id.

### portalId

portalId: string

The unique ID of the portal where the item is located. See !Config.portals.

##
Methods

### fetchData

- fetchData(responseType?): Promise<string>

- Fetches the item data associated with a given portal item URI.

  #### Parameters

  - `Optional` responseType: "text"

    The expected type of response.

  #### Returns Promise<string>

- fetchData(responseType?): Promise<unknown>

- Fetches the item data associated with a given portal item URI.

  #### Parameters

  - `Optional` responseType:
    | "blob"
    | "xml"
    | "text"
    | "json"
    | "document"
    | "array-buffer"

    The expected type of response.

  #### Returns Promise<unknown>

### toFullyQualifiedUri

- toFullyQualifiedUri(portalId): PortalUri

- Returns a new URI that is fully qualified with the given portal ID if this URI does not already have an explicit portal ID.

  #### Parameters

  - portalId: string

    The unique ID of the portal.

  #### Returns PortalUri

### toPortalItem

- toPortalItem(): PortalItem

- Returns a PortalItem object corresponding to this URI.

  #### Returns PortalItem

### toString

- toString(): string

- Converts the URI to a string.

  #### Returns string