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 can you help me!
I have the same error :
BinanceAPIException: APIError(code=-1002): You are not authorized to execute this request.
when I launch the request: client.create_margin_order,
do you know if I need a signature? If yes do you know how to implement it ?
Thanks

Contact Binance Customer Support as this an Account related issue.

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

I think its because I dont have the permission to do margin, only spot, but I dont know how to change that.