Solved

Getting a 'missing_event' response on identify API v2

  • 19 August 2022
  • 1 reply
  • 318 views

Badge +1

Hi,

Seems like the API https://api2.amplitude.com/identify is broken. 


I tried sending a JSON payload using https://api2.amplitude.com/identify, but I keep getting a very vague error message: HTTP 400 missing_event.

I am sending the call using POST with a Conten-Type of “application/json”.

I have tried a few different JSON Payload:
 

{
    "api_key": "MY API KEY",
    "identification": [{ "user_id": "b2d0dc3e-7ec4-48ad-bdbf-30723d461067",
"user_properties":{"province":"ON"}}]
}
{
    "api_key": "MY API KEY",
    "identification": "[{\"user_id\":\"b2d0dc3e-7ec4-48ad-bdbf-30723d461067\", \"user_properties\":{\"$set\": {\"province\":\"ON\"}}}]"
}

I also tried

{
    "api_key": "MY API KEY",
    "identification": "[{\"user_id\":\"b2d0dc3e-7ec4-48ad-bdbf-30723d461067\", \"user_properties\":{\"province\":\"ON\"}}]"
}



I also tried using Postman. 

Each time I get a HTTP 400 missing_event.

Could the API be improved so that we get a detailed error message also.

Thank you

icon

Best answer by Stephane 19 August 2022, 22:34

View original

1 reply

Badge +1

I was able to make the API work in POSTMAN using “form-data”. 
Also, make sure you use “api_key” and not “api-key” like what Amplitude Docs gives you in POSTMAN. 

As for JSON, not sure how to make it work… :( 

I will move ahead with FormData

 

 

Reply