I am trying to transfer Algos from one account to another using api.
This is the error I am getting
Amount from function 2420000
Inside Operations---------------- <function algotransfer at 0x7f67f1ab07b8>
27.97.133.234 - - [09/Jun/2023 10:22:42] "POST /useralgopayment HTTP/1.1" 500 -
Traceback (most recent call last):
File "/home/azureuser/.local/lib/python3.6/site-packages/algosdk/v2client/algod.py", line 78, in algod_request
resp = urlopen(req)
File "/usr/lib/python3.6/urllib/request.py", line 223, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.6/urllib/request.py", line 532, in open
response = meth(req, response)
File "/usr/lib/python3.6/urllib/request.py", line 642, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python3.6/urllib/request.py", line 570, in error
return self._call_chain(*args)
File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/usr/lib/python3.6/urllib/request.py", line 650, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/azureuser/.local/lib/python3.6/site-packages/flask/app.py", line 2091, in __call__
return self.wsgi_app(environ, start_response)
File "/home/azureuser/.local/lib/python3.6/site-packages/flask/app.py", line 2076, in wsgi_app
response = self.handle_exception(e)
File "/home/azureuser/.local/lib/python3.6/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/home/azureuser/.local/lib/python3.6/site-packages/flask/app.py", line 2073, in wsgi_app
response = self.full_dispatch_request()
File "/home/azureuser/.local/lib/python3.6/site-packages/flask/app.py", line 1518, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/azureuser/.local/lib/python3.6/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/home/azureuser/.local/lib/python3.6/site-packages/flask/app.py", line 1516, in full_dispatch_request
rv = self.dispatch_request()
File "/home/azureuser/.local/lib/python3.6/site-packages/flask/app.py", line 1502, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/home/azureuser/.local/lib/python3.6/site-packages/flask_cors/decorator.py", line 128, in wrapped_function
resp = make_response(f(*args, **kwargs))
File "/home/azureuser/algorand/TraceChain/api/app.py", line 44, in useralgopayment
txn = algopayments.algo_transfer(sender,receiver,amount)
File "/home/azureuser/algorand/TraceChain/api/auction_demo/algopayments.py", line 28, in algo_transfer
amount = amount
File "/home/azureuser/algorand/TraceChain/api/auction_demo/auction/operations.py", line 28, in algotransfer
sp=client.suggested_params(),
File "/home/azureuser/.local/lib/python3.6/site-packages/algosdk/v2client/algod.py", line 337, in suggested_params
res = self.algod_request("GET", req, **kwargs)
File "/home/azureuser/.local/lib/python3.6/site-packages/algosdk/v2client/algod.py", line 85, in algod_request
raise error.AlgodHTTPError(e, code)
algosdk.error.AlgodHTTPError: Forbidden
I am using purestake token and url for the same.
There are 2 other apifor token transfer which are working being on same token and url.
Can anyone help me here.
algod_address = " "
algod_token = "xxx"
headers = {
"X-API-Key": algod_token,
}
algod_client = algod.AlgodClient(algod_token, algod_address,headers)