getItem


Purpose

Gets an item selected by specifying their type and handle, together witn an URL of an attachment.

Data types are freely defined data item categories, presented as string values. Handles are data item identifiers. Together they are used to identify individual data items.

Signature

getItem( type, handle )

Parameters

Name Description Type Use
type Type of data item to be retrieved. string required
handle Data item identifier. Supports partial matches if full matches are not found. string required

Returns

This method returns a promise object, which can be in one of the following states:

  • Resolve - returns an object structured as follows:

    {
        type:   {String}  Item type.
        handle: {String}  Item handle.
        url:    {String}  Path to attachment file related with item.
        content: {String} Contains data if file is not binary.
    }
  • Reject - returns an object that is an instance of a generic Error class, as described below.

    {
      "name": error_code
      "message": detailed_message
    }

Where error_code stands for one of the error codes described in the Constants section of the Authentication article and detailed_message can be an additional message from the native side.

Related topics

Client Store
Legal notice | Copyright © 2018 and Confidential to Pegasystems Inc. All rights reserved
PDN | Feedback
Advanced...