Skip to main content
Solved

Retrieve Amplitude ID with user_id through an API

  • July 13, 2022
  • 1 reply
  • 1300 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

Best answer by Saish Redkar

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.

View original
Did this topic help you find an answer to your question?

1 reply

Saish Redkar
Expert
Forum|alt.badge.img+10
  • Expert
  • 1380 replies
  • Answer
  • July 13, 2022

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings