Getting Started with Profound API

Getting Started with Profound API

Overview

This page provides best practices and guidelines for getting started with creating and managing APIs using Profound API. Each section below summarizes a concept you will use while building APIs, and links to the detailed documentation for that topic.

Valid API Rules

A valid API must follow these rules:

  • File name - The API file name must end with .api.json (not case sensitive) – for example, customers.api.json.

  • File location - The API file must be within a Workspace, or within a directory that is included on the pathlist.

Using Low-Code Steps and Plugins to Build API Logic

  • API logic is assembled from low-code steps and plugins (see Low-Code Steps and Plugins for more information).

  • You can use the Database tab to generate a Table API. Notice the different plugins and how they are put together to build a routine.

  • There are many shipped plugins; you can build your own as well.

  • The Low-Code Designer allows for:

    • Adding new steps by clicking Add Step..., choosing the type of plugin, and answering its questions;

    • Moving steps or brackets around with drag and drop.

Documenting Your APIs

Document your APIs both for yourself and for the consumer.

  • General Information panel - Provides information such as category, tag, summary, description, and output description.

  • Input and Output Parameter panels - Provide a description and example for any parameter.

  • OpenAPI specification - This information is bundled up into an OpenAPI specification document.

API Endpoint URLs

The URL that an API is served on is built from three parts: the workspace prefix, the API prefix, and the HTTP Path you set on the route.

  • Workspace prefix - /run/ followed by the workspace directory name. APIs in a pathlist directory rather than a workspace have no workspace prefix.

  • API prefix - /wsapi by default. This is controlled by the apiPrefix configuration setting.

  • HTTP Path - The path set on the General Info tab for the route, such as /helloworld.

So an API with the HTTP Path /helloworld, saved in a workspace named papihello, is served at:

http://[HOST]:[PORT]/run/papihello/wsapi/helloworld

The same API saved in a pathlist directory instead of a workspace is served at:

http://[HOST]:[PORT]/wsapi/helloworld

You do not have to assemble this URL by hand. The Test tab shows the full Request URL for the selected route after you run it.

Real-Time API Availability

Any time an API file is saved within the API Designer, it is immediately ready to be consumed. This is because the API framework uses Hot Module Reloading.

  • If you upload an API file, the framework will start serving it immediately.

  • If you move an API file around in the directory tree, the framework will adjust accordingly.

  • If you delete an API file or an API, the framework will stop serving that API in real time.

Using RESTful API Design Concepts

Following these guidelines will help make your APIs simple to consume and expressive.

REST vs. SOAP

  • Profound API primarily emphasizes RESTful API publishing, but starting with version 6.2.0 it also includes support for building and publishing SOAP APIs (see this guide for insights into the distinctions between REST and SOAP).

  • The examples in the Getting Started section focus on REST; however, there is a section dedicated to SOAP API.

Testing Your APIs

Run manual tests over your APIs.

  • You never know what the consumer of this API might be calling the API with. It is good practice for your API to return an error reason and a way to correct the issue, instead of a generic error.

Performance Testing

Run performance tests on your APIs.

  • Running specific tests and looking for slow response rates, large payload sizes, or long handle times can reveal potential bottlenecks within your business logic.


Related Pages