Pixelogic Media interview question

How to call api from JavaScript file ?