Decide whether you need a custom API
If a Banking OS unified API covers your use case, reuse it and build only a connector. You select the unified API in the connector project by settingapi.artifact-id and api.artifact-version.
For more information, see Banking OS APIs and API playground.
Create a custom API in these cases:
- No unified API covers the capability that your connector exposes.
- You need an API that only your organization uses.
Prerequisites
Before you begin, make sure you have the following:- Access to your self-service repository with the
self-serviceGitHub team. For more information, see GitHub organization and repository structure. - JDK 21, Maven 3.6 or later, and Git installed.
- Maven credentials in
~/.m2/settings.xml: a GitHub personal access token for your organization’s GitHub Packages, and a token for the Backbase Artifactory.
Request the API repository
You request the repository through your self-service repository, in the same way as for a connector. To request the API repository, follow these steps:- In
gc-devhub-{installation}-self-service, create a branch. - Add an entry to
repositoriesinself-service.tfvars, as shown in the following example. - Open a pull request to
main. - Wait for the Terraform plan comment on the pull request.
- After the
self-serviceteam approves, merge the pull request.
TEMPLATE_VERSION to a published release of grandcentral-generic-api. Release 2.0.9 is one published release. The ZIP files are in the Banking OS accelerators tree. The repository_init_from_zip setting accepts only those ZIP files.
Name the repository so it ends in -api. Backbase specifications use the grandcentral- prefix. Use your own prefix so the repository name doesn’t collide with a Backbase repository.
Understand what the template provides
The generic API template is the reference implementation (the golden sample) for recommended specification practices and build configuration. On the first commit, provisioning automatically:- Sets the
artifactIdto the repository name and the version to0.1.0-SNAPSHOT. - Updates the description, URLs, and
CODEOWNERS. - Regenerates the
README.mdandCHANGELOG.mdfiles. - Renames the specification file to
{artifactId}.yaml.
Edit the specification
Change only the content of the specification file. Don’t editpom.xml, because provisioning sets its values for you.
The template info block identifies the API. The following example shows the block with illustrative values:
version: Keep${project.version}. The build replaces the placeholder with the Maven project version, so don’t hard-code a version.x-api-domainandx-api-service: Both are required. Use lowercase values, and use hyphens if needed. These values are path segments. They don’t have to repeat the repository name.
https://api.{runtime}.{installation}.gcservices.io/{x-api-domain}/{x-api-service}/v{major}/{path}. For example, a unified API uses /customer-management/party-reference/v2/parties/{id}.
If another API already uses the same path on your APIM instance, override the path. Set the Maven property apim-helm-plugin.path at build time, or the path Helm value at deploy time.
Build and release the API
To build the API locally, run the following command:- A JAR file with the merged specification.
- The merged specification at
target/openapi/{artifactId}.yaml. - The APIM Helm chart in
target/helm. The chart registers the API in APIM.
{artifactId}-{major}, for example grandcentral-generic-api-1. You use this ID later in your product policies.
When you release the repository, CI publishes the Helm chart to your installation’s container registry. After the first release, you can enable backward-compatibility checks against the previous version: set old-api.version and remove old-api.skip.
Troubleshoot
- If the build or deployment fails, compare your repository with the generic API template first.
- If another API already uses your path, override the path as described in Edit the specification.
Next steps
- Deploy a custom API and connector: Deploy your connector and publish your API through APIM.
- Set up the project: Build the connector that implements this API. Set
api.artifact-idto your API artifact.