Skip to main content

Generating SDKs in APIMatic

You can generate ready-to-deploy SDKs in any language of your choice for your API specification file in any supported format. APIMatic further provides flexibility to customize code generation using Customizable CodeGen Settings.

Depending on your environment, APIMatic offers the following ways to generate SDKs:

Generate SDKs via Web

  1. On the APIMatic Dashboard, click the Generate button for the API you want to generate SDK for.

    Generate SDK APIMatic

  2. If your API has multiple versions, you're prompted to select the API Version you want to generate SDKs for. Click on Proceed. If you have a single version of the API, you will not be prompted.

    API Version APIMatic

  3. Before generating the code, APIMatic performs validation of your API definition file. The validation involves checks to ensure that the API definition is structurally correct and contains complete information to ensure comprehensiveness of the code. There are 3 levels of validation messages that you may encounter:

    • Errors: Any syntax/semantic issues found in the API definition; for example, if a GET method contains a request body. Code generation cannot proceed in case of an error. You will be required to fix the issues listed for your definition if that happens.
    • Warnings: Any unexpected behaviour that may affect the output; for example, if the parameter example provided is invalid. Warnings will not halt code generation, but it is recommended that you fix these issues so your API definition results in the best possible experience.
    • Messages: Recommendations or suggestions that can help enhance your API definition and its completeness. For example, messages can point out that an endpoint description or a parameter example is missing. Messages will not halt code generation.

    Once the validation errors are resolved (if any), click Proceed to move to the next step.

    API Validation APIMatic

  4. Upon successful validation, you will have the option to obtain the SDK in three possible ways:

    • Download the SDK as a Zip file
    • Deploy SDK on GitHub
    • Publish SDK as a package

    For this walkthrough, we will download the SDK as a ZIP file. Click on Download as Zip.

    Download SDK APIMatic

  5. Next, select the Language Platform for your SDK generation:

    APIMatic SDK Platform

  6. Select the required Template for that particular language/platform.

    Platform Template

  7. Once the SDK is generated successfully, you can either choose to click on Generate for another language or download the SDK by clicking on Download as Zip. By default, it is downloaded to your default download location and the zip file is named as <API-NAME>-<SDK-PLATFORM>.

    SDK Success

  • To learn how to Publish SDKs as Packages, refer to Publishing Packages.
  • To learn how to deploy SDKs to GitHub, refer to Deploy to GitHub.
  • APIs imported from MuleSoft’s Anypoint Platform come with the Configure SDK option to manage CodeGen Settings for the SDK generation.

Anypoint API Sample

Generate SDKs via API

You can generate SDKs in any language of your choice for your API definition file using APIMatic's CodeGen API. This can be done either on files on your system (external), or API specifications imported into APIMatic as an API entity.

Generate SDKs via External Files

Generate SDKs via Imported APIs

Generate SDKs via APIMatic CLI

APIMatic CLI allows automatic SDK generation for your APIs in multiple popular languages. For further details on how to generate the SDK through the CLI, refer to Generate SDK via CLI Docs.