CDISC has developed a rich set of programmatic interfaces for accessing CDISC standards and their metadata through REST API implementation. Technical details can be found in our API Documentation where users can view specifications, examples, and schemas for each API endpoint.

This article highlights a feature in the API Documentation, called API mocking. Simply, users can try out each of the API endpoint to see how a request can be made, submit it, and see a mocked response returned. This is especially useful for prospective customers, wanting to know more about how it works before making a commitment.

Step-by-step guide

Ensure the server option Swagger API Auto Mocking is selected when trying out an endpoint.


StepInstructionNotes
1Go to the CDISC Library API Documentation web page: https://www.cdisc.org/cdisc-library/api-documentation.
2Select the entry that corresponds to SwaggerHub API Auto Mocking from the Servers drop down box.
  • This SwaggerHub URL (https://virtserver.swaggerhub.com/...) is not static and may change when a newer version of API Documentation becomes effective. Examples:


3Click on an endpoint to expand for Parameters and Responses.
  • A horizontal blue bar indicates an API endpoint. Each API endpoint has a Parameters and a Responses section.
  • Not all API endpoints have parameter specifications.
  • A parameter may be path or query type. See Swagger's API Host and Base URL for detailed explanations.
  • For example, Get CDISC Library CT Package has specifications for both parameter and response.
4Scroll down to the Parameters section, where a button labeled Try it out appears.


5Click the Try it out button. The button text will become Cancel. Another button labeled Execute will appear immediate below.

6Click the Execute button. The Responses section will be refreshed with a curl command, requested URL, and the mocked server response.
  • The curl command can be copied and pasted to a local computer for replicating the execution.
  • Note the following when using the SwaggerHub API Auto Mocking server:
    • The response body is a mocked response and is not representative of actual metadata.
    • The response header contains information specific to SwaggerHub. The CDISC Library production server produces a different set of response header.
7

OPTIONAL Where parameters are available for any given API endpoints, update the pre-populated values and re-execute.

  • Parameters will be not be enabled for update until the Try it out button is pressed.