IBM interview question

How API works and does it replace IDOC faciility?