"Missing_event" on Identify request

  • 5 January 2022
  • 2 replies
  • 291 views

Badge

(This is also added as a comment on https://community.amplitude.com/topic/show?tid=614&fid=57 - but since that one is marked solved, I’m not sure it’ll get any attention there.)

I’m hitting this too, and changing my payload to encase the identifications in a string didn’t help. Working in python, and using this data as a json body in a POST to https://api.amplitude.com/identify. (Also tried api2.)

I’m previously tried:

{
'api_key': '<my-key>',
'identification': [{
'user_id': 'my_id',
'user_properties': {'email': 'me@mydomain.com'}
}]
}

After reading the tid=614 thread, I tried:

{
'api_key': '<my-key>',
'identification': '[{"user_id": "my_id", "user_properties": {"email": "me@mydomain.com"}}]'
}

I’m still getting the very uninformative “missing_event” 400 error.

Meanwhile, a direct curl call that follows the style given on https://developers.amplitude.com/docs/identify-api, with the two --data arguments (--data api_key=<my-key> and --data identification=[{...}]), works. (Returns 200, effectively changes my email.)

(Is there a difference between the two --data arguments and one JSON dictionary?)


2 replies

Userlevel 6
Badge +8

Hi @apollograce ,

 

My understanding is you are adding the API Key and Identification key inside a single JSON body for the payload. This is unusual that it won’t work and just gives the error. 

 

I am not overly familiar with Python but I am going to show you a call you can use. 

REQUESTS ;

import requests

url = "https://api2.amplitude.com/identify"

payload={'api_key':'MY_API_KEY',
'identification': '[{"user_id":"my_id","user_properties":{"email":"my@fake.domain"}}]'}
files=[

]
headers = {}

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

print(response.text)


Can you check for me if that works for you? Thank you! 
 

Userlevel 5
Badge +2

Hi @apollograce I hope all is well. I noticed that there are still some open questions here. Were you able to make progress? We’re here to help. 😀

Reply