SmartApp to create List of Device ID and Name

I have a simple SmartApp that allows one to authorize endpoint devices. In my case, each of these are virtual devices to receive/send the State of a Wemo Device. To get all this to work I needed to obtain the device ID of each of these devices which I (painfully) got by follwing the Endpoint tutorial and using the exampleOauth.php to create an html file. From it I stripped each URL which contained the device IDs. Too much work.

The smartapp I wrote authorizes each of these devices and provides me with needed URL from which I obtain the access token. It does not provide me with the ID of each of these devices. Ideally, I would like to loop through this authorized device list and write the name and ID of each of these to a file be it text, html, whatever…

Is this possible and if so how??

I used the link below to help me set the type of list you want. No sure if this is the same one you used.
OAuth and Notifications

Thank you for that. Will look into this tomorrow. Presently, I am getting all the devices info via the log. Not pretty mind ya :blush:
The ideal would be output something like:

case "Lightswitch-x_xxxxxxxxxxx":  // replace with the associated Wemo UDN
	$devID="b1499c37-7146-46f0-9158-479bde02732f";   // ST device ID