7.3 Invoking or Testing the APIs

Secure API Manager provides an integrated Swagger editor that allows you to test and invoke the APIs before users or services access them. This ensures that the APIs work correctly. The steps to test and invoke the APIs are different depending on the type of API subscriptions you have.

7.3.1 Invoking and Testing the REST APIs

Secure API Manager allows you to test and invoke the REST APIs through the built-in Swagger tools. To invoke and test the REST API, you must know and understand REST and the Swagger tools. For more information, see Required Knowledge.

  1. Log in to the Store using the URL you received from your administrator.

    https://lifecycle-manager-dns-name:9444/store
  2. Ensure that you have created an application and that you have subscribed to the appropriate API or APIs. For more information, see Creating Applications and Subscribing to APIs.

  3. Generate an access token for the API.

    1. On the Applications tab, click the name of the appropriate application.

    2. On the overview page, click the Product Keys tab, then specify the appropriate information for your API.

    3. Click Generate keys.

    4. Click Close to close the overview page.

  4. Click the APIs tab, then click the name of the appropriate API.

  5. Click the API Console tab.

  6. Click the appropriate REST call to expand it, then click Try it out.

  7. Click Execute, then view the response.

  8. Ensure that the response contains the expected response.

7.3.2 Invoking and Testing the SOAP APIs

Secure API Manager allows you to test and invoke the SOAP APIs through the built-in Swagger tools. To invoke and test the SOAP API, you must know and understand SOAP and the Swagger tools. For more information, see Required Knowledge.

  1. Log in to the Store using the URL you received from your administrator.

    https://lifecycle-manager-dns-name:9444/store
  2. Ensure that you have created an application and that you have subscribed to the SOAP API or APIs. For more information, see Creating Applications and Subscribing to APIs.

  3. Generate an access token for the API.

    1. On the Applications tab, click the name of the appropriate application.

    2. Click the Product Keys tab, then specify the appropriate information for your API.

    3. Click Generate keys.

      or

      (Conditional) If you have generated keys before, click Regenerate.

      By default, access tokens expire after one hour.

    4. Click Copy to copy the access token.

      NOTE:Ensure that you have the latest flash plug-in installed in your browser to have the Copy button work for the access token in the Store.

    5. Click Close to close the details page.

  4. Invoke the SOAP API with the embedded Swagger API Console.

    1. Click the name of the SOAP API, then click the API Console tab.

    2. Expand the POST method, then click Try it out.

    3. Enter the SOAP Request and SOAP Action information for your API.

    4. Click Execute.

    5. View the response of the SOAP API in the console.

You can also invoke the SOAP API using any SOAP client. You must enter the WSDL of the SOAP API and generate an access token that you copy and paste in the Authorization header of the SOAP client.

7.3.3 Invoking and Testing the WebSocket APIs

Secure API Manager allows you to test and invoke the WebSocket APIs. You must have a WebSocket client that works with the API to invoke and test the API. You must also know and understand the WebSocket protocol to invoke and test the API. For more information, see Required Knowledge.

  1. Log in to the Store using the URL you received from your administrator.

    https://lifecycle-manager-dns-name:9444/store
  2. Ensure that you have created an application and that you have subscribed to the WebSocket API or APIs. For more information, see Creating Applications and Subscribing to APIs.

  3. Generate an access token for the API.

    1. On the Applications tab, click the name of the appropriate application.

    2. Click the Product Keys tab, then specify the appropriate information for your API.

    3. Click Generate keys.

      or

      (Conditional) If you have generated keys before, click Regenerate.

      By default, access tokens expire after one hour.

    4. Click Copy to copy the access token.

      NOTE:Ensure that you have the latest flash plug-in installed in your browser to have the Copy button work for the access token in the Store.

    5. Click Close to close the overview page.

To invoke the WebSocket API you can use any WebSocket client. Use the instructions that come with the WebSocket client to invoke the WebSocket API. You use the access token from the Store as the Authorization Bearer token in the WebSocket client. Also, you use the Production Endpoint or Sandbox Endpoint from the API as the String URL that you define in the WebSocket client.