Pixelogic Media Interview Question

How to call api from JavaScript file ?