In this article

Overview

In SnapLogic Manager, the API Manager console provides a space where you can create APIs by referencing a specification. The new API asset acts as a container for the following SnapLogic assets.

You can create an API using one of four ways:

The first version is automatically created when you create the API. However, you can create additional versions of your API and manage them.

Prerequisites

API Manager

To navigate to the API Manager, go to Manager > API Management > API Manager.

APIM

APIs and Proxies appear in this list. You can view details about the API or Proxy by clicking it. You can also set permissions on your API.

Known Issue

Create the API using Design First

  1. In the API Manager page, under the APIs & Proxies tab, click the add icon ( (blue star) ) and choose New API.

  2. In Create New API, choose the source of the OAS file.

  3. Click Continue.

  4. In Create New API - Options, select your API Import Configurations.

  5. Click Import and Continue.

  6. In Create New API - Details, fill in the details for the new API.

  7. Click Create.

Troubleshooting Section for API Specification file

Any structural or syntax issues in the API, API Version, or Proxy specification file will give an error in the SnapLogic UI. You can change the specifications according to the error message in Swagger editor or any other editor tool.

Entity

Error Messages for incorrect JSON or YAML (OAS2.0 or OAS3.0) Specifications

Description and Resolution

API and Proxy

Spec Contains Error

Structural error

Expecting property name enclosed in double quotes: line 33 column 29 (char 782)

Line 33

Column 29

Spec Contains Errors

Structural error at $

'invalidField' does not match any of the regexes: '^x-'

Spec Contains Errors

Structural error

Invalid API specification: 'str' object has no attribute 'get

  • If the API Specification has incorrect structure, then the error message displays a missing path where the syntax is broken along with the line and column number.

  • If the API Specification file has incorrect or invalid data then it specifies the incorrect data.

  • You can edit the specs in any editor such as Swagger and upload the edited specification file to create the API, API Version or Proxy.

Example Workflow

  1. Create an API in the API Manager using upload option. Upload OAS 2.0 or 3.0 YAML or JSON API Specification file:

    example-apispec.png

     

  2. If the file contains an incorrect data or has a broken code structure then it gives an error:

    example-error-apispec.png

     

  3. You can edit the specification file in Swagger editor:

    example-apispec-swaggereditor.png

 

  1. After fixing all the errors in the Swagger editor, API is successfully created with the edited API specification file. 

When you upload a incorrect data API or Proxy specification file it displays error messages in the Create New API, Create Proxy, Swagger Editor of Publish API and Publish Proxy wizards.

Create the API from Existing Project Assets

  1. In the API Manager page, under the APIs & Proxies tab, click the add icon ( (blue star) ) and choose New API.

  2. In Create New API, choose Create from Existing Project and select the Project.

  3. Click Continue.

  4. In Create New API - Select Assets, select the types of assets you want to import to the new API. An Asset selected at the root level also imports the leaf-level Assets.

  5. Click Import and Continue.

  6. In Create New API - Details, fill in the details for the new API.

  7. Click Create.

  • You receive an error message when the reference jar file is incorrect or when the asset is not found.

  • When you create an API from an existing project, the reference assets, including error pipelines and accounts, located in various folders or directories, as well as the associated jar files linked to the accounts, are automatically updated.

Create the API from a Git repository

  1. In the API Manager page, under the APIs & Proxies tab, click the add icon ( (blue star) ) and choose New API.

  2. In Create New API, choose Create from Git Checkout.

    1. Repository: Select the Git repository from the dropdown list.

    2. Branches/Tags: Choose an existing branch or create a new branch:

      • Select the Branch or Tag to associate with your API.

      • (Optional) Enter a name to create a new branch from main.

    3. Click Continue.

  3. In Create New API - Details, specify the details for the new API.

  4. Click Create.

  5. Navigate to the Assets tab of the API version to view the Git repository associated with the API version assets.


    The following image shows a new branch:

  6. Select an asset and click (blue star) to view the available Git operations.

Creating an Empty API

  1. In the API Manager page, under the APIs & Proxies tab, click the add icon ( (blue star) ) and choose New API.

  2. In Create New API, choose Create Empty API.

  3. Click Continue.

  4. In Create New API - Details, fill in the details for the new API.

  5. Click Create.

Creating an APIM API in IIP

You can create an APIM API in IIP through the following workflows:

  1. Choose one of the following ways to open the dialog for a Triggered or Ultra Task:

  2. In the Create new API assets, select the target assets to include in your API, and then click Import and continue.

  3. In the Create new API details, enter the details.

  4. Click Create.

  5. Navigate to the API Manager to verify API creation.

Edit an API name

Rename the API to align with the company standards and best practices. Save the extra effort instead of copying the API to rename it and then deleting the old one.

  1. Navigate to API Manager > API > API details:

    rename-api-editdetails.png
  2. Click Edit Details to rename the API:

    edit-details-api.png
  3. Click Save. A message “API details has been updated successfully” displays in the UI.

note
  • You can only rename the unpublished APIs. Published APIs cannot be renamed because that would change the endpoint URL of the API.

  • Unpublish the API to edit the API name.

  • Special characters such as |, <, >, [, ], {, },#, ?, /, and \. cannot be used.

  • You can only rename the unpublished APIs. Published APIs cannot be renamed because that would change the endpoint URL of the API.

  • Unpublish the API to edit the API name.

  • Special characters such as |, <, >, [, ], {, },#, ?, /, and \. cannot be used.

Enabling "Try It Out" for your API

To allow API users to try out your API,

The Try it out button appears only if these two requirements are met.

To test the Try it out button for your API: Discovering APIs in the API Catalog

Troubleshoot for “Try It Out” functionality:

Areas to troubleshoot when an error occurs

Error messages in the console

Resolution

CORS

Access to fetch is blocked by CORS policy: Request header field authorization is not allowed by Access-Control-Allow-Headers in preflight response.

  • Check if the CORS Restriction policy is enabled. The default CORS Restriction policy can be enabled in the Settings Panel from the Portal Manager, Enable Try Me checkbox.

  • Check Access Control Request Headers because it is a mandatory field if it not configured it can give an error.

The CORS policy with a default setting provides a standard configuration.

Network Failure

Network Error

Check the Network Connectivity.

URL scheme in CORS settings dialogue box

Mixed Content: The page<>was loaded over HTTPS, but requested an insecure resource<>. This request has been blocked; the content must be served over HTTPS.

  • Use only “http” or “https” for the CORS request.

  • Check if the page is loaded over HTTPS matches the URL HTTPS scheme in the CORS request. If your page was loaded over HTTPS, and requested an insecure resource with HTTP, then an error occurs

FeedMaster and Load Balancer

Failed to load resource: net::ERR_NAME_NOT_RESOLVED

  • Check if there is at least one active FeedMaster node, a JCC node, and active Load Balancer.

Deleting an API from the API Manager Console

To delete an API, you must delete all versions and the assets in those versions. For details, see the following topics:

Related Content