How do I get a list of manuals from the API?
This article contains information on the V1 XML API which has been deprecated. For docs on the V2 JSON API please see here:
This article will show you how to get a list of manuals using the API. We aren't going to deal with authorizing requests in this article, just with the request urls themselves.
To get a list of manuals what you really are doing is requesting the contents of a site. Remember that all API requests must go through a site.
Let's say we have the following setup:
A site called "My Application" with two manuals in it:
- Beginner's Guide
- Advanced User's Guide
Request contents of a space
My request url will look like the example above:
- My account name (bmls).
- s - since I am requesting the contents of a site.
- The id of the site I am requesting.
If the request is properly authenticated then I will receive an XML response detailing the contents of this space. It will contain my two manuals - "Beginner's Guide"
and "Advanced User's Guide".
Build a link in your app for each manual
Now that I know the id of the manuals in my site I can build a url or interface element that the user can click on to see that manual.
Let's say that the user selects "Beginner's Guide" in your application. You know form the XML you used to build this interface element that "Beginner's Guide" has an ID of 22. You pass that to your code for Handling the API calls.
Build request for manual contents
Using the site id and the manual id we can now request the manual's contents. You will notice that he url is almost exactly the same except that we have now added 'm/22' to the end of the url. This will give us the contents of the manual that the user requested.
Process response and display manual table of contents
ScreenSteps returns a response containing an XML representation of the manual table of contents (TOC). You can then use this XML to display the manual TOC to your user.
Getting the contents of an article
You will use the same exact process to get the contents of an article. Your request will look like the one above where:
1. 22 = the manual id.
2. l = means we are requesting an article (lesson) in the manual.
3. 48 = the article id.