Gospel Library Catalog Web Service
| Mobile Gospel Library Project Index edit | |
| |
The Gospel Library Catalog Web Service is a service that mobile devices can use to find out content (available as books) that can be downloaded. The catalog will also provide a taxonomy of the content. In other words, the proper order that all content should be shown in, including folders. So, for example, the catalog contains a folder called "Scriptures" and within that folder, the books should be listed as "Old Testament, New Testament, Book of Mormon, Doctrine and Covenants, and Pearl of Great Price".
Contents |
Web service URL
The web service is available via http://tech.lds.org/glweb. The web service uses a RESTful api approach. The service is multi-channel, supporting both JSON (the default) as well as XML. The following REST URLs are currently defined.
Web services
languages.query
Command:
- languages.query - This command will return a listing of all of the languages that there is catalog content for.
Parameters:
- format - [json | xml] (Optional). This specifies which format to return the data in. The default is json if one is not specified.
Example:
json results:
{ "languages": [ { "id": 1, "name": "English", "code": "en" } ], "count": 1, "success": true }
xml results
<?xml version="1.0" encoding="UTF-8"?> <language.results> <languages count="1"> <language ID="1"> <name>English</name> <code>en</code> </language> </languages> <apiresults success="TRUE"/> </language.results>
platforms.query
Command:
- platforms.query - The Gospel Library Catalog Web Service supports catalogs for different platforms. For example, a platform could be "iPhone", or "Android". This command will return a listing of all of the platforms that there is catalog content for.
Parameters:
- format - [json | xml] (Optional). This specifies which format to return the data in. The default is json if one is not specified.
Example:
json results:
{ "platforms":[ { "id":1, "name":"iPhone", "extension":"zbook" } ], "count":1, "success":true }
xml results
<?xml version="1.0" encoding="UTF-8"?> <platform.results> <platforms count="1"> <platform ID="1"> <name>iPhone</name> <extension>zbook</extension> </platform> </platforms> <apiresults success="TRUE"/> </platform.results>
catalog.query
Command:
- catalog.query - This command will return a listing of all books within a specified language and platform catalog.
Parameters:
- languageid - Specify the language identifier (id value) of the language you want to return a catalog for. You can retrieve the language id from calling the languages.query call mentioned above. This field is required.
- platformid - Specify the platform identifier (id value) of the platform you want to return a catalog for. You can retrieve the platform id from calling the platforms.query call mentioned above. This field is required.
- format - [json | xml] (Optional). This specifies which format to return the data in. The default is json if one is not specified.
Example:
json results:
{ "catalog": { "folders":[ { "display_order":0, "name":"Scriptures", "id":1, "languageid":1, "daysexpire":0, "folders":[ { "display_order":0, "name":"Study Helps", "id":2, "languageid":1, "daysexpire":0, "folders":[], "books":[ { "name":"The Guide to the Scriptures", "description":"", "url":"https:\/\/tech.lds.org\/glweb\/index.php?action=book.downloadid=6", "display_order":0, "version":1, "file":"5-1265322689.282.zbook", "size":436669, "dateadded":"2010-06-23 16:28:13", "datemodified":"2010-06-23 16:28:13", "id":6 }, { "name":"Topical Guide", "description":"", "url":"https:\/\/tech.lds.org\/glweb\/index.php?action=book.download&id=7", "display_order":1, "version":1, "file":"12-1269913852.332.zbook", "size":2019012, "dateadded":"2010-06-23 16:28:49", "datemodified":"2010-06-23 16:28:49", "id":7 }, { "name":"Bible Dictionary", "description":"", "url":"https:\/\/tech.lds.org\/glweb\/index.php?action=book.download&id=8", "display_order":2, "version":1, "file":"1-1269913782.752.zbook", "size":475085, "dateadded":"2010-06-23 16:29:13", "datemodified":"2010-06-23 16:29:13", "id":8 } ], "books":[ { "name":"Old Testament", "description":"", "url":"https:\/\/tech.lds.org\/glweb\/index.php?action=book.download&id=1", "display_order":0, "version":1, "file":"10-1269913818.302.zbook", "size":1817977, "dateadded":"2010-06-23 16:23:36", "datemodified":"2010-06-23 16:23:36", "id":1 }, { "name":"New Testament", "description":"", "url":"https:\/\/tech.lds.org\/glweb\/index.php?action=book.download&id=2", "display_order":1, "version":1, "file":"7-1274386242.196.zbook", "size":702839, "dateadded":"2010-06-23 16:24:47", "datemodified":"2010-06-23 16:24:47", "id":2 }, { "name":"Book of Mormon", "description":"", "url":"https:\/\/tech.lds.org\/glweb\/index.php?action=book.download&id=3", "display_order":2, "version":1, "file":"2-1274386987.136.zbook", "size":838528, "dateadded":"2010-06-23 16:25:45", "datemodified":"2010-06-23 16:25:45", "id":3 }, { "name":"Doctrine and Covenants", "description":"", "url":"https:\/\/tech.lds.org\/glweb\/index.php?action=book.download&id=4", "display_order":3, "version":1, "file":"3-1274904066.189.zbook", "size":524037, "dateadded":"2010-06-23 16:26:43", "datemodified":"2010-06-23 16:26:43", "id":4 }, { "name":"Pearl of Great Price", "description":"", "url":"https:\/\/tech.lds.org\/glweb\/index.php?action=book.download&id=5", "display_order":4, "version":1, "file":"11-1274389243.221.zbook", "size":98639,"dateadded":"2010-06-23 16:27:08", "datemodified":"2010-06-23 16:27:08", "id":5 } ] } ], "books":[], "name":"All English content", "display_order":0 }, "success":true }
xml results
<?xml version="1.0" encoding="UTF-8"?> <catalog.results> <catalog> <display_orer>0</display_orer> <name>All English content</name> <books count="0"/> <folders count="1"> <folder id="1"> <name>Scriptures</name> <display_order>0</display_order> <languageid>1</languageid> <isprivate></isprivate> <daysexpire>0</daysexpire> <folders count="1"> <folder id="2"> <name>Study Helps</name> <display_order>0</display_order> <languageid>1</languageid> <isprivate>0</isprivate> <daysexpire>0</daysexpire> <folders count="0"/> <books count="4"> <book id="6"> <name>The Guide to the Scriptures</name> <description></description> <display_order>0</display_order> <uri/> <version>1</version> <catalog_id/> <size>436669</size> <url>https://tech.lds.org/glweb/index.php?action=book.download&id=6</url> <file>5-1265322689.282.zbook</file> <dateadded>2010-06-23 16:28:13</dateadded> <datemodified>2010-06-23 16:28:13</datemodified> </book> <book id="7"> <name>Topical Guide</name> <description></description> <display_order>1</display_order> <uri/> <version>1</version> <catalog_id/> <size>2019012</size> <url>https://tech.lds.org/glweb/index.php?action=book.download&id=7</url> <file>12-1269913852.332.zbook</file> <dateadded>2010-06-23 16:28:49</dateadded> <datemodified>2010-06-23 16:28:49</datemodified> </book> <book id="8"> <name>Bible Dictionary</name> <description></description> <display_order>2</display_order> <uri/> <version>1</version> <catalog_id/> <size>475085</size> <url>https://tech.lds.org/glweb/index.php?action=book.download&id=8</url> <file>1-1269913782.752.zbook</file> <dateadded>2010-06-23 16:29:13</dateadded> <datemodified>2010-06-23 16:29:13</datemodified> </book> </books> </folder> </folders> <books count="5"> <book id="1"> <name>Old Testament</name> <description></description> <display_order>0</display_order> <uri/> <version>1</version> <catalog_id/> <size>1817977</size> <url>https://tech.lds.org/glweb/index.php?action=book.download&id=1</url> <file>10-1269913818.302.zbook</file> <dateadded>2010-06-23 16:23:36</dateadded> <datemodified>2010-06-23 16:23:36</datemodified> </book> <book id="2"> <name>New Testament</name> <description></description> <display_order>1</display_order> <uri/> <version>1</version> <catalog_id/> <size>702839</size> <url>https://tech.lds.org/glweb/index.php?action=book.download&id=2</url> <file>7-1274386242.196.zbook</file> <dateadded>2010-06-23 16:24:47</dateadded> <datemodified>2010-06-23 16:24:47</datemodified> </book> <book id="3"> <name>Book of Mormon</name> <description></description> <display_order>2</display_order> <uri/> <version>1</version> <catalog_id/> <size>838528</size> <url>https://tech.lds.org/glweb/index.php?action=book.download&id=3</url> <file>2-1274386987.136.zbook</file> <dateadded>2010-06-23 16:25:45</dateadded> <datemodified>2010-06-23 16:25:45</datemodified> </book> <book id="4"> <name>Doctrine and Covenants</name> <description></description> <display_order>3</display_order> <uri/> <version>1</version> <catalog_id/> <size>524037</size> <url>https://tech.lds.org/glweb/index.php?action=book.download&id=4</url> <file>3-1274904066.189.zbook</file> <dateadded>2010-06-23 16:26:43</dateadded> <datemodified>2010-06-23 16:26:43</datemodified> </book> <book id="5"> <name>Pearl of Great Price</name> <description></description> <display_order>4</display_order> <uri/> <version>1</version> <catalog_id/> <size>98639</size> <url>https://tech.lds.org/glweb/index.php?action=book.download&id=5</url> <file>11-1274389243.221.zbook</file> <dateadded>2010-06-23 16:27:08</dateadded> <datemodified>2010-06-23 16:27:08</datemodified> </book> </books> </folder> </catalog> <apiresults success="TRUE"/> </catalog.results>
catalog.query.modified
Command:
- catalog.query.modified - This command will return a date when the catalog for a particular language/platform was last modified. A modification happens if a book is updated, added, moved to another folder, or if a new folder is added or an existing folder is re-arranged.
Parameters:
- languageid - Specify the language identifier (id value) of the language you want to return a catalog for. You can retrieve the language id from calling the languages.query call mentioned above. This field is required.
- platformid - Specify the platform identifier (id value) of the platform you want to return a catalog for. You can retrieve the platform id from calling the platforms.query call mentioned above. This field is required.
- format - [json | xml] (Optional). This specifies which format to return the data in. The default is json if one is not specified.
Example:
json results:
{ catalog_modified: "2010-10-22 13:46:14", success: true }
xml results
<?xml version="1.0" encoding="UTF-8"?> <catalog.modified> <modified>2010-10-22 13:46:14</modified> <apiresults success="1"/> </catalog.modified>
catalog.query.folder
Command:
- catalog.query.folder - This command will return a listing of all books and sub-folderswithin a specified language, platform, and folder within the catalog.
Parameters:
- languageid - Specify the language identifier (id value) of the language you want to return a catalog for. You can retrieve the language id from calling the languages.query call mentioned above. This field is required.
- platformid - Specify the platform identifier (id value) of the platform you want to return a catalog for. You can retrieve the platform id from calling the platforms.query call mentioned above. This field is required.
- folderid - Specify the folder identifier (id value) of the folder you want to return from the catalog. You can retrieve the folder id from calling this method with a 0 for the folder ID to return all root level folders.
- format - [json | xml] (Optional). This specifies which format to return the data in. The default is json if one is not specified.
Example:
json results:
{ "catalog":{ "folders":[{ "display_order":0, "name":"Study Helps", "id":2, "languageid":1, "daysexpire":0, isprivate":0 }], "books":[{ "name":"The Old Testament", "description":"", "url":"http://tech.lds.org/glweb/index.php?action=book.download&id=13", "display_order":0, "version":1, "file":"OldTestament.pdf", "size":362584, "dateadded":"2010-06-22 13:37:47", "datemodified":"2010-06-22 13:40:28", "id":13 }, { "name":"The New Testament", "description":"", "url":"http://tech.lds.org/glweb/index.php?action=book.download&id=15", "display_order":1, "version":1, "file":"NewTestament.pdf", "size":362584, "dateadded":"2010-06-22 13:38:51", "datemodified":"2010-06-22 13:38:51", "id":15 }, { "name":"The Book of Mormon", "description":"Another Testament of Jesus Christ", "url":"http://tech.lds.org/glweb/index.php?action=book.download&id=14", "display_order":2, "version":1, "file":"BookOfMormon.pdf", "size":362584, "dateadded":"2010-06-22 13:38:25", "datemodified":"2010-06-22 13:38:25", "id":14 }, { "name":"The Doctrine & Covenants", "description":"", "url":"http://tech.lds.org/glweb/index.php?action=book.download&id=16", "display_order":3, "version":1, "file":"DandC.pdf", "size":362584, "dateadded":"2010-06-22 13:39:15", "datemodified":"2010-06-22 13:39:15", "id":16 }], "name":"Scriptures", "display_order":"0" }, "success":true }
xml results
<?xml version="1.0" encoding="UTF-8"?> <catalog.results> <folder> <display_order>0</display_order> <name>Scriptures</name> <books count="4"> <book id="13"> <name>The Old Testament</name> <description></description> <display_order>0</display_order> <uri/> <version>1</version> <catalog_id/> <size>362584</size> <url>http://tech.lds.org/glweb/index.php?action=book.download&id=13</url> <file>OldTestament.pdf</file> <dateadded>2010-06-22 13:37:47</dateadded> <datemodified>2010-06-22 13:40:28</datemodified> </book> <book id="15"> <name>The New Testament</name> <description></description> <display_order>1</display_order> <uri/> <version>1</version> <catalog_id/> <size>362584</size> <url>http://tech.lds.org/glweb/index.php?action=book.download&id=15</url> <file>NewTestament.pdf</file> <dateadded>2010-06-22 13:38:51</dateadded> <datemodified>2010-06-22 13:38:51</datemodified> </book> <book id="14"> <name>The Book of Mormon</name> <description>Another Testament of Jesus Christ</description> <display_order>2</display_order> <uri/> <version>1</version> <catalog_id/> <size>362584</size> <url>http://tech.lds.org/glweb/index.php?action=book.download&id=14</url> <file>BookOfMormon.pdf</file> <dateadded>2010-06-22 13:38:25</dateadded> <datemodified>2010-06-22 13:38:25</datemodified> </book> <book id="16"> <name>The Doctrine & Covenants</name> <description></description> <display_order>3</display_order> <uri/> <version>1</version> <catalog_id/> <size>362584</size> <url>http://tech.lds.org/glweb/index.php?action=book.download&id=16</url> <file>DandC.pdf</file> <dateadded>2010-06-22 13:39:15</dateadded> <datemodified>2010-06-22 13:39:15</datemodified> </book> </books> <folders count="1"> <folder id="2"> <name>Study Helps</name> <display_order>0</display_order> <languageid>1</languageid> <isprivate>0</isprivate> <daysexpire>0</daysexpire> </folder> </folders> </folder> <apiresults success="TRUE"/> </catalog.results>
book.download
Command:
- book.download - This command will download a specific book from the catalog. The book will be downloaded in the format that it is stored on the server.
Parameters:
- id - Specify the book id (previously returned from the catalog.query command. This field is required.
Example:
book.versions
Command:
- book.versions - This web service returns a listing of all books for a given platform and language, the book's versions and modified dates. It can be used to quickly see which books have changed.
Parameters:
- languageid - The language ID of the language you are querying.
- platformid - The platform ID of the platform you are querying.
- lastdate - (Optional). Specify to only get books that have been added or modified since this date. Format should be yyyy-mm-dd.
- format - [json | xml] (Optional). This specifies which format to return the data in. The default is json if one is not specified.
Example:
json results:
{ books: [{ id: 5, version: 7, date_added: "2010-06-23 16:27:08", date_modified: "2010-10-22 13:29:29" }, { id: 1072, version: 1, date_added: "2010-10-22 09:20:46", date_modified: "2010-10-22 09:20:46" }] }
xml results
<?xml version="1.0" encoding="UTF-8"?> <book.versions> <books count="94"> <book> <id>5</id> <version>7</version> <date_added>2010-06-23 16:27:08</date_added> <date_modified>2010-10-22 13:29:29</date_modified> </book> <book> <id>1072</id> <version>1</version> <date_added>2010-10-22 09:20:46</date_added> <date_modified>2010-10-22 09:20:46</date_modified> </book> </books> <apiresults success="1"/> </book.versions>

