I'm testing out using external services with the OFAC-API.com
I'm successfully using Search API v3 to search for a fella in Russia.
I'm having trouble parsing information out of the response, as its in a series of nested objects, and I can only access the properties on the top level object in the flow. I cannot find a way to get at data in the nested 'matches' object
Here is the structure of the response object. I have not run across the 'additionalProperties' property before - wondering if that is to blame?
"SearchResponseV3": {
"type": "object",
"properties": {
"error": {
"type": "boolean"
},
"errorMessage": {
"type": "string"
},
"sourcesUsed": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UsedSourceV3"
}
},
"matches": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SearchMatch"
}
}
}
}
},
In setup i can see the structure of the response Apex class, and it contains a property for "matches".
OFACAPI_SearchResponseV3 Apex Class
// [SERVICE] OFACAPI
// [OBJECT] OFACAPI.SearchResponseV3
global class OFACAPI_SearchResponseV3 {
// [PROPERTY] error
@AuraEnabled
global Boolean error {get; set{ this.error = value; this.error_set = true; }}
global Boolean error_set {get; set;}
// [PROPERTY] errorMessage
@AuraEnabled
global String errorMessage {get; set{ this.errorMessage = value; this.errorMessage_set = true; }}
global Boolean errorMessage_set {get; set;}
// [PROPERTY] sourcesUsed
@AuraEnabled
global List<OFACAPI_UsedSourceV3> sourcesUsed {get; set{ this.sourcesUsed = value; this.sourcesUsed_set = true; }}
global Boolean sourcesUsed_set {get; set;}
// [PROPERTY] matches
@AuraEnabled
global OFACAPI_SearchResponseV3_matches matches {get; set{ this.matches = value; this.matches_set = true; }}
global Boolean matches_set {get; set;}
}
There is also an Apex class for the matches object. But I cannot find a way to reference this in the flow as I cannot select this class when creating an apex defined variable.
OFACAPI_SearchResponseV3_matches class
// [SERVICE] OFACAPI
// [OBJECT] OFACAPI.SearchResponseV3.matches
global class OFACAPI_SearchResponseV3_matches {
// [PROPERTY] properties
@AuraEnabled
global Map<String, List<OFACAPI_SearchMatch>> properties {get; set{ this.properties = value; this.properties_set = true; }}
global Boolean properties_set {get; set;}
}
Any suggestions on what to try? Just when I felt like I was getting a handle on using external services, running into a wall again!