Testing your work
host:8180/pc/resources/swagger-ui
Replace host with the actual server name. For example, replace
host with localhost if running the PolicyCenter application server on your local machine.
Working with Swagger UI
- Set the user name and password credentials in the Authorize dialog.
- See the list of published APIs available on this host.
- See the Swagger schema for the currently viewed API.
docs element lists the URL for each published
API.{
"/apis": {
"basePath": "/apis",
"description": "Dynamically lists the APIs that are available",
"docs": "http://localhost:8180/pc/rest/apis/swagger.json",
"title": "API List"
},
"/example/v1": {
"basePath": "/mc/activityapi",
"description": "APIs for manipulating activities",
"docs": "http://localhost:8180/pc/rest/mc/activityapi/swagger.json",
"title": "Activities API"
},
"/system/v1/server": {
"basePath": "/system/v1/server",
"description": "This API is related to system server resources.\n",
"docs": "http://localhost:8180/pc/rest/system/v1/server/swagger.json",
"title": "System tools server API"
}
}Viewing and testing the Activities API
Copy the docs URL for the Activities API and paste it into the
Explore field. After you click Explore,
Swagger UI generates the HTTP operations for the Activities API. Use Swagger UI
functionality to test each API endpoint and operation defined in the Swagger schema.
At this point, there is no backing functionality for the API operations. However, do not continue defining the Activities API if Swagger UI or the API operations generate any kind of error message. Fix any errors with your defined configuration files before continuing the API development process.
