Question

I'm new with using third-party APIs, and I was trying to get the Review Board Web API to work in python.

However, I was confused about 3 things:

from rbtools.api.client import RBClient

client = RBClient('http://localhost:8080/')
root = client.get_root()

My first question: is http://localhost:8080/ the server that is running the ReviewBoard server? Is there some sort of test server that I can use instead of running my own?

Again, I don't have much experience with APIs so I was wondering if I needed to do some form of authentication before making these calls.

Finally, if I must set up my own Review Board server to try out the API. Would it be possible to get some code for a very simple example as to how to make the simplest POST and GET request you can think of with minimal setup if for example my server was running on http://localhost:8080/?

Reference : http://www.reviewboard.org/docs/rbtools/0.5/api/overview/
Was it helpful?

Solution

To answer your first question: the answer seems to be yes although their docs don't make it entirely clear.

Their docs say:

Here is an example of how to instantiate the client, and retrieve the Root List Resource resource:

Before the code snippet your pasted. That makes me think that the url being passed is whatever you're trying to use, e.g., you could have that set up on a networked machine called monty_python running on port 5050, then you would do:

client = RBClient('http://monty_python:5050/')

As for a test server you should check the documentation they have about their Web API.

Their examples don't seem to show any authentication being performed in the overview. If you check in other sections (e.g., Tutorial: Creating a Pull Request) you'll see them demonstrate how to authenticate and what can be done after authenticating.

As for your last question, I'm not 100% sure what you're asking, but you should probably check the docs I found for their Web API

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top