How Do I Get a List of Manuals From the API?
This lesson will show you how to get a list of manuals using the API. We aren't going to deal with authorizing requests in this lesson, just with the request urls themselves.
Example Setup
To get a list of manuals what you really are doing is requesting the contents of a space. Remember that all API requests must go through a space.
Let's say we have the following setup:
A Space called "My Application" with two manuals in it:
1. Beginner's Guide
2. Advanced User's Guide
Request Contents of a Space
My request url will look like the example above:
1. My account name (bmls).
2. spaces - since I am requesting the contents of a space.
3. The id of the space 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 space 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 space 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 'manuals/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 Live 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 a Lesson
You will use the same exact process to get the contents of a lesson. Your request will look like the one above where:
1. 22 = the manual id.
2. lessons = means we are requesting a lesson in the manual.
3. 48 = the lesson id.
Add your comment