widgetquery/getWidgetData

Lets you get widget data from a story in SAP Analytics Cloud.

API Request Details

URL

widgetquery/getWidgetData

Request Type

GET

URL Parameters

Refer to the table below.

URL Parameters

Name

Mandatory/Optional

Value

Type

storyId

Mandatory

ID of the story.

string

widgetId

Mandatory

ID of the widget, for example, Chart_1.

string

type

Mandatory

The supported value is kpiTile, which returns the format of SAP Mobile Start KPI monitoring tiles.

string

Sample Request

https://<TENANT_URL>/widgetquery/getWidgetData?storyId=<STORY_ID>&widgetId=Chart_1&type=kpiTile

Successful Sample Response

Response Body

{
        "info": "QuarterEnds!",
        "infoState": "Positive",
        "number": 56985390.41,
        "numberDigits": 1,
        "numberState": "None",
        "numberUnit": "EUR",
        "stateArrow": "Up",
        "subtitle": "in Million EUR",
        "title": "Gross Margin"
}

Mapping Between SAP Mobile Start Tile and SAP Analytics Cloud Numeric Chart

Tile Property

SAP Analytics Cloud Property/Description

title

Measure or account of primary value

subtitle

Chart subtitle

number

Primary value

numberDigits

Decimal places

numberState:

  • Positive

  • Critical

  • Error

  • Neutral

  • None

Threshold state:

  • OK

  • Warning

  • Critical

  • Neutral

  • Informative, custom symbol or none

numberUnit

Currency

stateArrow:

  • Up

  • Down

Variance positive/negative arrow indicator:

  • Positive

  • Negative

info

Variance name and difference

infoState:

  • Positive

  • Negative

  • Neutral

Variance state:

  • Positive

  • Negative

  • Zero

Error Response

Response Body

{ 
    code: '${ERROR_CODE}', 
    message: '${ERROR_CONTENT}' 
} 

Possible Error Codes

HTTP Status Code

Error Code

Description

400

PARAM_NOT_VALID

Story ID and widget ID are required.

STORY_TYPE_NOT_SUPPORTED

Only stories are supported.

WIDGET_TYPE_NOT_SUPPORTED

Only charts are supported.

401

UNAUTHORIZATION

You need to have the read permission for the model.

404

STORY_NOT_FOUND

The story couldn’t be found by the given ID.

WIDGET_NOT_FOUND

The widget couldn’t be found by the given ID.

500

UNEXPECTED

There are other errors than the listed ones.

503

TARGET_SERVER_NOT_REACHABLE

The server is currently unreachable.