Api not working in mozilla add-ons

i’m creating a mozilla extension, api calling from js is not working? i’m using xmlhttprequest

Can you gather any relevant information from error messages in the Browser Console or Add-on Debugging Console?

Beside console information, any snippet of code so we can take a look? Maybe you could zip your extension and attach it to this thread. You can use https://send.firefox.com/ if the file is too big.