vrvoice1 | 2016-08-31 11:46:42 UTC | #1
Hi,
I have add an custom property on my phone configuration. <img src="//inin-prod-use1-developerforum.s3.amazonaws.com/original/1X/11ba13a1baabf571a0d7e0880a6a95adbf260346.PNG" width="690" height="205">
Now I want to read it out with the Platform API. I have found the properties but I can't cast it to any usable model.
TelephonyProvidersEdgeApi tpea = new TelephonyProvidersEdgeApi(); var phone2 = tpea.GetProvidersEdgesPhonesPhoneId("99dd268f-4667-4916-a6c9-d4864f21f399"); var mac = phone2.Properties.First(prop => prop.Key == "mac_address").Value;
Is there any model I can cast it in?
Regards,
Sven
vrvoice1 | 2016-08-31 13:28:56 UTC | #2
Now I am doing it like that:
var macObj =(JObject) phone2.Properties.First(prop => prop.Key == "mac_address").Value; string macAddress = macObj.First.First.First.First.ToString();
But that's realy ugly...
tim.smith | 2016-08-31 14:33:23 UTC | #3
I've logged ES-3490 to look into improving this. However, an improvement to the contract may cause a breaking change, so I would suggest implementing a workaround of some sort. You could do what you've already figured out, or create your own class and deserialize the object to a class that works for you.
system | 2017-08-28 19:26:49 UTC | #4
This post was migrated from the old Developer Forum.
ref: 344