3.10. Export and Import API Packs

You can export data from Published API Packs and import data for API Packs that are in Published States. The exported file is saved in a Zip file called ‘Export.zip’. The Zip file contains the data.json file that contains information about the API Pack(s) in JSON format.

There are two methods that you can use to export/import Published API Pack data:

  • Individually from the API Pack Configuration screen - Under this method, export/import is performed on selected Published API Packs individually. The exported Zip file has the format Export_APIPACK_packOne(API pack name)_REST(Type)_date(dd_mm_yyyy)-time(hh_mm_ss) as the Zip file name.The Zip file contains a folder structure as shown in the figure below:

    Zip file folder structure

    Fig. 3.286 Individual Export Zip file folder structure

  • Collectively from the API Packs List screen - Under this method, export/import is performed on all Published API Packs collectively and data is either stored into or retrieved from one composite file. When you export all Published API Packs collectively, the Zip file takes ‘Export’ as the base name so the file name shall be Export_APIPACK_ALL_date(dd_mm_yyyy)-time(hh_mm_ss). The Zip file contains a folder structure as shown in the figure below: *. The Zip file contains a folder structure as shown in the figure below:

    Zip file folder structure

    Fig. 3.287 Collective Export Zip file folder structure

There are two methods that you can use to import Published API Packs:

  • Full Import - enables you to overwrite existing data
  • Delta Import - retains the existing data and only updates new data from the imported file

API Pack Export and Import Rules

An export of an API Pack, exports details, such as overview description, API Resources attached to the Pack, Usage Plans and Usage Policies attached to the Usage Plans, Pack documentation and Branding details.

When importing from an exported file:

  1. All the APIs that were present at the time of the export should already exist either in the import file or in the database to which they are being imported.
  2. All the store categories that were assigned to the Pack at the time of export should exist in the import file.
  3. All the usage policies attached to the Usage Plans at the time of export should exist in the import file.

To learn more about export and import, refer the topic: Exporting and Importing Data.

Common Tasks

Following are the common tasks identified for this section:

  • Navigating to the API Packs screen

    To navigate to the API Packs screen:

    • In the main navigation menu, click API Packs.
    Navigation menu - API Packs

    Fig. 3.288 Navigation menu - API Packs

To export an Published API Pack:

  1. Navigate to the API Packs screen.

  2. In the API Packs screen, click the row that has the Published API Pack for which you want to have data exported. The API Pack Configuration screen displays.

    API Pack Configuration

    Fig. 3.289 API Pack Configuration

    Note

    You can find if an API Pack is Published or not from its State provided under the API Pack name.

  3. Click the Action icon control to display the API Pack Action menu.

    API Pack Action menu

    Fig. 3.290 API Pack Action menu

  4. In the API Pack Action menu, click Export to export data from Published API Packs to a Zip file named APIPack.zip.

    Note

    The Export File name will be in the format Export_APIPACK_packOne(API pack name)_REST(Type)_date(dd_mm_yyyy)-time(hh_mm_ss).

To export all Published API Packs:

  1. Navigate to the API Packs screen.

  2. In the API Packs screen, click the Action icon control. The API Pack Export/Import Action menu displays.

    API Pack  Export/Import Action menu

    Fig. 3.291 API Pack Export/Import Action menu

  3. In the menu that appears, click Export to export data from Published API Packs to a Zip file named APIPack.zip.

    Note

    The Export File name will be in the format Export_APIPACK_ALL_date(dd_mm_yyyy)-time(hh_mm_ss).

To import an Published API Pack:

  1. Navigate to the API Packs screen.

  2. In the API Packs screen, click the row that has the Published API Pack for which you want to import API Pack data. The API Pack Configuration screen displays.

    API Pack Configuration screen

    Fig. 3.292 API Pack Configuration screen

    Note

    You can find if an API Pack is Published or not from its State provided under the API Pack name.

  3. Click the Action icon control to display the API Pack Action menu.

    API Pack Action menu

    Fig. 3.293 API Pack Action menu

  4. In the API Pack Action menu, click Import to import data to display Import API Pack Details dialog box.

    Import API Pack Details dialog

    Fig. 3.294 Import API Pack Details dialog

  5. Click Choose File against File Upload field to choose a file to import information from.

  6. Browse your computer to locate and open the Zip file that contains data.json with API Pack details in JSON format. Once you have chosen the file, the file name displays alongside the Choose File button.

  7. Click Import to start importing the API Pack data. The API Pack data is overwritten with the new data.

To import all Published API Packs:

  1. Navigate to the API Packs screen.

  2. In the API Packs screen, click the Action icon control to display the API Pack Export/Import Action menu.

    API Pack Export/Import Action menu

    Fig. 3.295 API Pack Export/Import Action menu

  3. In API Pack Export/Import Action menu, click Import to display Import API Pack Details dialog box.

    Import API Pack Details dialog

    Fig. 3.296 Import API Pack Details dialog

  4. Click to select between radio buttons Full Import and Delta Import. Select Full Import to overwrite existing data in Published API Packs. Select Delta Import to retain the existing information and only update new information available in the imported file.

  5. Click Choose File against File Upload field to choose a file to import information from.

  6. Browse your computer to locate and open the Zip file that contains data.json with API Pack details in JSON format. Once you have chosen the file, the file name displays alongside the Choose File button.

    File for import

    Fig. 3.297 File for import

  7. Click Import to start importing the API Pack information

Next Steps

In the next section, you’ll learn to delete an API Pack.