REST XML response format
Kyhi
Registered Users Posts: 12 Big grins
A question about the XML returned when using REST. Should there be an element around the struct or array of structs being returned? (I hope the XML show correctly.) For example, calling smugmug.albums.getInfo would return
<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
<method>smugmug.albums.getInfo</method>
<Album>
<AlbumID>000000</AlbumID>
...
<FriendEdit>1</FriendEdit>
</Album>
</rsp>
instead of
<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
<method>smugmug.albums.getInfo</method>
<AlbumID>000000</AlbumID>
...
<FriendEdit>1</FriendEdit>
</rsp>
and calling smugmug.albums.get would return
<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
<method>smugmug.albums.get</method>
<Albums>
<Album id="1">
<Title>Test 1</Title>
<CategoryID>1</CategoryID>
...
</Album>
<Album id="2">
<Title>Test 2</Title>
<CategoryID>1</CategoryID>
...
</Album>
</Albums>
</rsp>
instead of
<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
<method>smugmug.albums.get</method>
<Album id="1">
<Title>Test 1</Title>
<CategoryID>1</CategoryID>
...
</Album>
<Album id="2">
<Title>Test 2</Title>
<CategoryID>1</CategoryID>
...
</Album>
</rsp>
This would apply to all the calls. This seems the way most others format XML when using REST. Just wondering since it would make some things easier.
Thanks
Bill
<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
<method>smugmug.albums.getInfo</method>
<Album>
<AlbumID>000000</AlbumID>
...
<FriendEdit>1</FriendEdit>
</Album>
</rsp>
instead of
<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
<method>smugmug.albums.getInfo</method>
<AlbumID>000000</AlbumID>
...
<FriendEdit>1</FriendEdit>
</rsp>
and calling smugmug.albums.get would return
<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
<method>smugmug.albums.get</method>
<Albums>
<Album id="1">
<Title>Test 1</Title>
<CategoryID>1</CategoryID>
...
</Album>
<Album id="2">
<Title>Test 2</Title>
<CategoryID>1</CategoryID>
...
</Album>
</Albums>
</rsp>
instead of
<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
<method>smugmug.albums.get</method>
<Album id="1">
<Title>Test 1</Title>
<CategoryID>1</CategoryID>
...
</Album>
<Album id="2">
<Title>Test 2</Title>
<CategoryID>1</CategoryID>
...
</Album>
</rsp>
This would apply to all the calls. This seems the way most others format XML when using REST. Just wondering since it would make some things easier.
Thanks
Bill
0