Airapi User Guide
  • πŸ“™What is Airapi?
  • πŸ“˜Getting Started
    • Manage Environment
      • What is an Environment?
      • Add a New Environment
      • Update Environment
        • Reset Environment Cache
      • Delete Environment
      • Dashboard
      • Messages
      • Configurations
      • Endpoints
      • Applications
      • Documents
      • Agreements
      • Account Settings
    • Create Your Account
      • Verify Email
      • Forget Password
  • πŸ“—Management Portal
    • API Definition
      • Consent Management
      • Scope Management
  • πŸ“•Quota Management
    • Quota Management
    • API Base Quota
    • Application Base Quota
    • Domain Base Quota
  • πŸ“”UK Open Banking
    • Account Details
    • Regular Payments
  • πŸ“’TCMB Standard
    • Hata KodlarΔ±
  • πŸ““Advanced Features
    • App To App Authentication
    • mutual TLS
  • πŸ“–How to
    • How To Get a Client Credential Token?
    • How To Get an AppToApp Token?
    • How To Add Multiple Function Policy?
    • How To Add Data Mask Policy?
    • How To Create a New Tenant User?
    • How To Configure Developer Portal?
    • How To Modify Global Rate Limit?
    • How To Retire an API?
    • How To Reject a Payment Initiation?
    • How To Add a Global Variable?
    • How To Restrict Working Hours?
    • How To Track Gateway Error?
    • How To Export/Import Endpoints?
    • How To Reject Account Consent?
    • How To Exclude an Endpoint?
    • How To Define an Endpoint?
    • How To Define a Mock Policy?
    • How To Define a Rate Limit Policy?
    • How To Define a Mail Policy?
    • How To Transform a Header?
    • How To XML to JSON?
    • How To JSON to XML?
  • πŸ“™Release Notes
    • Versions
    • v2.1.80
    • v2.1.76
    • v2.1.72
    • v2.1.68
    • v2.1.64
    • v2.1.60
    • v2.1.56
    • v2.1.52
    • v2.1.44
    • v2.1.36
    • v2.1.20
    • v2.1.16
    • v2.0.96
    • v2.0.80
    • v2.0.72
    • v2.0.70
    • v2.0.66
    • v2.0.60
    • v2.0.55
    • v2.0.51
    • v2.0.50
    • v1.9.47
    • v1.9.46
    • v1.9.45
    • v1.9.44
    • v1.9.43
    • v1.9.42
    • v1.9.41
    • v1.9.40
    • v1.9.39
    • v1.9.38
    • v1.9.37
    • v1.9.3
    • v1.9.2
    • v1.9.1
    • v1.8.8
    • v1.8.7
    • v1.8.6
    • v1.8.5
    • v1.8.4
    • v1.8.3
    • v1.8.2
    • v1.8.1
    • v1.8.0
    • v1.7.9
    • v1.7.8
    • v1.7.7
    • v1.7.6
    • v1.7.5
    • v1.7.4
    • v1.7.3
    • v1.7.2
    • v1.7.1
    • v1.7.0
    • v1.6.9
    • v1.6.8
    • v1.6.7
    • v1.6.5
    • v1.6.2
    • v1.6.0
    • v1.5.8
    • v1.5.6
    • v1.5.4
    • v1.5
    • v1.4.6
    • v1.4.3
    • v1.4.0
    • v1.3.0
    • v1.2.1
    • v1.1.1
    • v0.8.6
  • βš™οΈPlanned Activities
Powered by GitBook
On this page
  • What is to Define a Mock Policy?
  • How It Works?
  1. How to

How To Define a Mock Policy?

PreviousHow To Define an Endpoint?NextHow To Define a Rate Limit Policy?

Last updated 2 years ago

What is to Define a Mock Policy?

To define a mock policy enables ApiGo users to implement and test applications with ApiGo even if the back end is not available to send real responses. The ability to mockup responses can be useful to the user who tries ApiGo the first time. Also, testing with mock data may be useful when the API is designed first, and the backend implementation comes later or, the backend is being developed in parallel.

Tenant admin can define the HTTP Method, authorization type, and version in the first line to the API configuration screen. The admin needs to define an endpoint path configured as a query string and used to reach API by a third-party application in the second one. For more information to define an endpoint, .

In the third line, a destination path that will be used to reach the ApiGo User’s services can be defined by the admin. If mock data is added, there is no need to define a destination path, but otherwise, it must.

Tenant admin can create a fully functional API without writing any line of code to handle consumer calls. The mock policy replaces the default HTTP invoker by putting a mock invoker without an HTTP call between the ApiGo and a backend.

How It Works?

  1. The steps will show how to use ApiGo to return a mocked response with a policy defined on the endpoint configuration screen. Tenant admin can define an endpoint and set a mock policy on the Management Portal.

-> Endpoints -> Add Endpoint -> Add Policy -> Mock

2. The mock policy works with JSON responses, the common format to express data. It has a simple syntax, is human-readable, and can be efficiently parsed in modern languages. Tenant admin can add any JSON syntax with the mock policy and status code, which will be used for responding to the API call.

3. The configurations need to be saved and published on the endpoint definition screen to respond to the API calls with the mock data. The request sent to the gateway will be responded to with mock data and status code defined on the mock policy wrapper.

πŸ“–
click here
Management Portal
apigo mock policy page
apigo endpoints mock
apigo mock policy response