
Hi,
I’ve created a simple Azure Machine Learning model with its web service. I exported the swagger file and created custom API connector, which worked quite well. When I consume the connector inside a flow (Http Swagger Connector) it shows me the query values but never the request body json, which makes it impossible to enter the required payload.
Thanks
////////////////////////////
Used Swagger file:
{
"swagger": "2.0",
"info": {
"version": "2.0",
"title": "Global Loss Event Impact V2 [Predictive Exp.]",
"description": "No description provided for this web service."
},
"host": "europewest.services.azureml.net:443",
"basePath": "/workspaces/30a0ff4bxxxxxxxxxxxxx80b0/services/1f31xxxxxxx02a801acxxxxxc0",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/execute": {
"post": {
"summary": "Execute the web service and get a response synchronously",
"operationId": "execute",
"parameters": [{
"name": "api-version",
"in": "query",
"description": "The API version to use",
"required": true,
"type": "string",
"default": "2.0",
"enum": [
"2.0"
]
},
{
"name": "format",
"in": "query",
"description": "The format of the input to the web service",
"required": true,
"type": "string",
"default": "swagger",
"enum": [
"swagger"
]
},
{
"name": "body",
"in": "body",
"description": "Execution request",
"required": true,
"schema": {
"$ref": "#/definitions/ExecutionRequest"
}
}
],
"responses": {
"200": {
"description": "Execution results",
"schema": {
"$ref": "#/definitions/ExecutionResults"
}
}
},
"security": [{
"api_key": []
}]
}
}
},
"definitions": {
"ExecutionRequest": {
"title": "Execution request",
"properties": {
"Inputs": {
"$ref": "#/definitions/ExecutionInputs"
},
"GlobalParameters": {
"$ref": "#/definitions/GlobalParameters"
}
}
},
"ExecutionResults": {
"title": "Execution Results",
"properties": {
"Results": {
"$ref": "#/definitions/ExecutionOutputs"
}
}
},
"GlobalParameters": {
"title": "Global parameters definition",
"type": "object"
},
"ExecutionInputs": {
"title": "Execution inputs defintion",
"properties": {
"input1": {
"items": {
"$ref": "#/definitions/input1Item"
},
"type": "array"
}
},
"type": "object"
},
"ExecutionOutputs": {
"title": "Execution outputs defintion",
"properties": {
"output1": {
"items": {
"$ref": "#/definitions/output1Item"
},
"type": "array"
}
},
"type": "object"
},
"input1Item": {
"required": [
"EVENT_ID",
"Date",
"Country",
"Location",
"Latitude",
"Longitude",
"Magnitude",
"LossImpactUSD"
],
"properties": {
"EVENT_ID": {
"type": "string"
},
"Date": {
"type": "integer",
"format": "int32"
},
"Country": {
"type": "string"
},
"Location": {
"type": "string"
},
"Latitude": {
"type": "number",
"format": "double"
},
"Longitude": {
"type": "number",
"format": "double"
},
"Magnitude": {
"type": "number",
"format": "double"
},
"LossImpactUSD": {
"type": "integer",
"format": "int32"
}
}
},
"output1Item": {
"required": [
"Country",
"Location",
"Magnitude",
"LossImpactUSD",
"Scored Labels"
],
"properties": {
"Country": {
"type": "string"
},
"Location": {
"type": "string"
},
"Magnitude": {
"type": "number",
"format": "double"
},
"LossImpactUSD": {
"type": "integer",
"format": "int32"
},
"Scored Labels": {
"type": "number",
"format": "double"
}
}
}
},
"securityDefinitions": {
"api_key": {
"type": "apiKey",
"description": "For example: Bearer abc123",
"name": "Authorization",
"in": "header"
}
}
}
Hi Mrkschrstn,
See if below blogs helps
https://flow.microsoft.com/en-us/blog/integrating-custom-api/
https://flow.microsoft.com/en-us/documentation/register-custom-api/
Leo