Solved

Min_id_length not working for track_event api

  • 6 December 2023
  • 3 replies
  • 85 views

Hi there, I’m getting the error: “Invalid id length for user_id or device_id”,

while calling the track_event api. I passed the min_id_length to one, still I’m getting errors for user ids < 5 character and I have user ids less than 5 character. Here’s the request, Please help me with this.

 

AmplitudeAPI::Event.new({

user_id: user_id,

event_type: event_type,

time: Time.now,

insert_id: SecureRandom.uuid,

event_properties: event_properties,

options: {

min_id_length: 1

}

})

icon

Best answer by Saish Redkar 7 December 2023, 19:51

View original

3 replies

Userlevel 7
Badge +10

Hi @Himanshu Itoria 

Can you try to set the min_id length in the options parameter during your SDK initialization?

 

Thanks @Saish Redkar,

I was using amplitude-api ruby gem in rails, where that option wasn’t working, I’m just simply making a POST request on the api now, without use of any gem, the option works fine.

Userlevel 7
Badge +10

HTTP API supports the options parameter where the min_id length can be overridden.

Reply