Integration

An object representing an integration setting for a Webshop. Integrations are accessible to administrators only.

Properties

Property Description
auth The authentication token used by the webshop for the integration.
expireDate The expiration date of the integration.
settingsAuth The authentication token for an integration server.
settingsUrl A URL to where the integration settings are stored.
settings The integration settings handled by the external integration server.
type The unique identifier of the integration type to which the settings apply.
uid The unique identifier of the integration.

Methods

count

Takes a filter object and returns the number of integrations found, as an integer.

Parameters

A filter object specifying which integrations to count. See Filter objects on the page List selection.

Example

The request below returns the number of integrations created in January 2015.

API Console
Integration.count(
  {
    "created": {
      "min": "2015-01-01",
      "max": "2015-02-01"
    },
  }
)
Response
2

create

Creates a new integration. The settings property will be handled by an external server that is specified by the IntegrationType.

Parameters

Parameters Description
integration patch An object containing the properties and values to set for the integration.
query A query specifying what to return after integration creation has been successful (optional). See Query language.

Example

API Console
Integration.create(
    {
     "auth": "XYV0aDpRS4F7bdFom444RO9ygHObnnb/zIOds3iuXFhtoDGbWiUt",
     "type": 2,
     "settings": {"user": "Test1", "password": "abcdef"}
    },
    ["uid", "settings"]
)
Response
{
  "uid": 1234,
  "settings": {
    "user": "Bob",
    "password": "abcdef"
  }
}

get

Fetches information about the integration.

Parameters

Parameters Description
uid The unique identifier of an integration.
query Which info to return. See Query language.

Example

API Console
Integration.get(1234 ["expireDate", "type"])
Response
{
  "expireDate": "2015-05-01",
  "type": 2
}

getSchema

Fetches the JSON Schema which can be used for client-side validation.

Parameters

The unique identifier of an existing integration.

getSettingsForm

Fetch the form definition to be used with this integration. Or if uid is null then an optional integration type can be specified.

Parameters

Parameters Description
uid The unique identifier of an integration.
type The type of the integration to used in case uid is null. (Optional)

list

Fetches multiple integrations as an array of integration objects.

Parameters

Parameter Description
query Which info to return. See Query language.
selection Which integrations to list. See List selection.

Example

The request below returns the settings URL, type and unique identifier of all the integrations created since 1 January 2015, sorted by type.

API Console
Integration.list({"settings": true, "type": true, "uid" :true}, {"filters":{"/created":{"min":"2015-01-01"}}, "sort": "type"})
Response
[
  {
    "settings": {"user": "Test1", "password": "abcdef"},
    "type": "2",
    "uid": 1234
  },
  {
    "settings": {"user": "Test2", "password": "fedcba"},
    "type": "2",
    "uid": 1237
  },
  {
    "settings": {"host": "integration.example.com", "port": 6743},
    "type": "4",
    "uid": 1226
  }
]