An client for the SchedJoules API in Swift
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Swift API Client

This repository contains the API client written in Swift, which is also used by our Swift SDK.


Currently, we support queries to retrieve a single page by an identifer, a localized home page and to search pages.

Making a request

To send a request (query in our case), first initialize an instance of SchedJoulesApiClient with your API access token.

let apiClient = SchedJoulesApiClient(accessToken: "YOUR_API_ACCESS_TOKEN")

After you have an instance, use the execute function to execute a query.

apiClient.execute(query: HomePageQuery(), completion: { result in
            switch result {
            case let .success(page):
                // Do something with the retreived page object
            case let .failure(apiError):

The execute function uses a completion handler which returns a Result type. Use a switch statement to deconstruct the result.


The Api Client also includes model classes. These all conform to the Decodable protocol and can be decoded from JSON data.