Solved

Retrieve Amplitude ID with user_id through an API

  • 13 July 2022
  • 1 reply
  • 639 views

Hi,

I am building an internal tool where I would like to take their user_id and call https://profile-api.amplitude.com/v1/userprofile to return the Amplitude ID of the user, so that I can link directly to their profile within the application.

Unfortunately, it seems like with amps_props=true set in the URL it still doesn’t return this property:

{
"userData": {
"recommendations": null,
"user_id": "testUser",
"device_id": "ffff-ffff-ffff-ffff",
"amp_props": {
"library": "http/1.0",
"first_used": "2020-01-13",
"last_used": "2021-03-24",
"number_property": 12,
"boolean_property": true
},
"cohort_ids": null
}

Could you please advise if there is any way to get the Amplitude ID using the user_id?


Thanks,
Jarryd

icon

Best answer by Saish Redkar 13 July 2022, 19:27

View original

1 reply

Userlevel 7
Badge +10

Hey @jcheso 

In the docs, I don’t see the amplitude_id being returned in the user profile API responses. So I’m assuming that’s not supported yet.

Instead, you can use the User Search endpoint from the Dashboard REST API to get the amplitude_id using user_id as input.

Hope this helps.

Reply