MMS API and unit name

#1

Is it possible to retrieve the unit name for Veras on UI6, via the MMS API?

UI5 units report their name in the discovery message from sta.mios.com/locator.php, but the new MMS API doesn’t seem to report the name in the discovery (locator) message, nor in the device info message.

0 Likes

#2

[quote=“intveltr, post:1, topic:180677”]Is it possible to retrieve the unit name for Veras on UI6, via the MMS API?

UI5 units report their name in the discovery message from sta.mios.com/locator.php, but the new MMS API doesn’t seem to report the name in the discovery (locator) message, nor in the device info message.[/quote]

Did you ever figure this out?

0 Likes

#3

I keep forgetting to reply to this thread. When I get some time today, I’ll update this post with details.

Ok, here are the details. You will need to authenticate with the auth server to receive the proper Identity and IdentitySignature strings. You than must request a session token from the primary account server that is specified from the output when authenticating from the auth server. Once you receive a session token from the primary account server, you can than request the device information with the following url:

https://us-account1x.mios.com/account/account/account/<PK_Account>/devices

Where us-account1x.mios.com is the primary account server for that user. PK_Account is the account number for that user that is listed in the Identity string. You must pass the session token via a http header using MMSSession. You will than be given the output of all units associated with that account including the name of the Vera unit.

  • Garrett
0 Likes

#4

Thanks Garrett… I got a PM from MCV with the same info today.

So the name is not in the device info frame; it takes a second (authenticated) call to the account server to get it.

0 Likes

#5

Hmm, and also have to request a session token from the account server. Seems like a lot of effort just to get the name, seeing as how all the other pertinent device data is already available in the locator and device info frames. :frowning: This goes on my long term todo list for now…

0 Likes

#6

Someone from MCV pointed out that I can make the request to the primary account server by sending the Identity strings in the header, instead of obtaining a session key. The network overhead is larger but it’s only a single call.

0 Likes

#7

So you can call the same api call with out requesting a session key? Can you pm me an example?

  • Garrett
0 Likes

#8

I believe all of the Apis will take the authyoken and authsigtoken headers instead of a session token.

But the each call is authenticated. It’s kind of implied in the docs. (That the session key is optional).

0 Likes