Hi,
I'm trying to call an external API using "Web Services Data Actions" integration but receive an error in step 8 "Execute". I've tested the same request in Postman and it works fine there. My guess is that I have done something wrong in the Request Body Template since the request need nested objects.
Error message:
{
"message": "The server encountered an unexpected condition which prevented it from fulfilling the request.",
"code": "internal.server.error",
"status": 500,
"messageParams": {},
"contextId": "056cbe68-a283-4a45-9229-83086a129d7f",
"details": [
{
"errorCode": "ACTION.REMOTE_ENDPOINT"
}
],
"errors": [
{
"message": "REST call for action execute failed. Message: Request to backend service failed. Response from web service: {\"error\":{\"code\":\"NoResponse\",\"message\":\"The server did not receive a response from an upstream server. Request tracking id '08585075291872209113871941805CU32'.\"}} [056cbe68-a283-4a45-9229-83086a129d7f]",
"code": "INTERNAL_SERVER_ERROR",
"status": 502,
"messageParams": {},
"details": [],
"errors": []
}
]
}
Request:
{
"requestUrlTemplate": "https://api.foodfolk.com/compensation/",
"requestType": "POST",
"headers": {
"Ocp-Apim-Subscription-Key": "KEY IS HERE"
},
"requestTemplate": "{\n \"CompensationAmount\": {\n \"Type\": \"decimal\",\n \"CompensationAmountValue\": ${input.CompensationAmount}\n },\n \"Force\": {\n \"Type\": \"boolean\",\n \"ForceValue\": ${input.Force}\n },\n \"PhoneNumber\": {\n \"Type\": \"string\",\n \"PhoneNumberValue\": \"${input.PhoneNumber}\"\n },\n \"DateTime\": {\n \"Type\": \"string\",\n \"DateTimeValue\": \"${input.DateTime}\"\n },\n \"StoreId\": {\n \"Type\": \"string\",\n \"StoreIdvalue\": \"${input.StoreId}\"\n }\n}"
}
Input Contract
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "InputSchema",
"type": "object",
"properties": {
"CompensationAmount": {
"type": "integer"
},
"Force": {
"type": "boolean"
},
"PhoneNumber": {
"type": "string"
},
"DateTime": {
"type": "string"
},
"StoreId": {
"type": "string"
}
},
"additionalProperties": true
}