API Reference Documentation (M-Live)

API Reference Documentation (M-Live)

Our REST API enables you to integrate and run your Appium automation tests on M-Live. Appium API follows the general conventions of REST. The API reference has 3 sections:

  1. Authentication
  2. Devices
  3. Application Library

1. Authentication

momentumToken is required for all operations. Keep the accessToken value to use in the header for the next requests.

Log in

Request

POST https://console.momentumsuite.com/rdcApi/api/auth

POST data (raw):
{"username":"<your-user-name>","password":"<your-password>","grant_type":"password"}

Response

{"result":{"accessToken":"eyJhbGc......","refreshToken":"5ABA9FEDCED26F5A5079E5A4BA....","expiresIn":7200,"tokenType":"Bearer"},"status":"SUCCESS","message":"Resource retrieved","validationMessages":null}

2. Devices

Get a list of real Android and iOS devices with their status and other properties.  These are not simulators or emulators.

Devices List

Request

GET https://console.momentumsuite.com/rdcApi/api/devices/list

Request Header

Authorization value will be “Bearer accessToken“.

Authorization: Bearer eyJhbGciOiJS.....
Content-Type: application/json

Response

  • “status”: 1 -> ONLINE
  • “status”: 2 -> BUSY
{
  "result": [
    {
      "id": 5,
      "farmId": 12,
      "signalPort": DEVICE-ID,
      "deviceToken": "UDID",
      "deviceBrand": "Samsung",
      "deviceName": "Samsung Galaxy A71",
      "deviceModel": "SM-A715F (12)",
      "iconTag": "samsung-galaxy-s8.jpg",
      "osVersion": "11.0",
      "deviceOs": "android",
      "releaseDate": "2019-12-12T12:53:57+00:00",
      "screenSize": "6.7\"",
      "resolution": "1080 x 2400",
      "status": 1,
      "createdAt": "2022-03-02T12:53:57+00:00",
      "updatedAt": null,
      "liveWatchSupport": true,
      "isBusy": false,
      "liveWatchId": "3e30c68837f72355",
      "activeSessions": [],
      "deviceCredential": {
        "remoteTestUrl": "console.momentumsuite.com",
        "remoteTestPort": 443,
        "momentumUser": "YOUR-USER",
        "momentumToken": "YOUR-TOKEN",
        "momentumGw": DEVICE-ID
      }
    },
.....
.....
.....
  ],
  "status": "SUCCESS",
  "message": "Resource retrieved",
  "validationMessages": null
}

3. Application Library

In order to test your native and hybrid apps on M-Live using Appium, you first need to upload an Android app (.apk/.aab file) or an iOS app(.ipa file) to M-Live Application Library. Use our REST API endpoints to upload and manage your apps on M-Live.

List uploaded apps

Request

GET https://console.momentumsuite.com/rdcApi/api/ApplicationLibraries/list

Request Header

Authorization value will be “Bearer accessToken“.

Authorization: Bearer eyJhbGciOiJS.....
Content-Type: application/json

Response

{
    "result": [
        {
            "id": 113,
            "title": "myapp.apk",
            "appUrl": "ms://06d8c9e89......",
            "createdAt": "2022-05-13T08:57:46+00:00",
            "appType": 1
        },
        ....
.....

    ],
    "status": "SUCCESS",
    "message": "Resource retrieved",
    "validationMessages": null
}



Upload an app

Request

POST https://console.momentumsuite.com/rdcApi/api/ApplicationLibraries

POST data (form-data):

Title:SmartMobile
IsReSignable:false
ApplicationFile: myapp.apk

Request Header

The authorization value will be “Bearer accessToken“.

Authorization: Bearer eyJhbGciOiJS.....
Content-Type: multipart/form-data

Response

You can use appId as “ms:\\appId“. This URL only works with the Momentum Suite’s Appium gateway.

{
    "result": {
        "id": 177,
        "title": "SmartMobile",
        "appId": "3e86e209........",
        "appUrl": "http://momentumv2.mobven.com:8084/Upload/0/3e86e209-cb2.....-app.apk",
        "createdAt": "2022-07-27T21:13:09.557891+00:00",
        "appType": 1
    },
    "status": "SUCCESS",
    "message": "New applicationlibrary has been created",
    "validationMessages": null
}



Delete an app

Request

DELETE https://console.momentumsuite.com/rdcApi/api/ApplicationLibraries/177

Request Header

Authorization value will be “Bearer accessToken“.

Authorization: Bearer eyJhbGciOiJS.....
Content-Type: application/json

Response

{
    "result": null,
    "status": "SUCCESS",
    "message": "Entity \"177\" has been deleted",
    "validationMessages": null
}

Related Posts