BinanceAPIException: APIError(code=-1002): You are not authorized to execute this request.

Hey, newbie here, please bear

when i am just trying to test borrowing function of python-binance which is

client.create_margin_loan(asset=‘DOGEUSDT’, amount=‘22’)
it throws out this exception, everything is good i have the balance and everything

BinanceAPIException: APIError(code=-1002): You are not authorized to execute this request.

How can i solve this?

Hi.
This error usually happens when the signature is not attached in the query string. You may have to check the implementation details of your code and the library.

Hi, Please make sure that you enabled Margin Loan, Repay & Transfer in your API restriction settings.