Hi, I have been coding my app on desktop which works fine, uploaded to PA and unable to connect to API. In this instance i'm connecting to Get REsponse. This is the error. ProxyError at /postcode-signup HTTPSConnectionPool(host='api.getresponse.com', port=443): Max retries exceeded with url: /v3/contacts (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden')))
Has anyone come across this, and any subsequent fixes.
This code to post lead:
def post_lead(self):
url = "https://api.getresponse.com/v3/contacts"
payload = '{ "name": "'+ self.first_name +'","email": "'+ self.email +'","campaign": { "campaignId": "XXX" },"ipAddress": "X","customFieldValues": [ { "customFieldId": "XXXX", "value": [ "'+ str(self.id) +'" ] } ] }'
headers = {
'X-Auth-Token': "api-key XXXXXXXXXXXXXXXXXXXXX",
'Content-Type': "application/json",
'cache-control': "no-cache",
}
And code to create account:
def create_account(request):
if request.method == "POST":
if Account.objects.filter(email=request.POST['email']).exists():
return HttpResponse("dupe")
else:
ip = get_client_ip(request)
dob = datetime.strptime(request.POST['birth_day'] + request.POST['birth_month'] + request.POST['birth_year'], "%d%m%Y").date()
cid = ""
if "cid" in request.GET:
cid = request.GET["cid"]
account = Account.objects.create(email=request.POST['email'], first_name=request.POST['first_name'],)
return render HttpResponse("window.location.href='/lp/?id=check-email&cid=" + cid + "'")
Thanks