Custom Data Action Raw Request

We've set up a custom data action to call a third-party webservice with certain inputs. The configuration is set to:
{
"SNAPParticipantInfoReq": {
"ssn": "",
"noDcn": "",
"daBirthDate": ""
}
}

but the when we call the data action, we're showing the raw request doesn't have the "SNAPParticipantInfoReq" in it. I'm assuming it's because that is not an input. It is in the request body template but not showing up in the raw request. We're not getting any data back from the web-service when we call it and the third party agency is saying it's because the SNAPParticipantInfoReq isn't in the raw request. Is there a way to put it in the raw request when it's not an input?

Based on what you have here, I would expect that you would have ssn, noDcn, and daBirthDate be configured in your input contract, and then use the request template to build the SNAPParticipantInfoReq object, and use the inputs to set the values of ssn, noDcn, etc.

If that doesn't make sense, or you think you have already done that, please post an export of your data action so we can see exactly what you are trying to do. Also, you can click on the "Resolve request body template" step in test mode to see what you are sending to the remote endpoint. Note that this will be json encoded, so you may have to run it through a json decoder in order to make sense of it.

--Jason

Thanks Jason. Below is a copy of the data action (I tried attaching it to the post instead of copy/paste but got an error that said "Sorry, new users can not upload attachments). I did check the "resolve request body template" step and it does have the SNAPParticipantReqInfo in it.

{
"name": "MEDES-Authentication UAT - Exported 2024-02-15 @ 7:47",
"integrationType": "custom-rest-actions",
"actionType": "custom",
"config": {
"request": {
"requestUrlTemplate": "redacted",
"requestType": "POST",
"headers": {
"Authorization": "${authResponse.token_type} ${authResponse.access_token}"
},
"requestTemplate": "${input.rawRequest}"
},
"response": {
"translationMap": {},
"translationMapDefaults": {},
"successTemplate": "${rawResult}"
}
},
"contract": {
"input": {
"inputSchema": {
"type": "object",
"properties": {
"ssn": {
"type": "string"
},
"noDcn": {
"type": "string"
},
"daBirthDate": {
"type": "string"
}
},
"additionalProperties": true
}
},
"output": {
"successSchema": {
"type": "object",
"properties": {
"returnCode": {
"type": "string"
},
"returnDcn": {
"type": "string"
},
"fsCaseSection": {
"type": "string"
},
"fsEuSection": {
"type": "string"
},
"fsEuStatus": {
"type": "string"
},
"fsEuStatusDate": {
"type": "string"
},
"fsExpediteMsg": {
"type": "string"
},
"fsEumbrGrp": {
"type": "array",
"items": {
"title": "",
"type": "object",
"properties": {
"fsEumbrNames": {
"type": "string"
}
},
"additionalProperties": true
}
},
"fsElPrdBegDate": {
"type": "string"
},
"fsElndCloRejDate": {
"type": "string"
},
"fsReviewDate": {
"type": "string"
},
"fsAppSection": {
"type": "string"
},
"fsApp": {
"type": "object",
"properties": {
"fsAppReceivedDate": {
"type": "string"
},
"fsAppDueDate": {
"type": "string"
},
"fsAppType": {
"type": "string"
},
"fsPendingInterview": {
"type": "string"
}
},
"additionalProperties": true
},
"fsAppGroup": {
"type": "array",
"items": {
"title": "Item 1",
"type": "object",
"properties": {
"fsAppMbrNames": {
"type": "string"
}
},
"additionalProperties": true
}
},
"fsVerSection": {
"type": "string"
},
"fsOutV": {
"type": "array",
"items": {
"title": "Item 1",
"type": "object",
"properties": {
"fsVerSourceTxt": {
"type": "string"
},
"fsRequestDate": {
"type": "string"
},
"fsDueDate": {
"type": "string"
}
},
"additionalProperties": true
}
},
"fsPayment": {
"type": "string"
},
"fsPaymentGroup": {
"type": "array",
"items": {
"title": "Item 1",
"type": "object",
"properties": {
"fsIssuanceDate": {
"type": "string"
},
"fsNetAmount": {
"type": "number"
},
"fsBenefitDate": {
"type": "string"
}
},
"additionalProperties": true
}
},
"fsOngoingMessage": {
"type": "string"
},
"fsOngoingBenefit": {
"type": "number"
}
},
"additionalProperties": true
}
}
},
"secure": true
}

So iyou have to build up the request that you want to make in the requestTemplate. I would think that your's should look something like this in the UI:

{
    "SNAPParticipantInfoReq": {
        "ssn": "${input.ssn}",
        "noDcn": "${input.noDcn}",
        "daBirthDate": "${input.daBirthDate}"
    }
}

--Jason

This is what I had in the UI. The user can input either the ssn and daBirthDate or the noDcn and daBirthdate. When I use the above in the UI, it requires that all three inputs are filled but they wont' ever be. Only two will ever be filled at one time.

{
"SNAPParticipantInfoReq": {
"ssn": "",
"noDcn": "",
"daBirthDate": ""
}
}

Here's an updated request body template using what I updated in the UI

{
"name": "MEDES-Authentication UAT - Exported 2024-02-20 @ 7:56",
"integrationType": "custom-rest-actions",
"actionType": "custom",
"config": {
"request": {
"requestUrlTemplate": "redacted",
"requestType": "POST",
"headers": {
"Authorization": "${authResponse.token_type} ${authResponse.access_token}"
},
"requestTemplate": "{\n"SNAPParticipantInfoReq": {\n"ssn": "",\n"noDcn": "",\n"daBirthDate": ""\n}\n}"
},
"response": {
"translationMap": {},
"translationMapDefaults": {},
"successTemplate": "${rawResult}"
}
},
"contract": {
"input": {
"inputSchema": {
"type": "object",
"properties": {
"ssn": {
"type": "string"
},
"noDcn": {
"type": "string"
},
"daBirthDate": {
"type": "string"
}
},
"additionalProperties": true
}
},
"output": {
"successSchema": {
"type": "object",
"properties": {
"returnCode": {
"type": "string"
},
"returnDcn": {
"type": "string"
},
"fsCaseSection": {
"type": "string"
},
"fsEuSection": {
"type": "string"
},
"fsEuStatus": {
"type": "string"
},
"fsEuStatusDate": {
"type": "string"
},
"fsExpediteMsg": {
"type": "string"
},
"fsEumbrGrp": {
"type": "array",
"items": {
"title": "",
"type": "object",
"properties": {
"fsEumbrNames": {
"type": "string"
}
},
"additionalProperties": true
}
},
"fsElPrdBegDate": {
"type": "string"
},
"fsElndCloRejDate": {
"type": "string"
},
"fsReviewDate": {
"type": "string"
},
"fsAppSection": {
"type": "string"
},
"fsApp": {
"type": "object",
"properties": {
"fsAppReceivedDate": {
"type": "string"
},
"fsAppDueDate": {
"type": "string"
},
"fsAppType": {
"type": "string"
},
"fsPendingInterview": {
"type": "string"
}
},
"additionalProperties": true
},
"fsAppGroup": {
"type": "array",
"items": {
"title": "Item 1",
"type": "object",
"properties": {
"fsAppMbrNames": {
"type": "string"
}
},
"additionalProperties": true
}
},
"fsVerSection": {
"type": "string"
},
"fsOutV": {
"type": "array",
"items": {
"title": "Item 1",
"type": "object",
"properties": {
"fsVerSourceTxt": {
"type": "string"
},
"fsRequestDate": {
"type": "string"
},
"fsDueDate": {
"type": "string"
}
},
"additionalProperties": true
}
},
"fsPayment": {
"type": "string"
},
"fsPaymentGroup": {
"type": "array",
"items": {
"title": "Item 1",
"type": "object",
"properties": {
"fsIssuanceDate": {
"type": "string"
},
"fsNetAmount": {
"type": "number"
},
"fsBenefitDate": {
"type": "string"
}
},
"additionalProperties": true
}
},
"fsOngoingMessage": {
"type": "string"
},
"fsOngoingBenefit": {
"type": "number"
}
},
"additionalProperties": true
}
}
},
"secure": true
}

So am I understanding it correctly, that if the Request Body Template is structured like the below in the UI that the "SNAPParticipantInfoReq" field IS included in the request even though it doesn't have that field in the "rawReqeust" field when I click on the Validate request body contains simple json (key-value pairs) in the Test?

{
"SNAPParticipantInfoReq": {
"ssn": "",
"noDcn": "",
"daBirthDate": ""
}
}

Correct, we require the the inputs to the data action be simple key/value pairs, but then you can create a template of any sort of request body that you want and add input variables into it to make the object that you need.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.