// Module included in the following assemblies:
// as_trigger-integrations-with-api-calls.adoc

[id='configure-publish-api-provider-quickstart_{context}']
= Importing and publishing the example API provider quickstart integration

{prodname} provides an API provider quickstart integration that you can
import into your {prodname} environment. This quickstart includes
an OpenAPI document for a task management API. After importing
the quickstart integration, you can examine the flows and then publish
the integration. After you complete the procedure described below,
the *TaskAPI* integration is running and ready
to be executed.

The API provider quickstart helps you quickly learn how to configure, publish, and
test an API provider integration. But it is not a real-world example of
how useful an API provider integration can be. For a real-world
example, suppose that you already
used {prodname} to publish several simple integrations. You could define an OpenAPI
document for triggering execution of those integrations. To do this, you
would edit the flow for each OpenAPI operation to be almost the
same as the simple integrations that you already published.


.Prerequisites

* {prodname} is open in a browser.
* The {prodname} environment must include the `Todo` sample app and the sample PostgreSQL database as described in link:{LinkFuseOnlineOnOCP}#adding-sample-data_install[Adding sample data to a {prodname} environment running on OCP].

.Procedure

. Import the *TaskAPI* quickstart integration:
.. Go to
link:{syndesis-quickstart-url}/api-provider[]
and download `TaskAPI-export.zip`.
.. In {prodname}, in the left navigation panel, click *Integrations*.
.. In the upper right, click *Import*.
.. Drag the `TaskAPI-export.zip` file that you downloaded to the *Import* page. {prodname} indicates
that it has successfully imported the file.
.. In the left navigation panel, click *Integrations* to see
an entry for the *TaskAPI* integration that you just imported. Although the entry
indicates that configuration is required, this integration is ready to publish.

. In the *TaskAPI* entry, click image:images/integrating-applications/ThreeVerticalDotsKebab.png[Three Vertical Dots] and
then click *Edit* to display a list
of the operations that this API provides.

. To examine the flows for each operation:
.. Click its *Edit flow* button to display the visualization for that flow.
+
Each flow already has a database connection, one or more data mapper
steps, and a *Provided API Return Path* step that finishes the flow.

.. For the *Invoke SQL* step, click *Configure* to see the SQL statement that the
connection executes. Then click *Cancel* to return to that operation's visualization flow.

.. For a data mapper step, click *Configure* to see the mappings. Then click
*Cancel* to return to the visualization.

.. For the *Provided API Return Path* step, which is the last step in every
operation's flow, click *Configure* to
see the HTTP return codes that the operation might send to the caller.
Click *Cancel* to return to the visualization.

.. After examining one operation's flow, click the *Integrations*> *TaskAPI*> *Operation* drop down menu and then select another operation.

.. Repeat this subset of steps to examine each flow.

. After examining the flows, click *Publish*, edit the integration
name if you want to, and then click *Save and publish*.
+
{prodname} displays the summary page for this integration and shows
publication progress as it assembles, builds, deploys, and
starts the integration.

. When the *TaskAPI* integration summary page displays *Running*,
{prodname} displays the external URL for the Task API service.
It looks something like this:
+
`\https://i-task-api-proj319352.6a63.fuse-ignite.openshiftapps.com/api/`
+
This is where {prodname} makes the Task API service available. REST
API calls specify URLs that start with this base URL.
+
If you are using {prodname} on OpenShift Container
Platform, if the external URL is not on the integration’s summary page,
then an administrator has enabled Red Hat 3scale discovery. 
This means that Red Hat 3scale controls access to the integration's API
and also publishes your API provider integration. 
To test the integration,
open the 3scale dashboard to obtain the integration’s URL.
+
If you do not want Red Hat 3scale to control access to the integration’s
API, you can disable discovery. You do this in {prodname} by viewing the
integration’s summary page. On this page, click *Disable discovery*.
{prodname} republishes the integration and provides an external URL
for invoking integration execution.
+
You can enable or disable discovery for each API provider integration.
