Anypoint Exchange is a marketplace of reusable, pre-built assets in a single location. Anypoint provides companies agility by offering developer-friendly tools to design, implement, test, and deploy ready-to-use APIs; leading to a seamless developer experience.
APIMatic enhances this experience by enabling API providers to go beyond API documentation and generate language-idiomatic SDKs for faster integration of the Anypoint Exchange Assets. You can generate SDKs in multiple popular programming languages:
- .NET
- Java
- PHP
- Python
- Ruby
- TypeScript
- Go (coming soon)
With a single click, you can import APIs from your MuleSoft account to APIMatic, and start generating SDKs in all the languages above. In this blog, you’ll learn how to create SDKs on your Anypoint API Portal using APIMatic, assuming you already have a MuleSoft account.
Step 1: Publish New Anypoint Exchange Assets
On Anypoint Exchange, click on the Publish new asset button.
Provide the asset Name and select the Asset type (REST API, SOAP API, Async API, etc) from the drop-down list. For example, I added Test-API. Next, choose an option for the Lifecycle state and click on Publish. For details, refer to Create an Asset Anypoint Docs.
Step 2: View or Edit Changes to the Asset
Once the asset is published, you can edit the Assets portal to change its name, icon, description, tags, and categories, and add custom documentation.
Simply open the asset list from Exchange and select the asset created via step 1. To get more information, look at the documentation describing an Asset in Anypoint.
Step 3: Login to APIMatic with Anypoint Exchange Account
Browse to APIMatic and click the Login button to open the login form. Click Sign in with Anypoint Platform to create an APIMatic account against your MuleSoft account or link your existing APIMatic account with your MuleSoft Account.
Step 4: Import Anypoint Exchange Assets into APIMatic
Once you have logged in, click Sync Anypoint in the APIMatic Dashboard to import all the new or existing assets published in Anypoint Exchange to APIMatic.
The imported Anypoint assets contain an Anypoint API tag on the top left corner. These assets allow you to:
- Generate language-idiomatic SDKs and customize how the code is generated via configurable CodeGen settings. These include configuration, model, endpoint settings, generic code styling, etc. To generate the SDKs, click on Configure SDK.
- Generate an interactive API developer Portal containing API documentation, dynamic code samples, and a live API playground. To generate the Portal, click on Generate.
Step 5: Generate SDKs for Your Anypoint API Imported in APIMatic
After importing assets to APIMatic, you can generate SDKs for your assets in multiple programming languages, using two ways:
- Generate an API Portal and Download SDK
- Download SDKs on your Anypoint Asset Portal using APIMatic API Portal
Option 1: Generate an API Portal and Download SDK
Choose any Anypoint API imported on the dashboard and click on Generate. Upon successful validation of the API, you have the option to obtain the SDK in three possible ways:
- Download the SDK as a .zip file. For more details, refer to Generate SDKs via Web.
- Deploy the SDK on GitHub. To learn more, go to Deploy SDK on GitHub Docs.
- Publish the SDK as a package to language-specific package publishing platforms. Go to Publishing SDKs as a Package Docs.
Click on Preview API Portal to preview the Portal. Select any supported language and click on Get SDK to download the SDK as a zip file.
Option 2: Download SDKs on your Anypoint Asset Portal using APIMatic API Portal
Use your Anypoint Asset Portal to link to the downloadable SDKs generated in APIMatic.
1. Create Links to the APIMatic Portal in the Anypoint Portal
On Anypoint Exchange, select any asset, and preview its Portal. Click Edit documentation and add a new page. Add any custom information in Markdown about the API, its usage, and list down the languages you have created the SDKs for.
Generate an APIMatic API Portal for the asset selected via the method explained in the previous step and add the published Portal link for each language to download the SDK.
2. Publish Public Asset Portal and Download SDKs
You can also publish the asset Portal for internal and external developers. Select an asset and click on Share in the Asset Portal. Your users can now view the public portal and download the SDKs added in the previous step.
[Optional] Step 6: Publish SDKs to GitHub and Package Registries
Option 1: Publish SDKs to GitHub
To directly publish SDKs to GitHub, click Generate and then Deploy at GitHub on the SDK generation dialogue box.
Choose an existing repository or create a new one. Enter a commit message and click Deploy. You’ll see a link to your repository. For more information, go to the APIMatic GitHub Integration Docs.
Option 2: Publish SDK to Package Registries
To publish SDKs as a package, click Generate and then Publish Package on the SDK generation dialogue box. You will need to add your credentials for the package publishing platforms that you want to use before publishing any package.
Select any language in which you want to publish your package. Choose the template and select the Repository. Write Package Name, Version, and click on Publish. You’ll receive a confirmation message shortly. For details, go to the Publishing SDK as a Package Docs.
Conclusion
Creating language-idiomatic, production-ready SDKs straight from your API definition files is integral to your APIs adoption. APIMatic autogenerates feature-rich SDKs in the developer's language that can be utilized on any platform, in this case, Anypoint Exchange. For more detail, feel free to reach out or sign up at APIMatic and kick off an amazing developer experience for your Anypoint APIs!