Layer7 API Management

  • 1.  Post swagger to create API

    Posted Feb 28, 2018 05:46 AM

    I would like to create an API on Portal 4.2 through the post method of a swagger file.json Is it possible?



  • 2.  Re: Post swagger to create API

    Broadcom Employee
    Posted Feb 28, 2018 08:24 AM

    Hi, you can create APIs on Portal by a POST request to the Portal API, you would need a bit more information in your post than just the swagger, event though the swagger could be a part of the request body. Have a look here Portal API - CA API Developer Portal - 4.2 - CA Technologies Documentation 

     

    For more detailed information.



  • 3.  Re: Post swagger to create API

    Posted Feb 28, 2018 09:10 AM

    I would like to create API using a swagger file, the swagger file should be included in the POST. 



  • 4.  Re: Post swagger to create API
    Best Answer

    Broadcom Employee
    Posted Feb 28, 2018 05:25 PM

    Dear Mossucca ,

    diwmi01 already provided the document of portal api, can you expand

    POST /2.0/Apis

     

    under section

    Apis : API operations

    click Model to show the parameter description.

    There are 3 nodes related to the swagger file,

    SpecFilename (string, optional):

    Specifies the filename of the Swagger or WADL file that documents the API. If SpecFilename is specified, SpecContent should be specified as well.

    ,
    SpecContent (string, optional):

    Specifies the type of the specification file (ie Swagger, WADL, Json). The API needs a specification file so that developers can use the API Explorer to understand the API. If SpecContent is specified, SpecFilename should be specified as well.

    ,
    SpecFilesize (integer, optional):

    The size of the specification file in bytes (1048576)

    ,

     

    (The interactive document doesn't say, but SpecContent needs to be base64 encoded, the body "Example Value" shows the same).

     

    Regards,

    Mark