Designing api which is connected to 3rd party services

49 views
Skip to first unread message

Davit Ohanyan

unread,
Mar 29, 2017, 9:31:29 AM3/29/17
to API Craft
I have a backend service which in case of request connects to couple of 3rd party services, maps results to internal API representation, applies some ordering/filtering logic and sends the result collection to the client.

The 3rd party services return different structures. And I can not take just intersection, as for further operations I need fields which are specific to 3rd party service. 

If I union fields, of course by adjusting them to my internal naming and so on, each element of result collection will have fields which are not set. 
Another approach I see would be to have 3rd api type field on my collection element combined with corresponding data struct. which is specific for 3rd party service.

I'd like to know, which above mentioned approaches is considered better(I prefer 1st, as my api is consistent) or is there other solution for such a problem which I am missing?

Best,
Davit 
Reply all
Reply to author
Forward
0 new messages