I seem to be having issue doing a “Match else Create” when passing in multiple IDs as part of a function. Even if I switch to just search (which is what I actually prefer to do here) no difference.
Lets assume I send in
{
“data”: [{“id”:“696843”},{“id”:“WAL1142”}]
}
and I want to match those ids against records in the system (both definitely exist).
so my request payload looks like - API Request is the base and my target object is subject to a many2many relationship.
{
“data”: [ base obj –< target obj]
}
and the matching template is
{
“id:” “matching field”
}
With obviously match selected and the “equal to” comparator selected. I don’t actually need them linked but it makes no difference either way.
Cannot work a scenario where it matches to the records and always get E203. There are no errors when saving the template OR the function.
I’m missing something pretty fundamental and maybe I just cannot do it this way. I assume multiple records on an inbound request is not an issue and that I do not have to handle them individually ?
I just want to run an event based on the match - I’m not updating the records directly. As I said a search would be fine.
The http request is a POST but again - It doesn’t seem to make any difference.
Are you doing this as a Liberty API or a generic one? May not make a difference as i’m not spotting the issue yet, but Liberty APIs are a little easier to set up, if a little more limited.
Ali,
Its has to be generic (unfortunately) as its for external / 3rd party usage.
Thanks
If it’s for a 3rd party to interact with your Liberty Create system, you can still do a liberty create API i believe. You might want to set up a dedicated endpoint for the functions, and review the firewall it uses. We’ve also setup a special user role that the endpoint uses that is limited to only being able to read data from specific objects. You should then just need to pass the auth token for the endpoint through a suitably secure method to the third party alongside the auto generated API documentation.
Late reply but just seen this.
The usual gotcha with this is that “matching” refers to the base record only. So from what I understand of your setup, you’re essentially asking Create to look for an existing API Request record which has a relationship to both of those related records. Which is unlikely to exist, or be what you actually want. And if a match was found, the event would fire on the API Request record anyway, which is also not what you want I imagine.
Because you’re wanting to use the Event on Match feature, you’d need to use that related object as your base object and do the requests one at a time, so no sub-template required.
Liberty Create adapter could do this for multiple records at once, but I don’t think you can do the same for generic unfortunately.
1 Like