API Explorer help

The API Explorer is an interactive tool that helps you get familiar with the capabilities of the Lifelog API quickly, without having to set up an environment or write any code. The API Explorer lets you get real data from the Lifelog platform using the Lifelog API. Use the tool to run calls and immediately see what type of response the API returns.

To use the API Explorer, you need a Lifelog app user account, and log some data to query against. If you do not have a Lifelog app user account, simply download and install the Lifelog app from Google Play. The first time the app runs you are prompted to sign up for an account.

To make sample calls here, you have to log in to your Lifelog app user account. This allows the API Explorer (called “Console app” in the log-in dialog) to access your data. Use the Authentication menu to log in (see details below). Once you are logged in, you can make test calls.

APIExp_A

When you first go to the page, the Quicklinks sidebar is open, giving you quick access to all available methods in the API. Just click a method in the list to try it. This collapses the sidebar to show the call in the Request URL field already filled in.

APIExp_B

If you don’t want to try individual methods this way, you can use the arrow at the top of the sidebar to close it any time, and enter the Request URL directly. The arrow lets you reopen the sidebar whenever you need it.

Set up a request

All of the calls your app makes to the Lifelog API are made on behalf of an authorized user of the Lifelog platform, and require authorization. This means that a Lifelog app user must log in and authenticate, so that the Explorer can provide a user token to authorize the call.

In order  to authorize your test calls, you must have a Lifelog app user account, so that you can log in and get access to the data you have logged. (See the Authentication page for more information about how this works.) To create a Lifelog app user account simply download and install the Lifelog app. The first time the app runs you are prompted to sign up for an account.

Log in

The Authentication menu allows you to log in so that you can make an authorized call. The first time you try it, it says No Auth, meaning that you do not yet have authorization to make calls.

  1. Click the arrow to show the dropdown menu.
  2. Click OAuth2 to bring up the login UI.
    APIExp_AuthMenu
  3. Log in to your Lifelog app user account, using your Google or Sony Entertainment Network ID.
  4. You are automatically redirected back to the API Explorer, but there is now a new option in the Authentication menu: lifelog-api-AuthenticatedUser.

When this appears, you are ready to send the requests you configure, which will access the data for the account you have created.

Customizing and sending a request

Once you have the required authorization and the Request URL is populated, you can click  “Send” to make the request. If you want to try different things before sending, you can use the tabs under the Request URL field to customize different parts of the request. The things you can customize depend on which call you are trying to make. Using the Quicklinks sidebar helps with this – the fields relevant to the selected request are automatically populated with their default values.

Examine results

After you have sent a request, you can scroll down to the Request and Response sections to see exactly what kind of information your call has requested, as well as how the server responded.

Request summary

Once you have made a request, a summary of the information you requested appears in the Request section. When you are debugging your application, this can help you figure out exactly how to tailor your request to get the response you need. If you don’t need it, you can use the white arrow to collapse this panel.

Response details

The data that you receive from the Lifelog platform in the response to your request appears in the Response section. The header information includes the HTTP/1.1: Status Code that tells you about whether the request succeeded or how it failed, and other header information, such as the Content-Type.and information about your available quota for API requests.

Below the header data, you see the response body, with the returned data in JSON format as documented on the Endpoints pages.