curl --request POST \
--url https://platform.versori.com/api/connect/v1/o/{organisation_id}/connectors/{connector_id}/versions/{version}/actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "http",
"name": "<string>",
"method": "GET",
"path": "<string>",
"parameters": [
{
"name": "<string>",
"in": "cookie",
"required": true,
"type": "string",
"default": "<unknown>",
"completion": {}
}
],
"responses": [
{
"definitions": [
{
"definition": {
"id": "<string>"
}
}
],
"status": 123
}
],
"summary": "<string>",
"description": "<string>",
"requestBody": {
"required": true,
"definitions": [
{
"definition": {
"id": "<string>"
}
}
]
}
}
'{
"id": "<string>",
"type": "http",
"name": "<string>",
"method": "GET",
"path": "<string>",
"parameters": [
{
"name": "<string>",
"in": "cookie",
"required": true,
"type": "string",
"default": "<unknown>",
"completion": {}
}
],
"responses": [
{
"id": "<string>",
"definitions": [
{
"id": "<string>",
"definition": {
"id": "<string>",
"name": "<string>",
"accept": [
"<string>"
],
"url": "<string>",
"description": "<string>",
"referencedBy": [
{
"type": "definition",
"id": "<string>",
"name": "<string>"
}
]
}
}
],
"status": 123
}
],
"errors": [
{
"field": "<string>",
"message": "<string>",
"severity": "error"
}
],
"summary": "<string>",
"description": "<string>",
"requestBody": {
"required": true,
"definitions": [
{
"id": "<string>",
"definition": {
"id": "<string>",
"name": "<string>",
"accept": [
"<string>"
],
"url": "<string>",
"description": "<string>",
"referencedBy": [
{
"type": "definition",
"id": "<string>",
"name": "<string>"
}
]
}
}
]
}
}CreateAction creates a new Action for the specified ConnectorVersion. The Action type must be compatible with the protocol of the Connector, otherwise a 400 Bad Request response will be returned.
curl --request POST \
--url https://platform.versori.com/api/connect/v1/o/{organisation_id}/connectors/{connector_id}/versions/{version}/actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "http",
"name": "<string>",
"method": "GET",
"path": "<string>",
"parameters": [
{
"name": "<string>",
"in": "cookie",
"required": true,
"type": "string",
"default": "<unknown>",
"completion": {}
}
],
"responses": [
{
"definitions": [
{
"definition": {
"id": "<string>"
}
}
],
"status": 123
}
],
"summary": "<string>",
"description": "<string>",
"requestBody": {
"required": true,
"definitions": [
{
"definition": {
"id": "<string>"
}
}
]
}
}
'{
"id": "<string>",
"type": "http",
"name": "<string>",
"method": "GET",
"path": "<string>",
"parameters": [
{
"name": "<string>",
"in": "cookie",
"required": true,
"type": "string",
"default": "<unknown>",
"completion": {}
}
],
"responses": [
{
"id": "<string>",
"definitions": [
{
"id": "<string>",
"definition": {
"id": "<string>",
"name": "<string>",
"accept": [
"<string>"
],
"url": "<string>",
"description": "<string>",
"referencedBy": [
{
"type": "definition",
"id": "<string>",
"name": "<string>"
}
]
}
}
],
"status": 123
}
],
"errors": [
{
"field": "<string>",
"message": "<string>",
"severity": "error"
}
],
"summary": "<string>",
"description": "<string>",
"requestBody": {
"required": true,
"definitions": [
{
"id": "<string>",
"definition": {
"id": "<string>",
"name": "<string>",
"accept": [
"<string>"
],
"url": "<string>",
"description": "<string>",
"referencedBy": [
{
"type": "definition",
"id": "<string>",
"name": "<string>"
}
]
}
}
]
}
}Bearer token authentication used by the Versori Platform. External consumers must provide an API key, however internal consumers must provide a JWT id_token issued by our IdP.
ID is the unique identifier of the Connector.
Version is the version name of the Connector to retrieve. The reserved names "latest" and "default" may be used to retrieve the latest version or the default version respectively.
ActionCreate defines a new Action to be created.
http "http"Name is a unique identifier for the Action within the scope of the Connector. It is expected to both human and machine-readable, i.e. "GetProduct" or "get_products", see the validation regex for more details.
HTTPMethod defines the HTTP method which will be used when invoking the Action. This is typically one of the standard HTTP methods such as GET, POST, PUT, PATCH or DELETE, but may be any valid HTTP method.
GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS, CONNECT, TRACE ActionPath is appended to the Connector's base URL to build the full URL to send requests to. It may also contain placeholders to inject dynamic values from the following sources:
{{ param.<name> }} - Injects the value of the parameter with the given name.{{ conn.<name> }} - Injects the value of the connection variable with the given name.Show child attributes
Name is the name of the parameter which will be sent to the HTTP endpoint.
cookie, header, path, query Required denotes whether this parameter is required.
Type is the type of the parameter. Currently only scalar types are supported, if you require complex types then get in touch with support to discuss options.
string, number, integer, boolean Default is the default value to use for the parameter if no value is provided by the user. If this is not defined then the parameter will not be sent to the HTTP endpoint if no value is explicitly provided by the user.
If this value is a string, it may be templated using a Go-formatted template
string, i.e. {{ .conn.foo }} where foo is an connection variable defined in the
Connector's Connection.
ActionCompletion defines how an Action may be completed by Switchboard to aid the user in selecting a valid value. Schema TBD.
Responses defines the expected responses from the HTTP endpoint. This is used to determine whether the Action was successful or not. At least one response must be defined in order for the Action to be valid.
Show child attributes
An Action may support one Definition per media-type, i.e. application/json or application/xml etc. Attempts to link multiple Definitions with the same media-type will result in an error.
Show child attributes
Status is the HTTP status code which is expected from the HTTP endpoint. If this is not defined then this response is treated as the default response, i.e. if no other response matches then this response will be used. An action may only have one default response and each response must have a unique status code.
Summary is a human-readable version of the id field, i.e. "Get Product" or "Get Products". This is used
when displaying the Action to users, however if omitted the actionId can be used to display to users
instead.
Description is a human-readable description of the Action. It can provide extra information to users about how the Action operates and anything the user may need to be aware of when using it.
ActionHTTPRequestBody defines whether a request body is required for a particular HTTP Action, and if so which Definitions are considered valid. If this value is undefined then no request body will be sent.
Show child attributes
Required denotes whether a request body is required for this Action.
An Action may support one Definition per media-type, i.e. application/json or application/xml etc. Attempts to link multiple Definitions with the same media-type will result in an error.
Show child attributes
Created
ActionHTTP defines an HTTP Action. ActionBase defines all the common fields for an Action.
ActionCommon defines all the common fields for an Action. ActionHTTPCommon defines the common fields for all HTTP Actions.
ID is the unique identifier of the Action.
http "http"Name is a unique identifier for the Action within the scope of the Connector. It is expected to both human and machine-readable, i.e. "GetProduct" or "get_products", see the validation regex for more details.
HTTPMethod defines the HTTP method which will be used when invoking the Action. This is typically one of the standard HTTP methods such as GET, POST, PUT, PATCH or DELETE, but may be any valid HTTP method.
GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS, CONNECT, TRACE ActionPath is appended to the Connector's base URL to build the full URL to send requests to. It may also contain placeholders to inject dynamic values from the following sources:
{{ param.<name> }} - Injects the value of the parameter with the given name.{{ conn.<name> }} - Injects the value of the connection variable with the given name.Show child attributes
Name is the name of the parameter which will be sent to the HTTP endpoint.
cookie, header, path, query Required denotes whether this parameter is required.
Type is the type of the parameter. Currently only scalar types are supported, if you require complex types then get in touch with support to discuss options.
string, number, integer, boolean Default is the default value to use for the parameter if no value is provided by the user. If this is not defined then the parameter will not be sent to the HTTP endpoint if no value is explicitly provided by the user.
If this value is a string, it may be templated using a Go-formatted template
string, i.e. {{ .conn.foo }} where foo is an connection variable defined in the
Connector's Connection.
ActionCompletion defines how an Action may be completed by Switchboard to aid the user in selecting a valid value. Schema TBD.
Responses defines the expected responses from the HTTP endpoint. This is used to determine whether the Action was successful or not.
Show child attributes
An Action may support one Definition per media-type, i.e. application/json or application/xml etc. Attempts to link multiple Definitions with the same media-type will result in an error.
Show child attributes
ID is a unique identifier for the request body within the scope of the Action.
Definition describes a single definition of a type which is used by the Connector. The schema language used is dependent on the media-type of the Definition, for example JSON Schema is used for media-types application/json.
DefinitionCommon is the common properties which are shared between Definitions for all of creation, retrieval and updates.
Show child attributes
ID is the unique identifier of the Definition.
Name is a unique identifier for the Definition within the scope of the Connector. It is expected to both human and machine-readable, i.e. "Product" or "product_variant".
Accept indicates which content types, expressed as MIME types, that this definition can accept. This value is analogous to the Accept HTTP header, as defined in RFC 7231, section 5.3.2, except each type is defined in a separate array element, rather than as a comma-separated list.
This does not represent the content type of the schema body itself, but the data which conforms to this
definition. For example, an API may respond in JSON or YAML, but the schema may be a YAML-formatted JSON
Schema. In this case, the Definition's accept field could be ["application/json", "text/yaml"] and
schema.contentType will be application/schema+yaml.
URL is the location of the actual Schema definition for this Definition entity.
The structure of this URL will be consistent across all media types for each connection, for example:
https://platform.versori.com/api/schemas/v1/o/{organisation_id}/{connector_id}/{connector_version}/{definition_slug}.{media_type_ext}Description is a human-friendly description of the Definition. This is typically used to describe the purpose of the Definition and how it should be used.
ReferencedBy is a list of DefinitionReference objects which defines what other entities are referencing the this Definition.
Show child attributes
definition, action, trigger ID is the unique identifier of the Definition/Action/Trigger.
Name is unique identifier for the Definition/Action/Trigger within the scope of the Connector. It is expected to both human and machine-readable, i.e. "ProductFeature" or "stock_item".
Status is the HTTP status code which is expected from the HTTP endpoint. If this is not defined then this response is treated as the default response, i.e. if no other response matches then this response will be used. An action may only have one default response and each response must have a unique status code.
Errors is a list of ErrorField objects which defines the errors which may be returned by the Action. An empty array denotes that the Action has been validated and no errors were found. If this field is undefined then this means validation has not occurred.
Show child attributes
Field is the field which failed validation. This is typically a JSON Pointer, i.e. "/parameters/0/properties/id", however this is open for discussion (we should be consistent with the ErrorField type).
Message is a human-readable description of the error. This is typically a human-readable string, i.e. "The parameter 'id' is invalid".
Severity is the severity of the error. This is used to determine how the error should be displayed to the user, i.e. a warning may be displayed in a modal dialog, whereas an error may be displayed inline.
error, warning Summary is a human-readable version of the id field, i.e. "Get Product" or "Get Products". This is used
when displaying the Action to users, however if omitted the actionId can be used to display to users
instead.
Description is a human-readable description of the Action. It can provide extra information to users about how the Action operates and anything the user may need to be aware of when using it.
ActionHTTPRequestBody defines whether a request body is required for a particular HTTP Action, and if so which Definitions are considered valid. If this value is undefined then no request body will be sent.
Show child attributes
Required denotes whether a request body is required for this Action.
An Action may support one Definition per media-type, i.e. application/json or application/xml etc. Attempts to link multiple Definitions with the same media-type will result in an error.
Show child attributes
ID is a unique identifier for the request body within the scope of the Action.
Definition describes a single definition of a type which is used by the Connector. The schema language used is dependent on the media-type of the Definition, for example JSON Schema is used for media-types application/json.
DefinitionCommon is the common properties which are shared between Definitions for all of creation, retrieval and updates.
Show child attributes
ID is the unique identifier of the Definition.
Name is a unique identifier for the Definition within the scope of the Connector. It is expected to both human and machine-readable, i.e. "Product" or "product_variant".
Accept indicates which content types, expressed as MIME types, that this definition can accept. This value is analogous to the Accept HTTP header, as defined in RFC 7231, section 5.3.2, except each type is defined in a separate array element, rather than as a comma-separated list.
This does not represent the content type of the schema body itself, but the data which conforms to this
definition. For example, an API may respond in JSON or YAML, but the schema may be a YAML-formatted JSON
Schema. In this case, the Definition's accept field could be ["application/json", "text/yaml"] and
schema.contentType will be application/schema+yaml.
URL is the location of the actual Schema definition for this Definition entity.
The structure of this URL will be consistent across all media types for each connection, for example:
https://platform.versori.com/api/schemas/v1/o/{organisation_id}/{connector_id}/{connector_version}/{definition_slug}.{media_type_ext}Description is a human-friendly description of the Definition. This is typically used to describe the purpose of the Definition and how it should be used.
ReferencedBy is a list of DefinitionReference objects which defines what other entities are referencing the this Definition.
Show child attributes
definition, action, trigger ID is the unique identifier of the Definition/Action/Trigger.
Name is unique identifier for the Definition/Action/Trigger within the scope of the Connector. It is expected to both human and machine-readable, i.e. "ProductFeature" or "stock_item".