Hi,
I’m writing a Python application for our in-company internal use.
I’m using hubspot-api-client==6.0.0 package.
I’m trying to subsribe an email address using the marketing API like this:
email = 'test@example.com'
sub_id = '12345'
subbody = PublicUpdateSubscriptionStatusRequest(email, subscription_id=sub_id, legal_basis='PROCESS_AND_STORE', legal_basis_explanation='Test explanation')
api_response = self.__client.communication_preferences.status_api.subscribe(subscription_request)
print(f"success = {api_response.status == 'SUBSCRIBED'}")
I’m getting 500 error:
hubspot.communication_preferences.exceptions.ApiException: (500)
Reason: Internal Server Error
HTTP response headers: HTTPHeaderDict({'Date': 'Mon, 05 Sep 2022 10:58:10 GMT', 'Content-Type': 'application/json;charset=utf-8', 'Content-Length': '100', 'Connection': 'keep-alive', 'CF-Ray': '745e72bfcb50731a-LHR', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains; preload', 'Vary': 'Accept-Encoding', 'CF-Cache-Status': 'DYNAMIC', 'Access-Control-Allow-Credentials': 'false', 'X-HubSpot-Correlation-Id': '38e195ac-db40-45a7-b36d-70ad918e9ca4', 'X-HubSpot-RateLimit-Interval-Milliseconds': '10000', 'X-HubSpot-RateLimit-Max': '100', 'X-HubSpot-RateLimit-Remaining': '99', 'X-HubSpot-RateLimit-Secondly': '10', 'X-HubSpot-RateLimit-Secondly-Remaining': '9', 'Report-To': '{"endpoints":[{"url":"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=nUVZ9X9WtYYqv%2BeUaERekzoa3p7ElvkYUARljV9Acl%2FSVK2NgF3iYmOPWGSPu2DpnDZrbcD%2Fl3JkkmJou%2FPkUy1eEpnSEpBboBc19avNJnEQd%2F9sdLLDGm3181Ux3ydk"}],"group":"cf-nel","max_age":604800}', 'NEL': '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}', 'Server': 'cloudflare', 'alt-svc': 'h3=":443"; ma=86400, h3-29=":443"; ma=86400'})
HTTP response body: {"status":"error","message":"internal error","correlationId":"38e195ac-db40-45a7-b36d-70ad918e9ca4"}
Any ideas?