Skip to content

Latest commit

 

History

History
90 lines (78 loc) · 5.72 KB

test-connection.md

File metadata and controls

90 lines (78 loc) · 5.72 KB

Test Connection

Description

Checks if it is possible to establish connection. Xplenty provides the following types of connections:

Input Parameters for above connections

The connection ID and connection type. Possible values of the type are listed above (on the connection types' pages).

Request (Curl Call) Syntax

$ curl -X POST -u api_key: "https://api.xplenty.com/:account_id/api/connections/:connection_type/:connection_id/test" \
  -H "Accept: application/vnd.xplenty+json; version=2"

Response Example

HTTP/1.1 200 OK
  true

Input Parameters for CURL

There is special case when connection ID is not required: when type is curl. In this case, connection_id and connection_type parameters can be provided to request specific connection.

Name Required? Default Description
url Y url for test
method N "GET" method used for curl GET or POST
response_type N "json" possible values raw, json, array, line_delimited_json, line_delimited_data
lines N 20
username N
password N
connection_type N Valid connection type
connection_id N
headers N headers syntax: {"header_name1": "header_value1", "header_name2": "header_value2"}
body N

Request (Curl Call) Syntax

$ curl -X POST -u api_key: "https://api.xplenty.com/:account_id/api/connections/curl/test" \
  -H "Accept: application/vnd.xplenty+json; version=2"

Response Example

HTTP/1.1 400 Bad Request
{
  "error_message": "Could not make CURL request, please verify connection settings and security/firewall options"
}