API7 Docs
API7 GatewayAPI7 Enterprise Developer Portal APIsCreate a subscription for an API Product.

Create a subscription for an API Product.

POST /api/api_products/{api_product_id}/subscriptions

POST /api/api_products/{api_product_id}/subscriptions

Interactive request editor loads with JavaScript.

Authorization

BearerAuth DeveloperIDHeader
AuthorizationBearer <token>

In: header

X-Portal-Developer-ID<token>

In: header

Path Parameters

api_product_id*string

The unique identifier of the API product.

Match^[a-zA-Z0-9-_.]+$
Length1 <= length <= 256

Request Body

application/json

The request body for creating a subscription.

Response Body

application/json

application/json

curl -X POST "$API_BASE_URL/api/api_products/bd58fce2-b6cc-4d2d-a53c-6ce11b19c101/subscriptions" \  -H "Content-Type: application/json" \  -d '{    "application_id": "bd58fce2-b6cc-4d2d-a53c-6ce11b19c101"  }'

The resource was created successfully.

Complete operation details and schema variants

POST /api/api_products/{api_product_id}/subscriptions

Create a subscription for an API Product.

Parameters

  • api_product_id (path, string, required): The unique identifier of the API product.

Request body

Content type: application/json

  • application_id (string, required): Application ID.

Responses

  • 201: The resource was created successfully.
  • 400: Bad request.
  • status (integer, required): The HTTP status code of the error response.
  • message (string, required): The error message.
  • 401: Unauthorized. Response fields (application/json): identical to POST /api/api_products/{api_product_id}/subscriptions, response 400 above.
  • 500: Internal server error.

cURL

curl -X POST '$API_BASE_URL/api/api_products/{api_product_id}/subscriptions'