Skip to main content
Solved

User Privacy API ignore_invalid_id not working?


Forum|alt.badge.img

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.

Best answer by Annalisa

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`.

View original
Did this topic help you find an answer to your question?

10 replies

Amplitude Admin
Community Manager
Forum|alt.badge.img+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!


eddie.gaona
Team Member
Forum|alt.badge.img+9
  • Amplitude Support
  • 161 replies
  • February 28, 2023

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.


Forum|alt.badge.img
  • Author
  • Novice
  • 3 replies
  • March 1, 2023
@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"]))

 


Denis Holmes
Team Member
Forum|alt.badge.img+8
  • Team Member
  • 448 replies
  • March 1, 2023

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

 

 


Amplitude Admin
Community Manager
Forum|alt.badge.img+9

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


Denis Holmes
Team Member
Forum|alt.badge.img+8
  • Team Member
  • 448 replies
  • March 3, 2023

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


Forum|alt.badge.img
  • Author
  • Novice
  • 3 replies
  • March 3, 2023

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

Best,

Annalisa


Denis Holmes
Team Member
Forum|alt.badge.img+8
  • Team Member
  • 448 replies
  • March 3, 2023

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.


Forum|alt.badge.img
  • Author
  • Novice
  • 3 replies
  • Answer
  • March 3, 2023

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`.


Denis Holmes
Team Member
Forum|alt.badge.img+8
  • Team Member
  • 448 replies
  • March 3, 2023

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings