Closed mahimaaapatel closed 3 years ago
I am getting a Bad Request Error when trying to post a segment using the API. The get function is working but post is not.
data = { "name" : "hello", "parent_list_id" : "3146ca27-25da-4fe9-8210-162a5e6872d3", "query_dsl": "email LIKE 'gmail.com'" } headers = {'Accept': 'application/json'} try: response = sg.client.marketing.segments.post(request_headers=headers, request_data=data) print(response.status_code) print(response.body) print(response.headers) except Exception as e: print (e.to_dict)
{'errors': [{'field': 'json.decode failed', 'message': 'error: EOF, body: Not Logging for PII Compliance!'}]}
Change request_data to request_body?
request_data
request_body
Closing due to inactivity. Please reopen if your issue still needs to be addressed.
Issue Summary
I am getting a Bad Request Error when trying to post a segment using the API. The get function is working but post is not.
Code Snippet
Exception/Log
Technical details: