Template

  • Task description
  • Services used and endpoints
  • Input/Output schema

Composition 1

Annotated task description: Create a new service that can be used to plan a barbecue with friends. To accomplish this, check the current weather at the given location, if it is warmer than the provided temperature threshold (1.1.) do the following: First, search for 3 barbecue recipes (2.1.). Then, find the nearest 2 grocery stores from the given location (3.1.). The recipes and stores arrays are empty when it is not sufficiently warm.

Input schema:

{
	"$schema": "https://json-schema.org/draft/2020-12/schema",
	"title": "Composition 1 IN",
	"type": "object",
	"properties": {
		"longitude": {
			"type": "string"		
		},
		"latitude": {
			"type": "string"
		},
		"temperature_threshold": {
			"type": "number"
		}
	},
	"required": [
		"longitude",
		"latitude",
		"temperature_threshold"
	]
}

Output schema:

{
	"$schema": "https://json-schema.org/draft/2020-12/schema",
	"title": "Composition 1 OUT",
	"type": "object",
	"properties": {
		"above_threshold": {
			"type": "boolean"
		},
		"recipes": {
			"type": "array",
			"items": {
				"type": "object",
				"properties": {
					"recipe_name": {
						"type": "string"
					}
				}
			}
		},
		"stores": {
			"type": "array",
			"items": {
				"type": "object",
				"properties": {
					"store_name": {
						"type": "string"
					}
				}
			}
		}
	}
}

Examples:

  1. Composition input:
{
	"longitude": 9.10632773357898,
	"latitude": 48.74506637921199,
	"temperature_threshold": 21.5
}
  1. Composition output:
{
	"above_threshold": true,
	"recipes": [
		{"recipe_name": "Barbecue1"},
		{"recipe_name": "Barbecue2"},
		{"recipe_name": "Barbecue3"}
	],
	"stores": [
		{"store_name": "Store1"},
		{"store_name": "Store2"}
	]
}
  1. Composition input:
{
	"longitude": 9.10632773357898,
	"latitude": 48.74506637921199,
	"temperature_threshold": 43.2
}
  1. Composition output:
{
	"above_threshold": false,
	"recipes": [],
	"stores": []
}

Exemplary services used for the composition (3 services total):

  1. OpenWeatherMap (ref) (md)
1.1. GET /weather

  PARAMETERS: 
	  lon: {{longitude}}
	  lat: {{latitude}}
	  units: metric
	  appid: X-API-KEY	
	  
  RESPONSE RELEVANT JSON-PATH:
	  main/temp -> {{temperature_threshold}}
  1. Spoonacular (ref) (md)
2.1. GET /recipes/complexSearch

  PARAMETERS: 
	  query: barbecue
  
  RESPONSE RELEVANT JSON-PATH:
	  [i]/title
	  [i]/id
  1. Google Maps Platform (ref) (md)
3.1. GET /maps/api/place/nearbysearch/json

  PARAMETERS: 
	  keyword: grocery store
	  location: {{latitude}},{{longitude}}
	  
  RESPONSE RELEVANT JSON-PATH:
	  [i]/name

Composition 2

Annotated task description: Provide a new service that can be used by families to vote on new meals to be cooked for the day. For this, find 3 new random recipes and get the name for each recipe (1.1.). Create a poll (2.1.) with the 3 recipes as poll options plus a 4th option with the text “Something else”. Send the poll to the specified Discord channel ID.

Input schema:

{
	"$schema": "https://json-schema.org/draft/2020-12/schema",
	"title": "Composition 2 IN",
	"type": "object",
	"properties": {
		"channel_id": {
			"type": "string"		
		}
	},
	"required": [
		"channel_id"
	]
}

Output schema:

{
	"$schema": "https://json-schema.org/draft/2020-12/schema",
	"title": "Composition 2 OUT",
	"type": "object",
	"properties": {}
}

Examples:

  1. Composition input:
{
	"channel_id": 603644328639827113
}
  1. Composition output:
{}

Exemplary services used for the composition (3 services total):

  1. Spoonacular (ref) (md)
1.1. GET /recipes/random

  PROVIDED PARAMETERS: 
	  number: 3
  
  RESPONSE RELEVANT JSON-PATH:
	  [i]/title
	  [i]/id
  1. Yopolls (ref) (md)
2.1. POST /api/createPoll

  PARAMETERS: 
	  question: What is today's meal?
	  options: [
		  {text: [0]/text},
		  ...,
		  {text: [2]/text},
		  {text: Something else}
	  ]
		  
  RESPONSE RELEVANT JSON-PATH:
	  data/id -> <poll_id>
  1. Discord REST API (ref) (md)
3.1. POST /channels/{{channel_id}}/messages

  HEADERS:
	  Authorization: X-API-KEY
  PARAMETERS: 
	  channel_id: {{channel_id}}
  BODY (form):
	  content: <poll_id>

Composition 3

Annotated task description: Create a composed service that will find the next Formula 1 race date, city and country location (1.1.) based on the provided user date, and then fetches hotels at the location (city) of the race (2.1.). Additionally, the composed service will search for flights that arrive x days before the race based on the number provided by the user (3.1.).

Input schema:

Output schema:

Examples:

Exemplary services used for the composition (3 services total):

  1. Formula One API (ref) (md)
1.1. GET /api/f1/current.json
  
  RESPONSE RELEVANT JSON-PATH:
	  MRData/RaceTable/Races/[i]/date
	  MRData/RaceTable/Races/[i]/Circuit/Location/locality
	  MRData/RaceTable/Races/[i]/Circuit/Location/country

http://ergast.com/api/f1/current