Mobile REST API examples

Introduction

The Web REST API can be used to run queries against the collected data and to configure a new mobile app. For fundamentals about authentication, rate limiting, terminology, and conventions, see Web REST API.

This page provides web REST API examples related to mobile app monitoring, and guides about how to access to the same data by using Instana's user interface whenever possible.

Listing all supported mobile app monitoring metrics

Currently, the Instana user interface does not currently allow inspection of all possible metrics. But you can get all these metrics related to mobile app monitoring by using the web REST API call as follows:

curl -H "Authorization: apiToken $API_TOKEN" \
  "https://$UNIT-$TENANT.instana.io/api/mobile-app-monitoring/catalog/metrics?pretty"

Listing supported mobile app monitoring tags

User interface

You can see the available grouping and filtering tags for each beacon type within the mobile app monitoring analysis area by clicking Add filter or Add group.

Available Tags within Instana's user interface

Web REST API

Here is an example Web REST API call to view the available grouping tags for sessionStart beacon type:

curl -H "Authorization: apiToken $API_TOKEN" \
  "https://$UNIT-$TENANT.instana.io/api/mobile-app-monitoring/catalog?beaconType=sessionStart&useCase=GROUPING&pretty"

Activity breakdown by platform

User interface

The mobile app monitoring analyze view can provide the information about Activity breakdown by platform. To achieve this goal, group by mobileBeacon.platform while optionally filtering for a specific mobile app that uses mobileBeacon.mobileApp.name. Next, configure the metrics that you are interested in. Within the screen capture that you selected, you can see the beacon count and beacon duration.

Platform Activity Breakdown within Instana's user interface

Web REST API

Here is an example Web REST API call to view the activity breakdown by mobile app platform:

curl -X POST \
  -H 'Content-Type: application/json' \
  -H "Authorization: apiToken $API_TOKEN" \
  "https://$UNIT-$TENANT.instana.io/api/mobile-app-monitoring/analyze/beacon-groups?pretty" \
  -d '
{
  "type": "HTTP_REQUEST",
  "group": {
    "groupbytag": "mobileBeacon.platform"
  },
  "metrics": [
    {
      "metric": "beaconCount",
      "aggregation": "SUM"
    },
    {
      "metric": "beaconDuration",
      "aggregation": "MEAN"
    }
  ],
  "pagination": {
    "retrievalSize": 200
  },
  "order": {
    "by": "beaconCount",
    "direction": "DESC"
  },
  "tagFilters": [
    {
      "name": "mobileBeacon.mobileApp.name",
      "value": "robotshop",
      "operator": "equals"
    }
  ],
  "timeFrame": {
    "windowSize": 3000000
  }
}
'

Custom Geo IP mappings

Custom Geo IP mappings can be added by using the Web Rest API or the user interface. Refer to the Custom Geographic Details Configuration for examples.