I am running the following:
import requests<br />import json<br />from requests.auth import HTTPBasicAuth<br /><br />url = "https://amplitude.com/api/2/deletions/users"<br /><br />payload = json.dumps({<br /> "user_ids": [<br /> "this_one_exists", "does_not_exist"<br /> ],<br /> "requester": "test@gmail.com",<br /> "ignore_invalid_ids": True,<br />})<br />headers = {<br /> 'Content-Type': 'application/json',<br /> 'Accept': 'application/json'<br />}<br />auth = HTTPBasicAuth('API_KEY', 'SECRET_KEY')<br />response = requests.request("POST", url, headers=headers, data=payload, auth=auth)<br /><br />print(response.text)
Notice that in user IDs, one value does exist on Amplitude, and the other doesn’t. I get the following response:
{'error': {'http_code': 400,<br /> 'type': 'invalid',<br /> 'message': 'Invalid definition',<br /> 'metadata': {'details': 'invalid amplitude_ids and/or user_ids given for app [%s]. invalid amplitude ids: [%s], invalid user_ids: [%s]'}}}
My understanding is that the first should be added to the batch queue, and the second should be reported as an invalid ID. Am I doing something wrong here? Thank you!