You can easily publish your APIs SDKs as packages to language-specific package publishing platforms like npm, RubyGems and PyPi. You will need to add in your credentials for the package publishing platform that you want to use before you can publish any packages.
Click on the arrow visible next to your name on the header navigation (once you have logged in). From the drop-down menu, click on Settings.
From the left navigation bar, click on Package Management. You are presented with a list of supported package publishing platforms. Provide the credentials for the platform that you're going to use for publishing packages.
After you have added in your credentials:
On the APIMatic Dashboard, click the Generate button for the API you want to publish as a package.
If your API has multiple versions, you're prompted to select the API Version you want to publish packages for. Click on Proceed. If you have a single version of the API, you will not be prompted.
Before publishing, 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 package. 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. Package publishing 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 package publishing, 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 package publishing.
Once the validation errors are resolved (if any), click Proceed to move to the next step.
Upon successful validation, you are provided with the option to generate a portal or SDKs. Click on Publish Package.
Select the platform on which you want to publish your package.
Select the template for the platform that you selected in the previous step.
Select the Repository for the template. You will be prompted to the credentials page if your credentials are not saved. Once they are saved, access is granted.
Enter the details for the package such as the
Version. Make sure that the package name is unique and a package by that name is not already published on the platform. Click on
You will receive a confirmation message when the package is successfully published. You can visit the URL to view the package in the publishing platform itself.
You can add the package information to your API portal for a self published package so that all your packages are available from the portal.
Once you have generated your portal, click on Customize to open up the Portal Editor.
Click on Platforms under the Documentation Settings sidebar.
For any of your required language platforms, go to the Published Platforms tab and click on Add Self-Published Package.
Provide the Package Name and Version of your existing package. Click on Add.