You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
When API Key is recycled and 403s are returned, the library returns a KeyError #11
File "/usr/local/lib/python3.8/site-packages/activecampaign/contacts.py", line 16, in create_a_contact
return self.client._post("/contacts", json=data)
File "/usr/local/lib/python3.8/site-packages/activecampaign/client.py", line 37, in _post
return self._request('POST', endpoint, **kwargs)
File "/usr/local/lib/python3.8/site-packages/activecampaign/client.py", line 54, in _request
return self._parse(requests.request(method, self.BASE_URL + endpoint, headers=_headers, **kwargs))
File "/usr/local/lib/python3.8/site-packages/activecampaign/client.py", line 57, in _parse
if 'application/json' in response.headers['Content-Type']:
File "/usr/local/lib/python3.8/site-packages/requests/structures.py", line 54, in __getitem__
return self._store[key.lower()][1]
KeyError: 'content-type'
If the API returns a 403 response, the library should return an error response or throw an Exception indicating a Forbidden status.
File "/usr/local/lib/python3.8/site-packages/activecampaign/contacts.py", line 16, in create_a_contact
return self.client._post("/contacts", json=data)
File "/usr/local/lib/python3.8/site-packages/activecampaign/client.py", line 37, in _post
return self._request('POST', endpoint, **kwargs)
File "/usr/local/lib/python3.8/site-packages/activecampaign/client.py", line 54, in _request
return self._parse(requests.request(method, self.BASE_URL + endpoint, headers=_headers, **kwargs))
File "/usr/local/lib/python3.8/site-packages/activecampaign/client.py", line 57, in _parse
if 'application/json' in response.headers['Content-Type']:
File "/usr/local/lib/python3.8/site-packages/requests/structures.py", line 54, in __getitem__
return self._store[key.lower()][1]
KeyError: 'content-type'
If the API returns a 403 response, the library should return an error response or throw an Exception indicating a Forbidden status.
Activity
pkshahid commentedon Oct 6, 2023
Did you solve it?