You can also use the Modeling Gateway in order to perform this task. You can select from the toolkit configuration file as to what you want to dump out and away you go. The nice thing about the Modeling Gateway is that it has been present in Spectrum for awhile now - a lot longer than the REST interface.
https://docops.ca.com/ca-spectrum/10-3-1/en/customizing/modeling-gateway-toolkit/export-topology-data-from-ca-spectrum
The main use for the Gateway is performing upgrades on Spectrum servers (when you need to move content between them). However, there is no reason why you can't use it to just dump out the devices... The standard output is XML.
Therefore, I would probably counter your question and ask as to what version of Spectrum you are running? Also, how often you need to perform this task. If you require output that is done on a regular basis and through web services then use the REST API. If it is a one off or on a semi-regular basis then I would consider using the Modeling Gateway.
Ed