// This module is included in the following assemblies:
// as_connecting-to-http.adoc

[id='adding-http-connections_{context}']
= Adding an HTTP or HTTPS connection to an integration

You can add an HTTP or HTTPS connection to 
any number of integrations.

.Prerequisite
* You created an HTTP or HTTPS connection. 
* You are creating or editing a flow and {prodname} is prompting you
to add to the integration. Or, {prodname} is prompting you to choose a 
start connection, or to choose a finish connection. 

.Procedure
. On the *Add to Integration* page, click the plus sign where you 
want to add the connection. Skip this step if {prodname} is
prompting you to choose the finish connection. 
. Click the HTTP or HTTPS connection that you want to add to the
flow. 
. Select the action that you want the connection to perform:
+ 
* If you are adding a start connection, then *Periodic invoke URL*
is the only available action. This action invokes the endpoint at intervals
that you specify and triggers the integration if the endpoint returns
any data. 

* If you are adding a middle or finish connection, then *Invoke URL* 
is the only available action. This action invokes the endpoint once. 

. In the *URL Path* field, specify the location of the endpoint that you 
want to invoke. 

. In the *HTTP Method* field, select the method that you want the 
connection to perform. The default method is `GET`. 
+
* `GET` obtains the content at the URL path. 
* `PUT` replaces the content at the URL path with the integration data. 
* `POST` stores the integration data at the URL path to create new 
content.
* `DELETE` removes content at the URL path.
* `HEAD` obtains metadata about the content at the URL path. 
* `OPTIONS` obtains communication option settings at the URL path.
* `TRACE` obtains information for testing and diagnostic purposes. 
* `PATCH` partially updates the content at the URL path according to
the integration data. 

. If you are adding a start connection, which periodically invokes the 
URL, then in the  *Period* field, accept the default interval of *1* second 
or specify a number and its unit (milliseconds, seconds, minutes, or hours)
to indicate how long to wait between invocations. 

. Click *Next* to specify the action's input or output type. 

. In the *Select Type* field, if the data type does not need to be known, 
accept *Type specification not required* 
and click *Next*. You do not need to follow the rest of these
instructions. 
+
However, a structured data type is recommended. For example, if you want 
to map the connection input/output in a data mapper step then you must specify 
the data type. The data mapper cannot display fields for unstructured data.
+
To specify the data type, click in the *Select Type* field and select one of the following as the schema type:
+
* *JSON schema* is a document that describes the structure of JSON data.
The document's media type is `application/schema+json`. 
* *JSON instance* is a document that contains JSON data. The document's 
media type is `application/json`. 
* *XML schema* is a document that describes the structure of XML data.
The document's file extension is `.xsd`.
* *XML instance* is a document that contains XML data. The
document's file extension is `.xml`. 
* *CSV instance* is a document that contains comma-separated value (CSV) data. The document's file extension is `.csv`. 
ifeval::["{location}" == "downstream"]
+
*Note* _Data Mapper support for CSV data is a Technology Preview feature only._
endif::[]

. In the *Definition* input box, paste a definition that conforms to the
schema type you selected. 
For example, if you select *JSON schema* then you would paste the content of
a JSON schema file, which has a media type of `application/schema+json`.

. In the *Data Type Name* field, enter a name that you choose for the
data type. For example, if you are specifying a JSON schema for
vendors then you might specify `*Vendor*` as the data type name. 
+
You will see this data type name when you are creating 
or editing an integration that uses the connection
for which you are specifying this type. {prodname} displays the type name
in the integration visualization and in the data mapper. 

. In the *Data Type Description* field, provide information that helps you
distinguish this type. This description appears in the data mapper when 
you hover over the step that processes this type. 
. Click *Next*. 

.Result
The connection appears in the integration visualization
where you added it. 
