Computer Programming Principles/The Problem/Trial And Error

Suppose you have a function foo that takes the arguments a and b. However, there is an API bar available but the documentation is very vague. What needs to be passed to bar? Should b or a come first? Trying repeatedly, you find out that bar is almost completely undocumented. Worse, the code is closed. What are you going to do?