API Integration

    Compliance Checker and cHemTS provide a REST interface for interacting with their services.

    API Documentation

    If you do not have an installed or hosted version of Compliance Checker or cHemTS, the demo showcasing the latest API endpoints is available at https://cchecker-demo.chemaxon.com/cc-api/swagger-ui.html#/.

    {warning} Please note that the demo site has limited content. Only endpoints requiring (non-administrator) user permissions can be invoked.

    If you already have an on-premise installation of Compliance Checker or cHemTS, the REST API can be accessed using a URL that typically follows this pattern (by default port is set to 8066).

    https://<host>:<port>/cc-api/swagger-ui.html

    In case your Compliance Checker or cHemTS is hosted by Chemaxon, the API documentation as a Swagger UI page is available at the following URLs, depending on your subscription:

    https://cchecker.<your company name>.cxn.io/cc-api

    or

    https://chemts.<your company name>.cxn.io/cc-api

    API Authentication

    API calls will return valid responses only if the request is authenticated. Additionally, certain endpoints usually require specific user roles depending on their functionality.

    Authentication with On-Premise Compliance Checker or cHemTS

    For on-premise installations, the endpoints can be accessed using Basic Authentication. This requires adding an Authorization header to the HTTP request, which encodes a username and password pair that corresponds to the user executing the API call.

    Authentication with Hosted Compliance Checker or cHemTS

    When Compliance Checker and cHemTS are hosted by Chemaxon, the integration endpoints are secured via Amazon Cognito which serves as an OAuth 2.0 authentication provider. While this integration is more complex compared to Basic Authentication, it provides enhanced security.

    The steps to implement OAuth 2.0 integration with Compliance Checker or cHemTS depend on several factors, including your preferred programming language and frameworks. However, the general process is as follows:

    1. Obtain credentials and provider URL: Chemaxon provides the clientId, clientSecret and the URL of the authorization provider (i.e. the Cognito resource) in advance.
    2. Retrieve access token: Use the credentials to request an access token from the authorization provider's token endpoint.
    3. Make API call: Once the access token is retrieved, include it in the request's Authorization header as a Bearer token to invoke the integration endpoints.
    4. Token management: Since access tokens have a limited lifespan, subsequent calls may require refreshing the token or retrieving a new one before it expires.

    The steps outlined above can be tested using the Swagger UI page of your application.