Skip to content
John Sullivan edited this page Oct 1, 2013 · 10 revisions

The Galah API Client is a light-weight command line utility for interacting with Galah. If you are a teacher or administrator at an institution that uses Galah, you'll want to follow the instructions below to install the Galah API Client.

Quick Installation

The Galah API Client has the theoretical ability to run on all of Linux, Mac OS, and Windows. However, only Linux is officially supported at this time due to lack of testers. If you interested in using the API Client on a system besides Linux and would be willing to be an active tester, please send our developers an email at dev@galahgroup.com and we will be happy to get you set up.

Installation on Linux

The Galah API Client is distributed as a single binary file that should run on most flavors of Linux that have Python 2.6 or above installed. Therefore "installing it" is fairly simple.

  1. Download the latest version of the client from our release page. The file is called galapi, don't download one of the source tarballs.
  2. Make it executable (the Linux command chmod +x galapi, where galapi is the name of the downloaded file, should do it)
  3. Place the file somewhere appropriate (ideally somewhere in your PATH).

Quickstart

The first thing you need to do is tell the client where your institution's deployment of Galah is located. To do this, run the following command in your shell, replacing the value after host appropriately.

galapi --host https://galah.yourinstitution.edu --save

You should see output similar to the following.

$ galapi --host https://galah.yourinstituion.edu --save
INFO: No configuration file found.
INFO: Saving configuration settings to /home/john/.config/galah/api.yml.
INFO: Successfully saved configuration settings.

You have now configured the client to know where Galah is, the next step is to sign in and execute a command. To do this, you must first try to remember if you normally sign in through OAuth or not. If you sign into Galah through the web interface through your Google account, or some account managed by Google, or some other service that is not the Galah internal authentication service, you use OAuth. Otherwise, you do not.

If you use OAuth, enter in the following command and follow the instructions (a web browser will be opened up with which you can login).

galapi --use-oauth user_info me

If you do not use OAuth, enter in the following command and enter in your login information when prompted.

galapi user_info me

In both cases you should eventually see output similar to the following:

[...other stuff...]
INFO: Logged in as john@school.edu.
INFO: Saving session to /home/john/.cache/galah/session.
INFO: Saving API info to /home/john/.cache/galah/api-info.
INFO: Executing user_info command on Galah as user john@school.edu.
User [email = john@school.edu, account_type = admin] is not enrolled in any classes.

Usually, users of the API Client prefer to work within the API Client shell. To enter it, simply execute

galapi -s

You will then be in a powerful interactive shell session (on Linux you will even have command completion and history) that should make things a little easier.

Whenever you feel comfortable enough with the client and want it to stop giving you so much output (namely all those INFO level log messages) you should check out the FAQ for instructions on how to disable them or simply reduce the quantity.

You're now all set! What you do next is up to you, but check out the side bar for useful pages to check out next, including listings of all the commands that Galah recognizes.