Solved

Getting a 'missing_event' response on identify request

  • 14 November 2021
  • 11 replies
  • 678 views

Badge

 

Hello,

I’m encountering an error where trying to run the identify request. I’m getting in the response (with no formatting) ‘missing_event’. Not in the format that is describe in your documentation.

im sending an identify request as per the documentation: https://developers.amplitude.com/docs/identify-api

to this end point: https://api.amplitude.com/identify
im sending this as my json body:

{

"api_key": AMPLITUDE_API_KEY,

"identification": [

{

"user_id": "kqlvwyvomsxnaets_170",

"user_properties": {

"userRole": "owner"

}

}

]

}

icon

Best answer by anuriel 27 November 2021, 16:28

View original

11 replies

Userlevel 4
Badge +6

Hi @anuriel - hope to help you with this! Would you mind trying this endpoint in your Identify call? 

https://api2.amplitude.com/identify

(please note it is identical to the endpoint you have already tried except there is a “2” after “api”)

Please let me know how this goes for you!

Badge

First I’d like to say thanks for the help!

it seems like I’m still getting the missing_event error.

 

I’m attaching the post request using curl that im running maybe the request will be clearer there…@jmagg any chance you can try running the request with your api key and see what you get?

 

curl --location --request POST 'https://api2.amplitude.com/identify' \

--header 'Content-Type: application/json' \

--data-raw '{

"api_key": API_KEY,

"identification": [

{

"user_id": "kqlvwyvomsxnaets_170",

"user_properties": {

"company": "kqlvwyvomsxnaets",

"industry": "healthcare",

"numberOfEmployeeRange": "21-50",

"signupTimestamp": "1616678036",

"conversionToPaidTimestamp": "1628003369",

"planId": "enterprise",

"userRole": "owner"

},

"country": "Israel"

}

]

}'

Badge

so after talking to one of their sales people that send the question to one of the tech people, I got this information:

“missing_event” gets sent when they are not able to parse the request correctly.

looks like a general error that isn't explained…

the way I got it to work in the end is sending identification as a json stringify instead of the whole json object. which is kinda weird but what ever

so my payload was:

{

"api_key": API_KEY,

"identification": “[{“user_id”:”blablabla”...}]”

}

Userlevel 4
Badge +6

Hi @anuriel - sorry for the delayed response here! Glad to hear you resolved the issue :slight_smile:

Badge

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.

I’m previously tried:

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

After reading the above, 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?)

Userlevel 6
Badge +8

Hi @apollograce ,

 

I have an answer for the above on this thread. Would you be so kind as to see if it helps? Thank you.

 

Kind Regards,

Denis

Userlevel 5
Badge +2

Hi, @anuriel & @apollograce:slight_smile: I wanted to close the loop here. Were you able to resolve the issue? I’m looping in platform specialist @ning.chang, who can take a closer look, if needed. Leave us a comment if you need us!

Badge

 

Hello,

I’m encountering an error where trying to run the identify request. I’m getting in the response (with no formatting) ‘missing_event’. Not in the format that is describe in your documentation.

im sending an identify request as per the documentation: https://developers.amplitude.com/docs/identify-api

to this end point: https://api.amplitude.com/identify
im sending this as my json body:

{

"api_key": AMPLITUDE_API_KEY,

"identification": [

{

"user_id": "kqlvwyvomsxnaets_170",

"user_properties": {

"userRole": "owner"

}

}

]

}


Hi,

Seems like this API is broken. 

Could someone let me know how to make this Identity API work please?

I tried the sending a JSON payload using https://api2.amplitude.com/identify
JSON Payload:

{
"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\"}}]"
}

Each time I get a HTTP 400 missing_event.

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

​​​​​​​Thanks

Userlevel 6
Badge +8

Hi @Stephane ,

 

That looks like an issue with the way the API call is being done as I am able to use the API myself. Can you create a community post and myself or one of my teammates will pick it up as soon as we can? Thank you!

 

I would also recommend the URL endpoint https://api2.amplitude.com/identify 

Are you passing the parameters in form-data or as query params? If you can create the community post, we will help you there, thank you!

Badge

Hi @Denis Holmes 

I was able to make it work using form-data.  See here my question:


In my first attempt to use the API, I was trying to pass in a JSON body which does not work as per the documentation.

Userlevel 6
Badge +8

Hi @Stephane ,

 

I see in the documentation they say to pass it in the body of the request. I see the content type is not specified.  If your request is formData but you’re putting it in the raw window, you would need to include the Content-Type header so your API knows how the data is formatted. This is not recommended though. 

I would use the form-data as the content-type is automatically set for you. Content-Type: application/x-www-form-urlencoded. 

 

Reply