Importing the Swagger file

About this task

Create a custom action for the application of your choice after you install the connector builder.

Procedure

  1. Go to the newly created scaffolding and run the wmio swagger <swagger_file> command. This command imports all API calls from the specified swagger file and then creates actions.
  2. Suppose you have a swagger file https://api.apis.guru/v2/specs/box.com/2.0/openapi.json and want to create actions by importing all API calls from this file. Run the wmio swagger https://api.apis.guru/v2/specs/box.com/2.0/openapi.json command to achieve the required result.
  3. Next, create the authorization for the custom action. If the service for which you are trying to create an action has an authorization type set to OAuth, you are prompted to confirm the OAuth provider. In the example, the authorization type is set to OAuth. If the authorization type is set to Connection or Token, the relevant action is created automatically.
  4. Enter N if you want to proceed without creating an authorization for the action. On clicking N, the relevant action is created automatically. Enter Y to confirm the OAuth provider. If the exact match of the OAuth provider is found, your custom action is created automatically. In case the exact match of the OAuth provider is not found, you are prompted to either select the required OAuth provider from the list of available providers or proceed without creating an authorization.
  5. On selecting Other, a list of available OAuth providers appear on the screen. Select the required OAuth provider. To proceed without creating an authorization, select Skip. The required actions are created automatically. After you have selected the relevant OAuth provider, your actions are created automatically in the /action directory. You can alternatively add an authorization by using the wmio auth command. To learn how to add an authorization by using this command, see Authentications. The created OAuth is used by all the actions that are present in the V1 folder of the action directory.