Get Site ID for User

I am wondering if there is a way to get an existing users Site ID?

Edges belong to sites. I assume you mean the user's location? You can get that by using the expand param for location with user API resources.

I would like to get the site ID, I am cloning existing users and I wish to assign them the same site from one of these: /api/v2/telephony/providers/edges/sites

Sorry, and this would be for their tekepohony assignment

Users and sites aren't directly related. Phones belong to sites and users can use a phone, so that would allow you to look up what phone a user is using at that particular moment, or their default station, and then see what site that phone is a member of. Is that what you're looking for?

thanks I think I had tried that I can get the user station (/api/v2/users/me and add the station param -> "version": 57,
"station": {
"associatedStation": {
"id": "abd29891-156d-4564-8997-524b28b98509",
"associatedUser": {
"id": "7add4493-0291-4f4a-897d-4055224a1b3c",
"selfUri": "/api/v2/users/7add4493-0291-4f4a-897d-4055224a1b3c"
},)

but when I look up the station (/api/v2/stations/{abd29891-156d-4564-8997-524b28b98509})

I don't get the site ID:

{
"id": "abd29891-156d-4564-8997-524b28b98509",
"name": "jeff russell",
"status": "ASSOCIATED",
"userId": "7add4493-0291-4f4a-897d-4055224a1b3c",
"webRtcUserId": "7add4493-0291-4f4a-897d-4055224a1b3c",
"primaryEdge": {
"id": "c04e81b9-bf15-4754-b0bd-854ebe426b0e",
"name": "UXGENEDMEDGE04",
"selfUri": "/api/v2/telephony/providers/edges/c04e81b9-bf15-4754-b0bd-854ebe426b0e"
},
"secondaryEdge": {
"id": "384d3a0f-73d9-4588-a7c1-f0d373980a06",
"name": "UXGENEDMEDGE05",
"selfUri": "/api/v2/telephony/providers/edges/384d3a0f-73d9-4588-a7c1-f0d373980a06"
},
"type": "inin_webrtc_softphone",
"lineAppearanceId": "5fda2c6d61d55019c75595e3+ahst1.orgspan.com",
"webRtcMediaDscp": 46,
"webRtcPersistentEnabled": true,
"webRtcForceTurn": false,
"webRtcCallAppearances": 100,
"webRtcRequireMediaHelper": false,
"selfUri": "/api/v2/stations/abd29891-156d-4564-8997-524b28b98509"
}

Appreciate the help, thoughts?

One more step. Use primaryEdge.id and secondaryEdge.id with GET /api/v2/telephony/providers/edges/{edgeId} to get the edge details, which contain the site ID.

Alas, this doesn't seem to be the case, when I add the site param, it provides the default site for the edge. We have multiple sites assigned to the edge groups

Interestingly, if I look up the userphone on the web interface (pure.cloud/directory/#/engage/telephonyAdmin/phoneManagement/phones) it shows the site that is assigned to the user

When you get the edge info, it has a singular property for site. If you'd like to use the edge group's config, feel free to do that instead. I'm not trying to tell you how to build whatever it is you're building, just trying to point you to things that have site data associated with them.

I don't know where you're seeing that a user has a site; that page has a list of phones and the site the phone belongs to (via its edge assignment).

Tim,

I do appreciate your help, here is the screenshot showing the phone with the assigned site, and the option to assign to any site. just trying to use an API (or combination) to get what "Site" is assigned to the "Phone" assigned to the user.


Depending on exactly what you mean by that (phones aren't associated to users, stations are, in more than one way), you can use one of the various filter parameters on the phones endpoint: GET /api/v2/telephony/providers/edges/phones. You can filter by user ID in a few ways and if you are looking for the phone that has a specific station, that's called a "line" when working with the phones endpoints (station.id == line.id).

OH My Goodness, I was doing everything correctly except I was missing a 'wait' on the "getTelephonyProvidersEdgesPhones(opts)" web call. My bad, thanks for all your help, sorry about the confusion

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.