Solved

User Privacy API ignore_invalid_id not working?

  • 27 February 2023
  • 10 replies
  • 188 views

Badge

Hi, I am using the User Privacy API to delete some events, according to the documentation setting the 

ignore_invalid_id to true should ignore invalid user_ids that are sent in the API call. However this does not seems to be the case because if I pass some user_ids which are not in my project I get this error 
Nothing scheduled due to invalid amplitude/user ids for app

Is this expected or am I potentially doing anything wrong? Thanks.

icon

Best answer by Annalisa 3 March 2023, 16:37

View original

10 replies

Userlevel 6
Badge +9

Thanks for reaching out here @Annalisa. Were you able to make progress? This article in our Developer Docs has all of the details you need. We’ll get some other team members to take a closer look as well. Keep us posted!

Userlevel 5
Badge +9

Hello @Annalisa,

 

Do you have an example call that returned the error mentioned? Please make sure not to provide any keys just the parameters that were passed into the API call.

Badge
@sleep_and_retry 
@limits(calls=config.MAX_CALL_LIMIT, period=config.TIME_PERIOD)
def privacy_api_call(user_ids, url=URL, cred=CREDENTIALS):
payload = json.dumps({
"user_ids": user_ids,
"ignore_invalid_id": "true",
"delete_from_org": "false",
"include_mapped_user_ids": "true",
"requester": "annalisa@.....net"
})
headers = {
'Authorization': f'Basic {cred}',
'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)
return response.json()


print(privacy_api_call(["5ef8ee857e74cd1b8525a2c4909884e1bfbef89ea9a8e3b5dc4ec404f07c0aaa"]))

 

Userlevel 6
Badge +8

Hi @Annalisa ,

 

Can you please PM me your email you use for Amplitude, the Org ID and the Project ID you are trying to query through the API? Can you also let me know which User IDs you had this issue with? Thank you. 

Please let me know when you send the PM, thank you. 

 

Kind Regards,
Denis

 

 

Userlevel 6
Badge +9

Thanks for jumping @Denis Holmes. Keep us posted here as you both work out a way forward. 

Userlevel 6
Badge +8

Hi @Annalisa ! Was wondering if you saw my message above and if you can send me a PM with the details? Thank you!

Badge

Hi @Denis Holmes , I did reply to your PM, can you please check.

Best,

Annalisa

Userlevel 6
Badge +8

Hi @Annalisa I see in PM in Community. Can you send it again ? Perhaps it did not get through. I will send a message first.

Badge

I have replied again, please also check ticket https://help.amplitude.com/hc/en-us/requests/242165 which is where my request was handled.

In any case, I have fixed the problem. Long story short, I have found that I cannot return a `response.json()` from the call, but should always return a `response.text`.

Userlevel 6
Badge +8

HI @Annalisa ,

 

Thanks for your response and glad you solved it. Interesting, I do see your response on the ticket but never got notified. Regardless, glad you sorted it out!

 

Kind Regards,
Denis

Reply