I have two web apis: A HTTP GET operation to return a array of objects with Type A. A HTTP POST operation to create object. Type A in used in both request body and response body of this creation operation.
It's working well when I set Items of a DataTable control to result of http get call.
I need write some function code for OnSelect property of a button control to do things like: call web api -> check A.id in response field -> make further action. I tried to create a variable using Set() but the variable is boolean type, not A. How can I do above scenario?
anyone know about this?
Below is the Swagger doc of my Web API. I want to call the "post" method and get the "id" field of response to create further action in Powerapps
{
"swagger": "2.0",
"info": {
"version": "v1",
"title": "EXMTestPortal"
},
"host": "exmyuqing.azurewebsites.net",
"schemes": [
"https"
],
"paths": {
"/api/Exceptions": {
"get": {
"tags": [
"Exceptions"
],
"operationId": "Exceptions_GetAll",
"consumes": [],
"produces": [
"application/json",
"text/json",
"application/xml",
"text/xml"
],
"parameters": [
{
"name": "keyword",
"in": "query",
"required": false,
"type": "string"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Exception"
}
}
}
}
},
"post": {
"tags": [
"Exceptions"
],
"operationId": "Exceptions_Post",
"consumes": [
"application/json",
"text/json",
"application/xml",
"text/xml",
"application/x-www-form-urlencoded"
],
"produces": [
"application/json",
"text/json",
"application/xml",
"text/xml"
],
"parameters": [
{
"name": "value",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/Exception"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/Exception"
}
}
}
}
},
"/api/Exceptions/{id}": {
"get": {
"tags": [
"Exceptions"
],
"operationId": "Exceptions_Get",
"consumes": [],
"produces": [
"application/json",
"text/json",
"application/xml",
"text/xml"
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"type": "integer",
"format": "int32"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/Exception"
}
}
}
},
"post": {
"tags": [
"Exceptions"
],
"operationId": "Exceptions_Approve",
"consumes": [],
"produces": [],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"type": "integer",
"format": "int32"
},
{
"name": "approve",
"in": "query",
"required": true,
"type": "boolean"
},
{
"name": "justification",
"in": "query",
"required": true,
"type": "string"
}
],
"responses": {
"204": {
"description": "No Content"
}
}
}
}
},
"definitions": {
"Exception": {
"type": "object",
"properties": {
"id": {
"format": "int32",
"type": "integer"
},
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"status": {
"type": "string"
},
"submitTime": {
"type": "string"
},
"submittedBy": {
"type": "string"
},
"buApprover": {
"type": "string"
}
}
}
},
"securityDefinitions": {
"oauth2": {
"type": "oauth2",
"description": "AAD",
"flow": "accessCode",
"authorizationUrl": "https://login.windows.net/common/oauth2/authorize",
"tokenUrl": "https://login.windows.net/common/oauth2/token",
"scopes": {}
}
}
}
WarrenBelz
146,651
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional