API Management API

The API Management API builds upon the Administration API

REST API

There are a number of different REST APIs available for API Management and Administration - they are both exposed on an internal API Gateway - in the default Ceptor configuration export on port 9443. You can find them on these links:

Admin API

Admin API for Partners

Java API

The following Java API exists - these methods are all exposed as part of the Administration API as additional methods in the dk.itp.portalprotect.admin.AdminClient class:


/**
 * Lists all API Groups
 */
public List<Config.APIGroup> listAPIGroups() throws IOException, AdminException;


/**
 * Lists all APIs in a given group
 * 
 * @param groupId ID of API Group 
 */
public List<Config.API> listAPIs(String groupId) throws IOException, AdminException;


/**
 * Lists all API versions contained in a single API
 * 
 * @param apiId ID of API to list versions for
 */
public List<Config.APIVersion> listAPIVersions(String apiId) throws IOException, AdminException;


/**
 * Creates a new API Group
 */
public Config.APIGroup createAPIGroup(Config.APIGroup group) throws IOException, AdminException;


/**
 * Update an existing API Group
 */
public void updateAPIGroup(Config.APIGroup group) throws IOException, AdminException;

/**
 * Removes an existing API Group
 * 
 * @param id ID of API Group to remove
 */
public void removeAPIGroup(String id) throws IOException, AdminException;

/**
 * Creates a new API
 * 
 * @param groupId Group to create the API within
 * @param api API information
 */
public Config.API createAPI(String groupId, Config.API api) throws IOException, AdminException;


/**
 * Updates an API
 * 
 * @param api API to update
 */
public void updateAPI(Config.API api) throws IOException, AdminException;


/**
 * Read a specific API Group from its ID
 * 
 * @param groupId API Group ID
 */
public Config.APIGroup getAPIGroup(String groupId) throws IOException, AdminException;


/**
 * Reads a specific API from its ID
 * @param apiId ID of API
 */
public Config.API getAPI(String apiId) throws IOException, AdminException;


/**
 * Reads a specific API Version from its ID
 * 
 * @param id ID of API Version
 */
public Config.APIVersion getAPIVersion(String id) throws IOException, AdminException;


/**
 * Removes an API
 * 
 * @param apiId ID of API to remove
 */
public void removeAPI(String apiId) throws IOException, AdminException;


/**
 * Creates a new API Version
 *
 * @param apiId ID of API to create the version within
 * @param av API Version details
 */
public APIVersion createAPIVersion(String apiId, APIVersion av) throws IOException, AdminException;

/**
 * Updates an API Version
 * 
 * @param av API Version details
 */
public void updateAPIVersion(APIVersion av) throws IOException, AdminException;


/**
 * Removes an API Version
 * 
 * @param id API Version ID
 */
public void removeAPIVersion(String id) throws IOException, AdminException;

/**
 * List all configured API Partners
 * 
 */
public List<Config.APIPartner> listAPIPartners() throws IOException, AdminException;

/**
 * List all configured API Partners for a specific developer
 * 
 */
public List<Config.APIPartner> listAPIPartners(String developerId) throws IOException, AdminException;

/**
 * Creates a new API Partner
 * 
 * @param partner API Partner details
 */
public Config.APIPartner createAPIPartner(Config.APIPartner partner) throws IOException, AdminException;


/**
 * Updates an API Partner
 * 
 * @param partner API Partner details
 */
public Config.APIPartner updateAPIPartner(Config.APIPartner partner) throws IOException, AdminException;


/**
 * Remove an API Partner
 * 
 * @param id ID of API Partner to remove
 */
public void removeAPIPartner(String id) throws IOException, AdminException;


/**
 * Gets a specific API Partner Application
 * @param applicationId API Partner Application ID
 */
public Config.APIPartnerApplication getAPIPartnerApplication( String applicationId ) throws IOException, AdminException;



/**
 * Gets an AI Partner
 * 
 * @param partnerId ID of Partner
 */
public Config.APIPartner getAPIPartner( String partnerId ) throws IOException, AdminException;

/**
 * Creates a new API Partner Application
 * 
 * @param partnerApplication API Partner Application Details
 */
public Config.APIPartnerApplication createAPIPartnerApplication(Config.APIPartnerApplication partnerApplication) throws IOException, AdminException;

/**
 * Updates an API Partner Application
 * 
 * @param application API Partner Application Details
 */
public Config.APIPartnerApplication updateAPIPartnerApplication(Config.APIPartnerApplication application) throws IOException, AdminException;

/**
 * Removes an API Partner Application
 * @param id ID of API Partner Application
 */
public void removeAPIPartnerApplication(String id) throws IOException, AdminException;

/**
 * Lookup API Developer from email address
 * 
 * @param email Email address of API Developer
 */
public Config.APIDeveloper getAPIDeveloperFromEmail( String email ) throws IOException, AdminException;


/**
 * Lookup API Developer from userid
 * Note: In this release, the id and email are the same
 * @param id user ID of API Developer
 */
public Config.APIDeveloper getAPIDeveloper( String id ) throws IOException, AdminException;


/**
 * Export API Management data as a complete zip file
 */
public byte[] exportAPIManagementDataToZip() throws IOException, AdminException;

/**
 * Export selected API Management data as a zip file
 */
public byte[] exportAPIManagementDataToZip(Config.APIExportParameters params) throws IOException, AdminException;


/**
 * Import API Management data from a zip file
 * 
 * @param zipped Zip file contents
 */
public void importAPIManagementDataFromZip(byte[] zipped) throws IOException, AdminException;


/**
 * Searches API's based on parameters
 */
public APISearchResult searchAPIs(APISearchParameters parms) throws IOException, AdminException;


/**
 * Searches API Developers based on parameters
 */
public APIDeveloperSearchResult searchAPIDevelopers(APIDeveloperSearchParameters parms) throws IOException, AdminException;


/**
 * Deletes a developer from the API management (and the backend user database)
 */
public void deleteAPIDeveloper( String uid ) throws IOException, AdminException;


You can find full details about the data structure here: Data Structures - the Java API operations on these simplified objects (here shown with methods removed for readability)

package io.ceptor.apimanager;

/**
 * API Management Configuration - contains data / configuration classes for APIs and related data objects.
 */
public class Config {
	public static enum APIType {
		openapi, soap, plainhttp
	}

	public static class APIGroup extends Parent {
		public String id;
		public String name;
		public String picture;
		public String description;
		public JSONArray tags;

		public List<String> apiIDs;
	}

	public static class API extends Parent {
		public String id;
		public String groupId;
		public String name;
		public String picture;
		public String description;
		public boolean isSubscriptionRequired;
		public List<String> subscriptionPlanIDs;
		public JSONArray tags;

		public List<String> versionids;
	}

	public static class APIVersion extends Parent {
		public String id;
		public String apiid;
		public String name; // Version
		public String description;
		public String basePath;
		public APIType apitype;
		public boolean isDeployed;
		public boolean cors;
		public String documentation;

		public JSONObject openAPISpec;
		public JSONObject implementation;
		public JSONObject security;
		public JSONArray tags;

		/* If private, it can still be deployed and called, but will not be visible in the developer portal */
		public boolean isPrivate;
	}

	public static class APIPartnerApplication extends APIDeveloperParent {
		public String id;
		public String partner_id;
		public String name;
		public String description;
		/** Map of API id and subscription plan id */
		public Map<String,String> subscriptions;
		/** Allowed redirect URIs */
		public List<String> allowedUris;
		/** Allowed logout URIs */
		public List<String> allowedLogoutUris;
		/** List of API keys for this application */
		public List<String> apikeys;
		public String client_id;
		public String client_secret;
	}

	public static class APIPartner extends APIDeveloperParent {
		public String id;
		public String name;
		public String description;
		public String contact;
		public List<String> applicationids;
		public List<String> roles;
	}

	public static enum APIPartnerRole {
		OWNER,
		READ_ONLY,
		NONE;
	}

	public static enum APIApplicationRole {
		OWNER,
		DEVELOPER,
		READ_ONLY;
	}

	public static class APIDeveloper extends Parent {
		public String id;
		public String credentials;
		public String email;
		public Map<String,String> partners;
		public Map<String,String> applications;
	}


	public abstract static class APIDeveloperParent extends Parent {
		/** Map of UUID and role */
		public Map<String,String> developers;
	}
	
	/**
	 * 
	 * Represents a list of API versions / APIs deployed in a particular environment 
	 * 
	 */
	public static class APIVersionsInEnvironment extends Parent {
		public String environmentName;
		public LinkedHashMap<String, APIGroup> groups;
		public LinkedHashMap<String, API> apis;
		public LinkedHashMap<String, APIVersion> versions;
	}
	
	public static class APISearchParameters extends Parent {
		public String partnerid;
		public String searchString; 
		public boolean deployed;
		public APISearchSubscription subscription;
		public APIType type;
		/** Deployed/published in this environment */
		public String environmentName;
		/** Base path pattern */
		public String basePathPattern;
		
		public enum APISearchSubscription {
			IGNORE,
			REQUIRES,
			DOES_NOT_REQUIRE
		}
	}
	
	public static class APISearchResult extends Parent {
		public LinkedHashMap<String, APIGroup> groups;
		public LinkedHashMap<String, API> apis;
		public LinkedHashMap<String, APIVersion> versions;
	}

	public static class APIDeveloperSearchParameters extends Parent {
		public String searchString; 
	}
	
	public static class APIDeveloperSearchResult extends Parent {
		public LinkedHashMap<String, APIDeveloper> developers;
		public boolean moreResults;
	}


	public static class APIExportParameters extends Parent {
		public List<String> groupIds;
		public List<String> apiIds;
		public List<String> apiVersionIds;
		public boolean exportConfiguration;
		public boolean exportPartners;
	}
}


© Ceptor ApS. All Rights Reserved.