Ana içeriğe geç

List Mock APIs

Endpoint​

GET /apiops/projects/{projectName}/mockapis/

Authentication​

Requires a Personal API Access Token.

Authorization: Bearer YOUR_TOKEN

Request​

Headers​

HeaderValueRequired
AuthorizationBearer {token}Yes

Path Parameters​

ParameterTypeRequiredDescription
projectNamestringYesProject name

Response​

Success Response (200 OK)​

{
"status": "SUCCESS",
"resultList": [
{
"id": "66f1c0a2e4b0a1b2c3d4e5f6",
"name": "Customer Accounts",
"description": "Mock of the customer accounts service",
"version": "1.0.0",
"projectId": "66f1bf10e4b0a1b2c3d4e5a1"
},
{
"id": "66f1c0b7e4b0a1b2c3d4e5f7",
"name": "Orders",
"description": null,
"version": "1.0",
"projectId": "66f1bf10e4b0a1b2c3d4e5a1"
}
],
"resultCount": 2
}

Response Fields​

FieldTypeDescription
idstringMock API ID
namestringMock API name
descriptionstringMock API description, null when not set
versionstringMock API version. The generated OpenAPI specification uses it as info.version. A Mock API saved before the version field existed returns 1.0.
projectIdstringID of the project that owns the Mock API

Error Response (400 Bad Request)​

The user does not have the required permission, or the project does not exist.

{
"status": "FAILURE",
"resultMessage": "User does not have required VIEW permission for API_CREATOR in this project!"
}

Error Response (401 Unauthorized)​

The token is missing or not valid. For the error format, see Error Handling.

cURL Example​

curl -X GET \
"https://demo.apinizer.com/apiops/projects/MyProject/mockapis/" \
-H "Authorization: Bearer YOUR_TOKEN"

Notes and Warnings​

  • Read-only: This endpoint does not modify anything and does not trigger a deployment
  • Empty project: A project with no Mock APIs returns resultList: [] and resultCount: 0, not an error
  • No endpoints: The list does not contain the endpoints of the Mock APIs. To get them, use Get Mock API

Permissions​

  • User must have API_CREATOR + VIEW permission in the project