Skip to main content
Version: latest

External-API Skills

General instructions for defining Skills of all types are found here. This page contains details specific to the development of external API type Skills.

Template files

When you run the cortex workspaces generate command or create a Skill in any other way template files are generated. During the Skill Building lifecycle you may modify these files.

  • README.md - a getting started helper
  • skill.yaml - a starter Skill definition for the cortex/external-api runtime
  • message.json- Contains the payload needed to invoke the Skill

The External API file structure looks like this:

/Users/smichalski/externalApi
└──┐
├─ skills
│ └─ smmexapi
│ ├─ skill.yaml
│ └─ invoke
│ └─ request
│ └─ message.json
└─ docs
└─ smmexapi
└─ README.md

Skill Definition

The Skill provides a wrapper for the action and (optionally the model) that specifies the properties, parameters, and routing required to run.

The Skill is defined in the skill.yaml. For general information about Skills go to the Define Skills page.

Example external-api skill.yaml

camel: 1.0.0
name: smmexapi
title: smmexapi Title
description: smmexapi Description

inputs:
- name: request
title: request
routing:
all:
output: response
runtime: cortex/external-api

outputs:
- name: response
title: response

properties:
- name: url
title: URL
description: http[s]://host:port
required: true
type: String
defaultValue: https://httpbin.org
- name: path
title: API path
description: API URL Path
required: true
type: String
defaultValue: post
- name: method
title: HTTP Method
description: HTTP Method
required: true
type: String
defaultValue: POST
- name: headers.content-type
title: Content-Type header
description: Response Content Type
required: true
type: String
defaultValue: 'application/json'