All Products
Search
Document Center

Mobile Platform as a Service:API mock

Last Updated:Feb 03, 2026

API mocking lets you simulate an API call and return a specific response. To use this feature, navigate to the Manage gateway > Function Switch page and enable the API Mock switch.

Procedure

Configure API mocking as follows:

  1. Choose the Manage APIs tab> More > API Mock in the Operation column of the API list.

  2. On the Mock Configuration page, configure the following parameters:

    • API Mock: Enable the API Mock switch.

    • Hit Rule: Only the Percentage rule is currently supported.

    • Rule Configuration: A percentage value from 0 to 100.

    • Mock Data: Enter the mocked API response data. The data must be in the following format:

      {
      "resultStatus": 1000,
      "tips": "ok",
      "result": "==Enter the mocked business data here=="
      }

      Where:

      • resultStatus is the response code. For more information, see Gateway result codes.

      • tips is the response message.

      • result is the custom response data in JSON format.

  3. Click Submit.