3.11. 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:
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:
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:
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.
All the store categories that were assigned to the Pack at the time of export should exist in the import file.
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.
To export an Published API Pack:
Navigate to the API Packs screen.
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.
Note
You can find if an API Pack is Published or not from its State provided under the API Pack name.
Click the Action icon to display the API Pack Action menu.
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:
Navigate to the API Packs screen.
In the API Packs screen, click the Action icon . The API Pack Export/Import Action menu displays.
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:
Navigate to the API Packs screen.
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.
Note
You can find if an API Pack is Published or not from its State provided under the API Pack name.
Click the Action icon to display the API Pack Action menu.
In the API Pack Action menu, click Import to import data to display Import API Pack Details dialog box.
Click Choose File against File Upload field to choose a file to import information from.
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.
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:
Navigate to the API Packs screen.
In the API Packs screen, click the Action icon to display the API Pack Export/Import Action menu.
In API Pack Export/Import Action menu, click Import to display Import API Pack Details dialog box.
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.
Click Choose File against File Upload field to choose a file to import information from.
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.
Click Import to start importing the API Pack information
Next Steps
In the next section, you’ll learn to delete an API Pack.