NAV
code

What is ⋈BowTie?

BowTie is a static hosting environment and professional site builder that makes it easy to build feature-rich static sites and applications you can hand off to clients and nontechnical collaborators.

BowTie provides zero-configuration static hosting, private git repos, domain and SSL configuration, user management, policy controls, integrated Stripe payments, and Jekyll content generation.

Backed by reliable architecture, BowTie reduces the time it takes to execute new sites while avoiding future maintenance and scalability concerns.

Getting Started

For Designers/Developers

To work with BowTie you will need to do a bit of basic setup. You’ll need an SSH key, a file editor, the BowTie client (for working locally), and a basic understanding of git. We also allow you to design and build custom interfaces for your clients/collaborators using Jekyll collections.

For Content Creators

BowTie provides a hosted editor for creating, editing, and removing content on your site (see below). Your workflow will be provided by the developer who set up your site. If you are working with templates provided by BowTie, you can learn how to work with content in our guide on blogging, our collections guide, and our theme guide. If you would like to access your full project repository or plan to work with content locally, read on.

Quick Start

To copy your ssh key to your clipboard for OSX:

$ pbcopy  < ~/.ssh/id_rsa.pub

Taking advantage of BowTie’s features requires some development experience. Need a bit more visual guidance? Read our Getting Started user guide.

If you feel comfortable working with the command line and using basic git commands, follow the steps below to set up your local development environment and get to work.

  1. Register for BowTie and create a project.
  2. Copy your ssh key from your machine’s command line and enter it in the BowTie dashboard under General Settings.
  3. Copy your project URL on your main Dashboard and git clone it down onto your machine. Open your project in a text editor, and get to work! Once you’ve made changes, commit them and push them up just like always.

Keep reading for a thorough explanation of each step.

Setup

Installing the BowTie Client

Install this gem:

$ gem install bowtie-io
Fetching: bowtie-io-1.0.2.gem (100%)
Successfully installed bowtie-io-1.0.2
Parsing documentation for bowtie-io-1.0.2
Installing ri documentation for bowtie-io-1.0.2
Done installing documentation for bowtie-io after 0 seconds
1 gem installed

For local development, the BowTie Client provides the same functionality as the Jekyll development server with some additional features designed for BowTie-specific integration (backend proxy support, status pages, etc).

You’ll need to install the bowtie-io gem on your development system to develop and preview your front-end content locally.

You can run $ bowtie --help for a full list of supported options.

Adding SSH Keys

Generating an SSH Key

To generate a key if you don’t already have one:

$ ssh-keygen
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/james/.ssh/id_rsa.
Your public key has been saved in /Users/james/.ssh/id_rsa.pub.
The key fingerprint is:
6f:10:2d:b6:67:f0:99:8f:b9:61:dc:7c:3f:a1:84:5f james@Jamess-MacBook-Pro.local
The keys randomart image is:
+--[ RSA 2048]----+
|                 |
|         .       |
|        = .      |
|       . * o     |
|        S * .    |
|         * B . E |
|          O * + .|
|         o o + o |
|          .     o|

Just as with GitHub and BitBucket, BowTie authenticates repository access using SSH. You’ll need to set up an SSH keypair and configure BowTie to use it, or use one you already have. Github has a great reference if you’re new to this process.

For the purposes of this guide we’ll configure a default key at ~/.ssh/id_rsa.pub. BowTie will work with an alternative key, but this guide will not consider custom key locations in its scope.

If you already have an SSH key, start below.

Copying an SSH Key to BowTie

For OSX systems, run $ pbcopy < ~/.ssh/id_rsa.pub to copy the contents of your public key into the clipboard. If you’re running another system, just open the ~/.ssh/id_rsa.pub file and copy the contents manually.

Visit the BowTie Account Keys page and paste the contents of your clipboard into the “Key” field. Give the key a title that you’ll remember this machine by and hit “Save.”

You’ll see a list of Keys that you’ve added to the system by their title and a fingerprint.

To determine the fingerprint of the key on your system:

$ ssh-keygen -l -f ~/.ssh/id_rsa.pub
2048 6f:10:2d:b6:67:f0:99:8f:b9:61:dc:7c:3f:a1:84:5f james@Jamess-MacBook-Pro.local (RSA)

When debugging repository access, comparing the key fingerprints is a good place to start.

Team Development

Project owners can invite any other BowTie user to access their project from the BowTie Dashboard.

  1. In your dashboard, visit the Team page found in ‘Settings’ > 'Team’ and enter your desired collaborator’s email address (must be an active BowTie account) in the 'Add Team Member’ field. If the account is found, an 'Add to Team’ button will appear, allowing you to grant access to your project.

  2. Both the primary Project Owner and Contributor can remove Contributor access at any time by selecting the 'Remove’ option next to the Contributor’s name on this page.

Workflow

Cloning

Clone your BowTie project:

$ git clone git@git.bowtie.io/example
Cloning into 'example'...
remote: Counting objects: 215, done.
remote: Compressing objects: 100% (205/205), done.
remote: Total 215 (delta 18), reused 0 (delta 0)
Receiving objects: 100% (215/215), 1.57 MiB | 576.00 KiB/s, done.
Resolving deltas: 100% (18/18), done.
Checking connectivity... done.

If you’re unfamiliar with Git, please thoroughly read the documentation before starting development.

After creating a Project in BowTie’s Dashboard, there will be a SSH clone URL in the top middle of your page. Copy that, and clone your repository to your local system using your development system’s git installation.

Replace git@git.bowtie.io/example with your Clone URL from the Project Dashboard.

BowTie project files:

$ ls
400.html      404.html      _config.yml   _layouts      _sass         about.md
favicon.ico   img           index.json    maintenance   settings.json
403.html      500.html      _includes     _posts        _site         css
feed.xml      index.html    js            posts.html    vendor

Now you’ll have a directory at ./example with all your contents.

A README.md file in the cloned source will help you get started with development on your local system.

Branches

See all branches associated with your project:

$ git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/master

Previewing Changes

Start the BowTie server to see your changes:

$ bowtie serve
Configuration file: /Users/james/example/_config.yml
            Source: /Users/james/example
       Destination: /Users/james/example/_site
      Generating...
                    done.
 Auto-regeneration: enabled for '/Users/james/example'
Configuration file: /Users/james/example/_config.yml
[2015-02-03 15:52:02] INFO  WEBrick 1.3.1
[2015-02-03 15:52:02] INFO  ruby 2.1.3 (2014-09-19) [x86_64-darwin13.0]
[2015-02-03 15:52:02] INFO  WEBrick::HTTPServer#start: pid=66488 port=4000

In your cloned Project’s directory (your local checkout), run the BowTie client.

This launches the development server at “http://localhost:4000”, which you should now be able to browse to.

Changes to files within the example directory trigger a rebuild without needing to restart the server.

The BowTie client wraps the general Jekyll system, and captures requests to /users/* and /bowtie/* which BowTie’s platform will handle for you.

I’ll add a quick blog post to our Project:

bash
$ vim ./_posts/2015-02-03-lack-of-sleep-and-startups.markdown
text
---
layout: post
title:  "Sometimes I Just Need a Nap"
date:   2015-02-03 02:36:00
categories: startups
---

# The Origins of Sleep

...

# Why a Nap is Enough

...

# Why You're Going to Wake Up Too Soon, Anyway

...

And then commit the change:

bash
$ git status

On branch master
Your branch is up-to-date with 'origin/master'.
Untracked files:
  (use "git add <file>..." to include in what will be committed)

        _posts/2015-02-03-lack-of-sleep-and-startups.markdown

nothing added to commit but untracked files present (use "git add" to track)

$ git add _posts/2015*
$ git commit -a -m "Adds Post on Lack of Sleep"
[master 98f2005] Adds Post on Lack of Sleep
 1 file changed, 18 insertions(+)
 create mode 100644 _posts/2015-02-03-lack-of-sleep-and-startups.markdown

Pushing Changes

Once you’ve made your local changes and you’re ready to see those changes on the BowTie site, you just need to push those changes to BowTie:

bash
$ git push origin

Counting objects: 4, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 572 bytes | 0 bytes/s, done.
Total 4 (delta 1), reused 0 (delta 0)
remote: Initiating Project Render for master
remote: Extracting Project Snapshot
remote: Rendering
remote: WARNING: Your kernel does not support swap limit capabilities. Limitation discarded.
remote: [23:12:41] Working directory changed to ~container
remote: [23:12:43] Using gulpfile ~container/Gulpfile.js
remote: [23:12:43] Starting 'default'...
remote: [23:12:43] Starting 'build'...
remote: Configuration file: /container/snapshot/_config.yml
remote: Configuration file: /container/snapshot/_config_bowtie.yml
remote: Configuration file: /container/_jekyll_config_overrides.yml
remote:             Source: /container/snapshot
remote:        Destination: /container/staging
remote:       Generating...
remote:                     done.
remote:  Auto-regeneration: disabled. Use --watch to enable.
remote:
remote:
remote: [23:12:46] Finished 'build' after 3.59 s
remote: [23:12:46] Starting 'upload'...
...
remote: [23:12:47] [create] jan31-a/live/startups/2015/02/03/lack-of-sleep-and-startups.html
remote: [23:12:47] [skip]   jan31-a/live/vendor/magnific-popup/src/js/gallery.js
...
remote: [23:12:47] Finished 'upload' after 553 ms
remote: [23:12:47] Finished 'default' after 4.15 s
remote: Completed Project Render for master
To git@git.bowtie.io:jan31-a.git
   67187f6..98f2005  master -> master

BowTie received the commit, rebuilt your Project, and pushed it to it’s content delivery system.

Visiting your site (in this case “https://example.bowtied.io/”), shows the changes have been applied.

Dashboard Tour

BowTie provides a web-based dashboard that complements the repository-based configuration system and BowTie client. It presents project statistics and management interfaces for the most common development and administrative tasks.

This section goes through each tab on the left-hand navigation of your BowTie Dashboard and briefly reviews the tools available to you.

If you’d like, you can read this user guide to jump right in and get a site up and running in 5 minutes.

Ready to start building? Skip down to the Reference Section.

Project Dashboard

Your Project Dashboard is the nerve center of BowTie applications. Here you will find all the analytics you want to track in your site.

Collections

The Collection Editor allows you to create, modify, or remove content on your project site from any browser. You can configure the fields editor to provide a specific interface for clients and nontechnical users.

Posts

Most BowTie templates include a pre-configured Jekyll blog so you can begin validating your ideas and sharing your vision with the general public on day one.

The Posts interface in the BowTie UI provides a markdown editor you can use to publish content. If you want to see how to get your blog set up and explore it’s features, read this user guide we’ve written for you.

Other Collections

In order to use Collections, your site must be made with Jekyll and use Jekyll collection objects (including posts). If you started from a BowTie template, collection-based content will be present by default. Check our reference to learn how to define Collections or read our guide on working with the Collection Editor.

Users

Subscribers

Your User list will help you track important information about your users, including their identities, custom profile data, and session details. Visitors to your site will also be tracked here temporarily.

You can add new users and manage their general account experience with the administration panels available in this section.

If you’d like to explore Users more deeply, read this visual user guide.

Revenue

Payments

BowTie is preconfigured with Stripe so you have industry leading payment functionality and security - all you have to do is connect your Stripe account.

There are plenty of things you can do with the Stripe integration, like set up a paywall site or donation page. You can also refund recent User payments from here on your Dashboard. Read our user guides for a step-by-step walk through of Stripe integration.

Plans

By tracking Stripe plans, you can manage what subscriptions your users must register for before they can access your application. This configuration menu will be available only after you’ve connected your BowTie Project to Stripe.

This user guide will show you how to connect to Stripe, set up plans based on subscriptions, and track them in order to limit content available to users. This is an integral feature of BowTie that is sure to wildly enhance your application.

Products

Products are the last feature inside of the Revenue tab on your Dashboard. Here, you can create products for your users to purchase and have the transaction linked to your Stripe account. Purchases of products will appear here and you can refund them with the click of a button.

Again, we’ve written a step-by-step walk through to show you exactly how to create, modify, and charge for products inside of your BowTie project.

Settings

Inside of the Settings tab on your Dashboard, there will be four sections that contain environment specific details for each of your projects. Every BowTie project has two environments, Test and Live.

Everything up until now, and through this section, is specifically related to the environment in which you are working in(except products!). You can switch environments in the tab located to the right of your project name in the upper left hand corner of your Dashboard.

General

The General tab under Settings on your Dashboard houses environment specific information, like your Git Clone URL, Primary Domain, Email Forwarding instructions, Secret Keys, and Maintenance Mode. If you want to access the opposite environment’s general information, switch your environment setting to the right of your project name in the header.

Maintenance Mode let’s you suspend access to your site and application. It replaces your site with a simple page to let users know you are down for maintenance and will be back up soon. A yellow indicator will confirm that Maintenance Mode is either on or off.

Your Secret Key pertains to your project’s environment, depending upon what environment you are currently working in.

Team

Project owners can invite any other BowTie user to access their project from the team section of your Dashboard.

Project Owners can add a desired collaborator using their email address (associated with an active BowTie account). Team members can now commit to your BowTie project repos via the UI or CLI, and will have access to UI based tools.

Domains

Each of your domains automatically associates with your two default environments (test and live).

You can associate new environments, modify settings for existing domains, add, purchase, or transfer domains from this tab. If you bought your own domain (BYOD) elsewhere, that works too - just follow the directions to install the nameservers you’re prompted with during installation.

For a more technical dive, read the reference section below.

Environments

Your Project was created with default environments, a Test environment for working with Users and content that may not be permanent, and a Live environment for permanent data. Use this tab to define new environments, configure them to branches in your repo, and set how they interact with Stripe.

OAuth

BowTie supports oAuth implementation into your application for both Google and Twitter. Set up your application in either developer’s console you wish to use, and enter those credentials into this section of your Dashboard.

This in-depth user guide shows how to set up Google oAuth functionality with a Rails backend application using BowTie.

Webhooks

Webhooks allow your application to receive notifications when an event occurs on the BowTie platform. This section of your Dashboard will be where you enter these in, and are optional. For more technical insight, read the reference section.

Top Menu Controls

The Top Menu is the banner running along the top of the BowTie platform. Here you will find key controls for managing projects at the project level and controls for managing your overall account with BowTie.

Project Dropdown

This allows you to switch between all your existing projects. Create a new project button (the plus sign). The environment you are currently working in will appear to the right of your project name, either Test or Live.

Account Settings

Your Account settings are where you manage global settings and for your BowTie account.

Reference

Projects

Structure

BowTie projects include a number of components designed to help you prototype faster. All BowTie templates make use of Bootstrap, jQuery, and FontAwesome.

Several predefined components exist in an _includes directory, explained below.

Templates and Components

All other content in your repository is rendered with Jekyll. The _config.yml file is the base Jekyll configuration file. The _layouts directory contains page layouts assembled from a number of _includes. You are able to use any and all of these components as is.

There are seven pre-built templates for you to use in your project.

Template Description GitHub Link
Blank A blank site with hosted maintenance and error pages. GitHub
Blog Responsive Jekyll blog with extras. GitHub
Landers A collection of elegant landing pages for lead generation. GitHub
Donation/Pay Page Donation page with Stripe Checkout and blog templates. GitHub
Offer Page - Collections ‘Offer Page’ is a Groupon Clone Jeykll template designed for use with the BowTie collection editor. GitHub
Offer Site Daily Deal site with Stripe Checkout. GitHub
Static Site with Paywall Landing page with Stripe paywall and blog templates. GitHub

 

Components

BowTie themes use blocks of static HTML (components, widgets, elements, and actions) that can be easily included and repeated throughout your site. As a whole, we refer to these building blocks as Components. Since our themes are based in Jekyll, another way to think of components would be as Jekyll includes. Many of these components include logic that will populate content from collections or other data sources, and/or pull in 3rd party functionality.

BowTie components are designed to be interchangeable between themes, and easily modified. For a list fo available components and options, read our post on working with BowTie components.

If you are a developer or designer and wish to customize widgets see our post on style and customization.

Settings

BowTie Projects include the settings.json file containing several values used for running BowTie tools and configuring site settings. We don’t advise removing this file, however you can edit it to tailor your application.

Landing Page

The index.html file contains the contents and the data for generating your BowTie splash page. This file can be a markdown file as well. It is made up of a number of includes that form your splash page - you can include or delete components to tailor your page to your liking.

The BowTie site styling guide contains a visual walk-through on how to style your landing page and site.

Repositories

Your Project Site is mapped to a hosted domain at https://projectname-environment.bowtied.io/, or to your Custom Domain.

The Project Repository is a git repository containing a Frontend Theme, Legal Documentation, and Policy Files. You can manage most of your Project configuration by editing content within this repository. A simple git push to the BowTie remote from your local repository will trigger BowTie’s systems to update your application.

Domain Type Project Name Environment URL
Hosted Domain example test https://example-test.bowtied.io/
Hosted Domain example live https://example.bowtied.io/
Custom Domain example.com test https://example-test.example.com/
Custom Domain example.com live https://example.com/

From your Project Repository checkout, you can promote these changes by merging or rebasing into the desired environment.

Unless otherwise stated this documentation assumes you cloned your repository directly from the BowTie clone url without additional options, and that ‘origin’ points to the BowTie repository servers.

Pushing content to ‘origin’ will create a new release and promote the changes to your live Project Site.

Environments

Every BowTie project comes with two environments, Test and Live. Changes in your Project Dashboard will affect the branch that is associated with the environment you are currently working in. Locate the environment name to the right of your Project name in your Dashboard to toggle between environments.

Maintenance Template

The contents of the maintenance folder become your site root when a Project’s maintenance mode is enabled. The folder contains static self-contained content.

Maintenance Mode is a quick and easy way to control the visibility of your site and application. Enable or disable this feature in your BowTie dashboard under General Settings.

Error Pages

Your project ships with error handling by default. For example, if a request submitted to your application is not found, the 404.html file will be served. If a request submitted to your application generates a server error, the 500.html file will be served.

Error pages are compiled by Jekyll. The {400,403,404,500}.md files contain your error document content. The layout for each error is error.html, found in your _layouts directory. Error pages are styled by the theme.scss file by default.

Any HTTP status code within the 400’s that’s not more explicitly specified by another file will be handled with the 400.html file. A 422 response status without a 422.html file will serve the 400.html file.

Blog

Your project ships with a markdown-based blog with example content. We’ve written an in-depth blog post on how to utilize this feature, feel free to read it for further detail.

Collection Editor

The Collection Editor allows you to create, modify, or remove content on your project site from a web browser. We designed it to be easy for developers and designers to customize the editing interface for clients and non-technical collaborators.

How it Works

The editor will detect any valid collection defined in your site _config.yml file and make it editable from your BowTie dashboard. Changes made in your browser are saved as git commits, and will trigger a new site build on the BowTie server, making it easy to collaborate with less technical users while maintaining a git workflow. There are two editing modes, for markdown and form-based content.

BowTie Markdown Editor

Getting Started:

In order to use this feature, your site must be made with Jekyll and use Jekyll collection objects (including posts). If you started from a BowTie template, collection-based content will be present by default.

Step 1: Defining a Collection

To define a collection, include it in your _config.yml as shown below. For more information on Jekyll collections, see their docs.


collections:
  lander-1-col:
    output: true
  services:
    output: false

Once a collection has been defined, it will appear in the BowTie dashboard similar to 'Features’ as seen above.

 

Step 2: Set up the form defaults

Building a custom form for content or post front matter is easy. The collection editor will generate a dynamic form from a _fields.md file in the root of the collection. Entry type and defaults are specified in yaml front matter. You can configure the form for strings, dates, timestamps, file uploads, color pickers, and more.

Example ’_fields.md’ File


---
name: null
members_only: true
date:
ending_on:
starting_at:
featured_img_path:
header_color:
---
Add text or liquid includes here.

 

Generated Form:

BowTie Collection Editor

  Each form field is defined from a key/value pair in the front matter of the _fields.md file. Read on for a full list of options.

Step 3. Provide Access

If you are providing access to a client or collaborator, visit the Team page found in 'Settings’ > 'Team’ and enter your collaborator’s email address in the 'Add Team Member’ field.

New team members will receive an email invitation, and now see your project listed in their project drop down*. Collaborators do not need to register an SSH key if they’re only working with the collection editor.

*If the email address you attempt to share your project is not connected to an active BowTie project, the 'Add User’ button will not appear. Shared projects do not count against your total available project count (set by your BowTie subscription plan).

 

Field conventions:

Any text you enter as a value in the _fields.md file will be used as a default. We recommend wrapping text in quotes (e.g. “Jack Dorsey”). A blank value, or the use of 'null’ will render the option null.

Keys unique to a collection item and not present in the _fields.md will only appear in new items cloned from the item containing the unique values.

Strings:

Most key/value pairs will render simple string variables you can use in your templates (e.g. name: “value” ). This will produce a text input in your form:


---
name: "Jack Dorsey"
address: null
---

"BowTie form editor - string"

 

Array:

To produce an editable array of strings, simply nest the variables in your front matter as show below. This will output an editable list of variables in the form:


---
categories:
  - Hello World
  - BowTie
---

BowTie form editor - array 

 

Boolean values:

Adding a value of ‘true’ or ‘false’ following the key in the yaml will produce a checkbox.


---
pattern: false
parallax: true
---

"BowTie form editor - boolean"

 

Date entry:

Using a key of ‘date:’, or appending ‘on’ to the end of a key will add a datepicker to the form. Additionally, using ‘date:’ as a key value will add a time-stamp entry field. Using ‘on’ alone will produce the datepicker only (e.g. registered_on: “” ).


---
date:
---

"BowTie form editor - date"

 

Time:

Appending ‘at:’ to the end of a key will create a time selector (e.g. startingat: “”).


---
start-time_at:
---

"BowTie form editor - time"

File uploads:

If you want to produce a file upload interface, append ‘_path’ to the key value (e.g. featured_img_path: “” ). This will provide a file upload interface.


---
avatar_path:
---

"BowTie form editor - file upload"

Image files will generate a preview:

"BowTie form editor - file upload"

 

Color picker:

To provide a color picker interface in your form append ‘_color:’ to your the key (e.g. header_color: “” ). Selections are returned as six character hex values.


---
background_color:
---

"BowTie form editor - colorpicker"

 

Users

Projects are provided a fully managed user authentication system. This includes registration forms and account management interfaces (for both administrators and your customers).

A Project’s users have the ability to register, log in, log out, and change account details. User records are unique to a Project and the environment they were created in. You can access administrative user management features from the BowTie Project Dashboard.

The user access control system is equipped to protect content from your frontend or backend based on this user management interface.

If you want to see a visual explanation of everything to do with User profiles, read this blog post.

Settings

The Project’s settings.json file contains several settings that modify the behavior of the user authentication system.

users.after_sign_in_path

Specifies the path to redirect a user after they’ve signed in to the Project. Defaults to /. Specified in Project settings.json

users.after_sign_up_path

Specifies the path to redirect a user after they’ve registered a new account for the Project. Defaults to /. Specified in Project settings.json

Interfaces

These paths, which are accessible at https://{DOMAIN}/users/\* provide the forms and functionality required to allow Project Users to manage their sessions and their accounts.

/users/sign_up

Contains the User registration form. Direct visitors here when they need to register a new account.

/users/sign_in

Direct users who need to sign in to their account here. It contains a form with the email/password fields required for creating a new session.

/users/sign_out

Signs out a Project User with a current session.

Redirects to the sign in path for visitors with no session.

/users/password/new

Allow a visitor to begin the password reset procedure.

/users/password/edit

Allow a Project User with a session to change their password.

Redirects to the sign in path for visitors with no session.

/users/confirmation/new

Allows unconfirmed users to reinitiate the confirmation process.

This interface is introduced to a Project User by BowTie’s internal authentication processes.

/users/unlock/new

Allows users who were locked out of their account to initiate the unlock process.

This interface is introduced to a Project User by BowTie’s internal authentication processes.

GET /bowtie/api/users/profile.json

Returns a JSON object with profile data that’s been associated with the current user, or a blank JSON object if there is no data.

Authentication:

The request must be sent from the user’s browser or device with an active user session. If you’re generating the request outside of the user’s session, please use the /bowtie/api/users/:id/profile.json endpoint with required authentication.

GET /bowtie/api/users/:id/profile.json

Params: [scope='browser’]: string representing the user profile scope

Returns a JSON object with the profile data for the user with BowTie User ID :id, or a blank JSON object if there is no data.

Authentication:

You must authenticate the request with your Environment’s Secret Key, available on the Project Settings page on the BowTie Dashboard.

Authentication is performed via HTTP Basic Auth. Use the Environment’s Secret Key as the username for your request.

POST /bowtie/api/users/profile.json

Params: profile: {}

Set the “browser” profile data associated with the current user.

POST /bowtie/api/users/:id/profile.json

Params: profile: {} [scope='browser’]: string representing the user profile scope

Set the scope profile data associated with the user with the BowTie User ID :id.

Authentication:

You must authenticate the request with your Environment’s Secret Key, available on the Project Settings page on the BowTie Dashboard.

Authentication is performed via HTTP Basic Auth. Use the Environment’s Secret Key as the username for your requests.

Backend Request Headers

The backend application proxy injects a number of special request headers your application can use to provide logic for your users based on subscription and authentication information. Your frontend can use the javascript interfaces to gather user detail within the client. A JSON web token is provided so you can verify this data on your server.

HTTP Headers are added to Project Backend requests when the Backend is enabled. These headers are not available until a Project User session exists:

Header Name
X-Bowtie-User-Id A unique identifier for the current user
X-Bowtie-User-Name The name the current user provided for their profile
X-Bowtie-User-Email The email address for the current user
X-Bowtie-User-Plan The stripe plan id of the current user’s subscription, when applicable
X-Bowtie-User-Google-OAuth2-Token The token when the project has Google OAuth authentication enabled and when the User has authenticated with Google

Object Reference

The User object referenced by the BowTie javascript interface and the REST API contains the following properties:

Property
id Unique BowTie identifier
email Current email address
google_oauth2_token Valid Google OAuth2 token if the User has connected the account with Google OAuth2
twitter_token Valid Twitter OAuth token if the User has connected the account with Twitter OAuth
project_id BowTie project identifier
name Current name
plan Current plan name for the subscription. Undefined when user does not have a subscription
plan_id Current plan for the subscription. Undefined when user does not have a subscription
status 'visitor’ if the current user is not registered, or 'registered’ if they have.
stripe_credit_card_token Stripe credit card token
stripe_customer_id Stripe customer identifier
stripe_subscription_id Stripe subscription identifier
stripe_subscription_status Stripe subscription status (trialing, active, past_due, canceled, unpaid)
locked Account locked status (true/false)
confirmed Account confirmation status (true/false)
created_at Timestamp for record creation (YYYY-MM-DDTHH:MM::SS.mm)
updated_at Timestamp for last update (YYYY-MM-DDTHH:MM::SS.mm)
jwt JWT encoded with the Environment’s Secret Key containing all the above information

Accessing a property on the user object from the bowtie.user.info method:

  bowtie.user.info(function(user){
    if(user){ console.log(user.stripe_customer_id); }
  });

HTTP API

Requests can be made on behalf of the current user by providing a user_id parameter with the user’s ID and using the Environment’s Secret Key as the username in an HTTP Basic Auth Request. Your Environment’s Secret Key is available on your Project Settings page in the BowTie Dashboard.

User Information

GET https://:{secret}@{domain}/bowtie/api/users/[:user_id/]info.json

parameter description
user_id The ID for the user receiving the profile update. If blank, references current user

The response is a JSON-based User Object

Javascript API

All layouts reference the file with a script include:

  <head>
    <script type="text/javascript" src="https://bowtie.io/assets/bowtie.js"></script>
  </head>

Methods available to the frontend from bowtie.js, which is a javascript include in the head on new Project sites by default.

Server Side Verification

Include JSON Web Token (Javascript):

  bowtie.user.info(function(user){
    if(user){
      $.post("https://example.com/update", { user_jwt: user.jwt });
    }
  });

Include JSON Web Token (Ruby):

require 'sinatra'
require 'ruby-jwt'
require 'json'

ENVIRONMENT_SECRET_KEY = "sk_XXXXXX"   # From the Project Settings page in the Dashboard

post '/update' do
  begin
    # Parse incoming JWT assuming parameter user_jwt
    data, _attrs = JWT.decode(params[:user_jwt], ENVIRONMENT_SECRET_KEY)

    # Respond with the user data. If the token is invalid then ruby-jwt raises
    # the decode error (in other words, don't let processing continue if the JWT
    # decode fails.
    body data.to_json

  rescue JWT::DecodeError
    # JWT was invalid - submission may not have been performed by the
    # trusted party.

    status 403
  end
end

When configured as a backend application, the X-Bowtie-* headers can be used to ensure that the provided user data is authentic.

For server based operations that are not configured behind the BowTie backend proxy, you must use the included JSON Web Token (jwt), which is signed with the Project’s secret key.

bowtie.user.info()

Returns an object with information about the current Project User.

bowtie.user.info([callback], [errback])

Access user info:

  bowtie.user.info(function(user){
    if(!user){
      // There is no user signed in

    }else{
      // User information available in the `user` object
    }
  });

See the User Object Reference above for properties available within the user variable.

bowtie.user.signUp()

Register a new User for the current Project.

Register a new User for the current Project:

  bowtie.user.signUp(email, password, function(user){
    console.log("registered new user");
  }, function(response){
    console.log(response.error);
  });

bowtie.user.signIn()

Create a new session for the given email and password.

Create a new session for the given email and password.

  bowtie.user.signIn(email, password, function(user){
    console.log("signed in");
  }, function(response){
    console.log(response.error); // Invalid email or password.
  });

bowtie.user.signOut()

Discard a session if it currently exists. This action is idempotent, and will succeed without a current session.

Callback receives a null result on success.

Discard a session if it currently exists.

  bowtie.user.signOut(function(){
    console.log("User logged out");
  }, function(){
    console.error("Problem logging out");
  });

OAuth Registration

Users can register and access your BowTie project with OAuth2 authentication from two third-party providers at the moment, Twitter and Google. Configuration settings are unique for each provider, and can be found in the 'Settings’ > 'oAuth’ tab of your Project Dashboard.

Google and Twitter OAuth Connection

BowTie Projects may be configured with integrated Google OAuth2 authentication.

Read this user guide to see how to integrate OAuth into a BowTie application.

When the token has expired, subsequent User action will redirect them through the authorization process. In most cases, this action is transparent and will simply refresh the token without prompting the User.

Requests to retrieve the User Object via the HTTP API will automatically attempt to refresh the token if the “offline” access_type has been configured for the Project.

Profiles

HTTP API

Requests can be made on behalf of the current user by providing a user_id parameter with the user’s ID and using the Environment’s Secret Key as the username in an HTTP Basic Auth Request. Your Environment’s Secret Key is available on your Project Settings page in the BowTie Dashboard.

Updating/Creating a Profile

POST https://:{secret}@{domain}/bowtie/api/users/[:user_id/]profile.json

parameter description
user_id The ID for the user receiving the profile update. If blank, references current user
scope The scope for the Profile data update - default is browser
profile[{key}] Sets the key to the given value on this Profile’s scope. May be used multiple times with various keys

Multiple keys may be provided. If the Profile exists for the User, these keys will be merged into the existing Profile. Otherwise, a Profile will be created for the User.

Retrieving a Profile

GET https://:{secret}@{domain}/bowtie/api/users/[:user_id/]profile.json

parameter description
user_id The ID for the user receiving the profile update
scope The scope for the Profile data update - default is browser

Javascript API

bowtie.user.profile()

bowtie.user.profile([data], callback, errback)

Update the current User’s profile, or retrieve the current User’s profile. These methods require a current session; attempting to access a profile without a session results in a call to the errback method.

Updating/Creating a Profile

Update profile data:

  bowtie.user.profile({ tags: ['ruby', 'javascript'] }, function(profile){
    // profile contains an object with all profile data
  });

If passed an object, this method merges the keys into the User’s profile data. To remove a key, set the value to null.

Retrieving a Profile

Retrieve a User’s profile

  bowtie.user.profile(function(profile){
    // profile contains an object with all profile data
  });
File Uploads

Javascript File objects may be specified as values in the profile data object. The file will be uploaded to the BowTie platform, and the returned profile object will contain a URL reference to the file.

File upload:

  var file = document.getElementById("#myFileUpload").files[0];

  bowtie.user.profile({
    avatar: file,
  }, function(profile){
    console.log("File URL:", profile.avatar.url, "File Size:", profile.avatar.size);
  });
Stripping EXIF Data

When an image file is uploaded to a user’s profile, any accompanying EXIF data is automatically removed from the image.

Image Resizing

An image file uploaded to a user’s profile with a key containing a dimensional descriptor in the filename (XYZ-200x300.jpg) will be resized to fill the provided dimensions.

Dimensions should prefix the extension, and should follow the format {name}{width}x{height}.{format}, where format is jpg, jpeg, gif, png, bmp, or ico.

To resize an image:

  // Uploaded images are converted to 100x100 pngs
  bowtie.user.profile({
    'avatar-100x100.png': file
  }, function(profile){
    console.log("File Size:", profile['avatar-100x100.png'].size);
  });

Resizing above 5000 pixels in width or 5000 pixels in height will result in sizing at 5000 pixels.

We don’t crop images. We recommend cropping the image within the client using the Canvas API or on your server before sending an authenticated request to the endpoint.

Image Conversion

An image file uploaded to a user’s profile with a key containing the desired format for the upload will be converted to that format.

Change image format:

  // Uploaded images are converted to jpg format
  bowtie.user.profile({
    'avatar.jpg': file
  }, function(profile){
    console.log("File URL:", profile['avatar.jpg'].url);
  });

Supported formats include jpg, jpeg, gif, png, and bmp.

User Restrictions

You can set policies around User Profile attributes. There a number of different profiles you can protect, outlined below.

Subscriptions

Your Project may require users to subscribe to a plan for periodic charges to a credit card they’ve associated with their account. BowTie’s support for subscriptions allows you to configure Stripe Plans and “track” them for use by your Project.

The bowtie.user.info() method will return an object containing a plan attribute containing the Stripe Plan ID of the Tracked Plan the User is registered with.

The X-BowTie-User-Plan header will provide the Stripe Plan ID of the Tracked Plan a User is registered with to the backend application.

Read our visual, in-depth user guide to see how to implement subscription based policies. Technical documentation surrounding access control based on subscriptions can be found below.

Products

One-off purchases (or payments) are distinct from subscriptions in that they are not recurring, and occur only once. For your users to make a one-off purchase you’ll need to create a Product on the BowTie dashboard. Your Product will have an associated identifier that you can use to reference it during the purchase process.

Read this user guide to visually see how to implement products for purchase by your users.

Purchases Profile

Every time a purchase of a product is made on a BowTie site, a purchase profile associated with that product will appear in their User Profile. You can set policies and restrictions based on this information, outlined in our access control section below, or through this visual user guide.

Extra Info

Charge a User through Stripe:

  bowtie.user.purchase('product_xyz', function(charge){
    // charge - https://stripe.com/docs/api#charge_object
  }, function(error){
    // error.status = "fail" || "error"
    // error.errors = { property: [message], ... }
  });

If you’ve already collected a credit card from your user for a subscription payment, you can charge the card on file by not providing a stripe_credit_card_token:

Send them a receipt:

  bowtie.user.purchase('product_xyz', {
    receipt_email: 'customer@example.com'
  }, function(charge){
    // charge - https://stripe.com/docs/api#charge_object
  }, function(error){
    // error.status = "fail" || "error"
    // error.errors = { property: [message], ... }
  });

If a User is logged in, the email associated with the User will be sent to Stripe as the receipt recipient. If you would like to override the email address used for receipts, or when there is no User logged in but you have collected an email address (such as with Stripe Checkout), you can pass the receipt_email option:

If a product requires a billing or shipping address (and you’ve selected this option in the BowTie dashboard), then you’ll need to have stripe collect and supply them back in the purchase call.

var handler = StripeCheckout.configure({
      // Add your Stripe live publishable key here.
      key: env.stripe.publishable_key,
      image: '//stripe.com/img/documentation/checkout/marketplace.png',
      locale: 'auto',
      billingAddress: true,  // Stripe will collect a billing address
      shippingAddress: true, // Stripe will collect a shipping address
      token: function(token, args) // include args to have stripe provide the address data with the token.

If the Product requires a billing address, supply billing address into the purchase call.

Include billing address:

  bowtie.user.purchase('product_xyz', {
    billing: {
      name: args.billing_name,
      address: {
        line1: args.billing_address_line1,
        city: args.billing_address_city,
        state: args.billing_address_state,
        postal_code: args.billing_address_zip,
        country: args.billing_address_country
        }
      }
  }, function(charge){
    // charge - https://stripe.com/docs/api#charge_object
  }, function(error){
    // ...
  });

And, if the Product requires a shipping address, then you’ll need to supply the shipping address, as well:

Include shipping address:

  bowtie.user.purchase('product_xyz', {
    shipping: {
      name: args.shipping_name,
      address: {
        line1: args.shipping_address_line1,
        city: args.shipping_address_city,
        state: args.shipping_address_state,
        postal_code: args.shipping_address_zip,
        country: args.shipping_address_country
      }
    }
  }, function(charge){
    // charge - https://stripe.com/docs/api#charge_object

Ensuring you have an error handler will allow you to inspect the output of errors and better debug potentially missing information.

Domains and Environments

BowTie allows you to add or map your project environments to new domains from the domains panel in your BowTie Dashboard. Once your settings are saved, our system handles SSL configuration and redirection.

Environments

Your Project was created with default environments, a Test environment for working with Users and content that may not be permanent, and a Live environment for permanent data.

Each Environment will map to your master branch, and contains some settings for how requests should be mapped to Stripe. Your domains will be mapped directly to an environment, so you can choose how you’d like to point your domains or choose to upgrade an existing domain to a new Environment.

Adding Domains

To add a new Domain, visit the Domains configuration panel by navigating to 'More’ > 'Domains’ on the left navigation menu.

Here you will see your existing domains for this Project. New projects are built with two domains, each mapped to one of the default environments (live, test).You can add as many domains as you would like, within the limits set by your plan.

To add a new domain, click on the “+ Add Domain” button, and enter the domain you would like to claim/purchase.

Hosted Domains

Entering just the name (e.g. 'example’) will search for available hosted domains.

Within the limits of your plan, you can create additional Hosted Domains and map them to branches in your default environment or a unique branch in your repository (such as a feature branch).

Custom Domains

Adding an extension to your desired name (e.g. 'example.com’, 'example.io’, etc.) will search for available custom domains for purchase.

If available, the domain price will display and you can purchase the domain immediately. All Domains purchased on the BowTie platform include SSL certification (while hosted on BowTie).

We support nearly every TLD (com, net, biz, org, info, io, etc). Please contact us if you would like to purchase a domain for a TLD we do not support, or if domain registration for the TLD requires additional information or configuration.

Attaching Domains

When you find the name you wish to purchase, enter the target branch name and attach it.

Domains can be attached to one of the existing default environments (live, test). You can create new environments and map them to feature branches in your repository, as well.

Navigate to the 'Add Domain’ interface found at 'More’ > 'Domains’, then enter the name of the environment you would like to associate your Hosted or Custom Domain, to (e.g. 'live’ or 'feature/example-feature’). If you are modifying an existing domain in the 'Edit Domain’ interface, you will need to select your environment from the dropdown.

Save your selections with the 'Attach Domain’ button. Now, BowTie will automatically handle redirects for this domain.

If you’ve already purchased a domain, you’ll be prompted during the domain installation on BowTie’s platform to configure your domain’s nameservers.

After receiving the list of nameservers from the BowTie interface, you should be able to find the nameserver configuration at your registrar. Click Resume after the nameservers are configured to continue.

We recommend using BowTie to generate and configure the SSL Certificate. Please ensure that you’ve updated your DNS and allowed some time for it to propagate before doing so though, since this is required to perform the domain verification for SSL certificate issuance.

Adding SSL Certificates

Every domain created or purchased on BowTie is served with SSL. If you’ve already purchased an SSL certificate and don’t want BowTie to configure one for you, toggle the checkbox labeled 'Use an SSL certificate I’ve already purchased’ and enter your SSL Key and SSL Certificate in the available fields.

Please use the full certificate chain when including the certificate.

To do this, toggle the checkbox labelled 'Use an SSL certificate I’ve already purchased’ and enter your SSL Key and SSL Certificate in the available fields. Please use the full certificate chain when including the certificate, and make sure you include the BEGIN and END declarations that are included in the key and certificate.

We recommend you expose your service over SSL and utilize HTTP basic authentication. A self signed SSL certificate will function for this purpose. When possible, we recommend using the IP address of the backend server.

SSL

All Project Sites on BowTie are configured to respond over 128 bit TLS with HSTS.

BowTied domains use a wildcard SSL certificate configured for https://*.bowtied.io/.

Custom Domains include a certificate for the Live Project Site. Custom subdomains are each associated with their own SSL certificate.

Please contact us about purchasing a wildcard certificate for your domain if needed.

Registrar Transfer

BowTie does not currently support automated domain transfer to our registrar. If you’d like for us to manage your domain registration for a domain that you purchased elsewhere, please contact us to configure a registrar transfer.

Access Control

User access, which includes any request to your Project Frontend and your Project Backend is filtered by a declarative file-based configuration system. The .bowtie.yml file contains configuration directives to prevent unauthorized access to users based on their login state and subscription.

Policy Precedence

Policy defined at root permits user with plan 'myplan’ only:

# .bowtie.yml
permits:
  plans: myplan

Multiple .bowtie.yml configurations may be present within a directory hierarchy. The .bowtie.yml file located closest to the destination of the request will be used to determine authorization of the request.

Consider a .bowtie.yml configuration at the root of the Project and an additional configuration in the unprotected directory.

Policy defined in the unprotected directory permits everyone:

# /unprotected/.bowtie.yml
permits:
  plans: '*'

Requests to resources under /unprotected will be permitted, while requests for other resources in the Project will fail.

An asterisk, when used with the plans key of the permits block indicates that any subscription status will be permitted access, including unsubscribed users.

User Pipeline Restrictions

Project Users can be either Visitors or Registered Users. A Visitor record is created when someone visits your site and has not yet been through the registration or sign in process.

Visitor records will be removed regularly unless a profile is associated with the record.

Profiles associated with a Visitor are automatically migrated to the permanent Registered User record when a visitor completes registration. Profile data associated with a Visitor who subsequently logs in to an existing account will remain associated with the Visitor’s User record.

You can permit access to visitors who have not registered, visitors who have registered but don’t have a plan, or fully registered users. Some examples of groups that you may want to grant access to are outlined below with their appropriate /.bowtie.yml file.

To see examples of user pipeline restrictions, read this visual user guide.

To permit only requests by visitors who have not yet registered successfully:

Permits status 'visitor’:

permits:
  status: visitor

To permit only requests by visitors who have registered (they may not have a plan):

Permits status 'registered’:

permits:
  status: registered

Combining Policy Restrictions

To permit access to a fully registered user who has also made a purchase:

permits:
  status: registered
  profile:
    purchases:
      product_000000000: true

To permit access to a fully registered user OR someone who has made a purchase:

permits:
  - status: registered

  - profile:
      purchases:
        product_000000000: true

Plan Based Restrictions

Permissions are generally tied to Stripe plan connections. The plan configuration key can be used within any permits block to restrict access to the resource based on the Stripe Plan ID.

In order to protect requests to protected_folder, for instance, and only allow requests from a User with the Stripe subscriber plan, you can add a .bowtie.yml file to the protected_folder folder in your Project:

Request Method Restrictions

Different access based on requests:

permits:
  - method: GET
    plans: '*'

  - method: POST
    plans: subscriber

To protect a resource from being accessed with a specific request method, use the method configuration key in the protects block. The following prohibits POST requests to the resource unless a User is logged in, but permits GET access:

Using an asterisk will match all request methods. Please note that if any rule in the most specific .bowtie.yml file permits the request, it will be permitted.

Profile Based Restrictions

Access granted based on User Profile attributes:

  permits:
    profile:
      features:
        videos: true
        songs: true

Resources can be protected based on data available in a User Profile.

The following only permits requests to the protected section if the current User has both the videos and songs keys of a Profile with scope features set to true.

Purchase Profile Restrictions

Example User’s Purchase Profile:

{"product_xyz123XYZ"=>
  [{"id"=>27,
    "stripe_id"=>"ch_16yVxxxxxxxxxxxxx",
    "livemode"=>false,
    "amount"=>500,
    "amount_refunded"=>0,
    "captured"=>true,
    "stripe_created_at"=>"2015-10-21 23:23:50 UTC",
    "metadata"=>
     {"product"=>"product_xyz123XYZ",
      "product_id"=>"2",
      "environment_id"=>"530"},
    "paid"=>true,
    "refunded"=>false,
    "customer"=>nil,
    "description"=>"Donation",
    "shipping"=>nil,
    "product_id"=>2,
    "user_id"=>nil,
    "created_at"=>"2015-10-21 23:23:51 UTC",
    "updated_at"=>"2015-10-21 23:23:51 UTC",
    "environment_id"=>530}]}

Access granted based on Purchase Profile attributes:

permits:
    profile:
      purchases:
        product_xyz123XYZ: true

A Purchase Profile is contained in the User’s Profile, and houses JSON made up of purchase data from Stripe and BowTie data. Policy restrictions can be made based on purchase data.

The following example only permits requests to the protected section if the current User has made a purchase on product_xyz123XYZ.

For a visual user guide on how to implement policy restrictions on purchases, read this blog post.

Path Specifier

To protect a specific resource, specify the path relative to the directory name where the .bowtie.yml file resides. The following prohibits requests to files in the /downloads based on the User’s subscription:

Access permitted based on different plans and paths:

# /downloads/.bowtie.yml

permits:
  - plans: enhanced
    path: /enhanced.zip

  - plans: pro
    path: /pro.zip

  - plans: basic
    path: /basic.zip

Limitations

Requests to /users* cannot be restricted, since resources there are required to allow Users the ability to manage the plan they’re subscribed to.

Response Behavior

Requests to non-HTML formatted resources (determined by the URL used to access the resource, not after fetching the resource) and XHR based requests will yield a 403 status code on response. Requests to HTML formatted resources that are not XHR based will either redirect to the User’s plan overview page if they are logged in, or to the sign in screen if they are not.

Backend Applications

BowTie is primarily focused on the development of your front-end customer facing content and authentication of those customers. This enables the development of an entire class of static applications without a single back-end component.

When your application’s core functionality is not simply static (a Ruby on Rails application, for instance), BowTie can manage front-end details such as authentication while forwarding requests to an HTTP endpoint exposed by your application’s server.

Request Headers

Backend request headers are used for BowTie Users, and BowTie projects.

Environment Specific Headers

For backend application development, the following are environment-specific headers that are injected into requests proxied by BowTie to your Backend Application.

Header Name
X-Bowtie-Branch The branch that content for this request is being served from on BowTie’s system.
X-Bowtie-Project A unique identifier for the Project that the user is utilizing to request content
X-Bowtie-Environment-Name 'live’ or 'test’ unless an additional environment was configured.

Webhooks

Webhooks allow your application to receive notifications when an event occurs on the BowTie platform.

BowTie will POST event details to URLs registered in the 'Settings’ > 'Webhooks’ panel of your Project Dashboard. An Event contains details such as the type of event that occurred and information about that event. An included JSON web token can be used to verify the authenticity of requests to your Webhook URL.

Each Project may have up to 5 webhooks.

Expected Response

The Webhook URL should respond to an event with an HTTP status code of 200. Any other response, including redirect statuses, will be considered failures.

If BowTie encounters a failure posting an event to the Webhook URL, we will retry the request every hour for up to three days.

Event Types

Event type
test Triggered upon request from the Webhook configuration UI from the Project Dashboard
repository.auth Describes an attempt to authorize a push to the Project repository [deprecated]
user.updated Describes a User. Triggered when a User record is updated/created.
user.session Describes a new session started by a Project User
user.profile.updated Describes a User Profile. Triggered when a User Profile is updated/created.

Polling

BowTie exposes an HTTP interface for viewing webhook events. This interface can be used to poll for events from your application, though for obvious architectural considerations we recommend you use this only for debugging purposes.

HTTP: GET /bowtie/api/actions/:event_type.json

Return up to 50 webhook events of the event_type, most recent first. You must authenticate with your Environment Secret Key (found in your BowTie dashboard under General Settings) to access this endpoint.

parameter description
page Integer value enabling pagination. No pagination markers are returned with the response though, and the events list is dynamic - use of this parameter is not generally recommended

Curl Request

curl -u environment_secret_key https://example.bowtied.io/bowtie/api/actions/user%2Eprofile%2Eupdated.json

JSON response:

[
   {
      "user_id" : 84,
      "event_id" : 12337,
      "environment" : "live",
      "environment_id" : 19,
      "user_status" : "registered",
      "data" : {
         "profile" : {
            "name" : "James",
            "stripe_email" : "james@bowtie.io"
         },
         "scope" : "private"
      },
      "event_type" : "user.profile.updated",
      "project_id" : 10,
      "response" : {}
   },
   ...
]

Error Pages

Only HTML Content-Type headers will rewrite the error content. Otherwise, the error is returned to the user as it’s returned from the backend application.

Passing an X-Prohibit-Status-Override header with the backend application response will prevent the error content from being rewritten. You can use any value, but we recommend 'true’.

Email Handling

Google Apps Email Configuration

Your BowTie project is preconfigured to use Google Apps for email. We automatically install the required MX records with every domain added to your project.

To verify ownership of your site, we recommend using the META tag method.

Note: BowTie does not directly suport the customization of MX records within the Dashboard. Contact us for assistance in setting up other custom MX records.

BowTie on Windows

Installation and Setup

We recommended the following setup for getting started qwith BowTie.io on the Windows platform. There are a number of other methods, including the GitHub Windows client, but these may require additional work or more intensive configuration. If you’d like a more visual guide, read this visual user guide about Bowtie on Windows setup.

Some existing software solutions that BowTie.io integrates with do not officially support Windows, but we’ve found that there’s not much hindrance to development once you’ve configured your environment. Please reach out to help@bowtie.io if you have any issues, or submit a Pull Request to submit any corrections.

Installing Git

  1. Download the official Git build for Windows from the GitHub Downloads Page.
  2. Run the executable file that you just downloaded to begin the Git installation process.
  3. Install with the default options (esp. Use Git from Git Bash only).

Configuring SSH Keys

  1. Click the Start Button, find the Git Bash Application, and run it.
  2. In the resulting terminal window, run $ ssh-keygen.exe
  3. Save the file the default location (%HOMEDIR%/.ssh/id_rsa).
  4. Now run $ cat %HOMEDIR%/.ssh/id_rsa.pub | clip, where %HOMEDIR% should be your user’s home directory
  5. Navigate to the BowTie.io New Account Key page and paste the clipboard contents into the “Key” field.
  6. Give your Key a Title that describes the machine you’re working from, and submit with the “Save” button.

Cloning the Repository

  1. Visit your BowTie Project Dashboard, and copy the value from the “SSH clone URL” field at the top of the page.
  2. Launch the Git Bash Application and navigate to the directory where you want your Projects to live.
  3. Run $ git clone %GITCLONEURL%, where %GITCLONEURL% is the value from the “SSH clone URL” field from step 1.
  4. If your configuration is correct, you should see Git pull down your Project contents into a directory named after your Project.

Installing Ruby

  1. Download Ruby (2.1.5 works, as of the date of this writing) from RubyInstaller.
  2. Run the Installer - make sure you “Add Ruby executables to your PATH”
  3. Download the DevKit release for the same version of Ruby you downloaded above.
  4. Extract the DevKit release into C:\RubyDevKit
  5. Run the Command Prompt with Ruby from your start menu
  6. Run cd \RubyDevKit
  7. Run $ ruby dk.rb init
  8. Run $ ruby dk.rb install
  9. Run $ gem update and confirm overwrites

The BowTie Client on Windows

  1. Run gem install bowtie-io and accept any Security Prompts.
  2. In your Project’s clone directory, edit the _config.yml file and add the line highlighter: false. Without it you’ll get blank pages served. If you figure out how to get pygments working on Windows, please let us know.
  3. Run $ bowtie serve and open http://localhost:4000/ in your web browser.

Development on Windows

All other aspects of BowTie.io development should mimic the experience and explanations described throughout our documentation.

Project HTTP API

Administration related tasks, such as programmatically updating repository contents or monitoring build status, are exposed via this HTTP API. For repository operations this API very closely follows patterns established by the GitHub API.

Expectations

Some experience with HTTP, APIs, and JSON is expected of developers reading this documentation.

Documentation Conventions

Values that you should replace before use are surrounded by curly brackets. For instance, https://example.com/{{YOURNAME}} indicates that {{YOURNAME}} should be replaced with the value for YOURNAME: “https://example.com/james”.

If a string is prefixed with a : in a URL, the string represents a parameter. The SHA of the desired blob would replace :sha in “https://api.bowtie.io/projects/:project/git/blobs/:sha”.

In a JSON response that contains repeating content (an array with a large number of entries), an ellipses may be placed within the content to indicate that more items were excluded from the full response.

Documented response data is pretty printed while actual response data may not be.

Current Version

This API is currently at V3. This is also the first public release of this API, so no versioning instructions are currently required.

Future versions will require an explicit version specification.

Backwards Compatiblity

Additional fields may be added to response during development without advancement of the API version.

Do not rely on the order of keys within a response object, or expect that the keys provided at any point will be the only keys provided in the future.

Fields will not be removed from response objects without prior notification and version advancement.

Root Endpoint

All requests for this resource are available at https://api.bowtie.io/

Authentication

Requests to this API require HTTP basic authentication. The username should be the Environment’s secret key. The password should be blank.

$ curl -u {{ENVIRONMENT_SECRET_KEY}} https://api.bowtie.io/user

JSON-P

Passing a ?callback parameter to any GET request enables JSON-P, and results in a wrapped response.

$ curl -u {{ENVIRONMENT_SECRET_KEY}} https://api.bowtie.io/status?callback=func

Response

Status: 200 OK
/**/func({"meta":{"status":200},"data":{"status":"good"}});

Ownership

Gets the object that represents the current administrative user.

Note: The total repository and owned repository count are always 1, since the authentication provided for this administrative user is only valid over the current repository.

GET /user

Response

Status: 200 OK
{
  "type": "User",
  "organizations_url": "https://api.bowtie.io/orgs",
  "repos_url": "https://api.bowtie.io/projects",
  "total_private_repos": 1,
  "owned_private_repos": 1
}

Organizations

Gets the list of organizations the current administrative user is a member of.

Note: This endpoint currently returns an empty array.

GET /orgs

Response

Status: 200 OK
[]

Projects

List Projects

List projects that are accessible by the current administrative user.

Note: This endpoint currently returns the single project the secret key authenticates against.

GET /projects

Response

[
   {
      "name" : "test2",
      "homepage" : "https://bowtie.io",
      "created_at" : "2015-12-31T00:32:40Z",
      "updated_at" : "2016-01-06T21:22:15Z",
      "url" : "https://api.bowtie.io/projects/test2",
      "contents_url" : "https://api.bowtie.io/projects/test2/contents/{+path}",
      "trees_url" : "https://api.bowtie.io/projects/test2/git/trees{/sha}",
      "blobs_url" : "https://api.bowtie.io/projects/test2/git/blobs{/sha}",
      "owner" : {
         "login" : "james@bowtie.io"
      },
      "permissions" : {
         "push" : true,
         "admin" : true,
         "pull" : true
      },
      "id" : "test2",
      "full_name" : "test2",
      "default_branch" : "master",
      "private" : true
   }
]

Project Detail

GET /projects/:project

Response

{
   "name" : "test2",
   "homepage" : "https://bowtie.io",
   "created_at" : "2015-12-31T00:32:40Z",
   "updated_at" : "2016-01-06T21:22:15Z",
   "url" : "https://api.bowtie.io/projects/test2",
   "contents_url" : "https://api.bowtie.io/projects/test2/contents/{+path}",
   "trees_url" : "https://api.bowtie.io/projects/test2/git/trees{/sha}",
   "blobs_url" : "https://api.bowtie.io/projects/test2/git/blobs{/sha}",
   "owner" : {
      "login" : "james@bowtie.io"
   },
   "permissions" : {
      "pull" : true,
      "admin" : true,
      "push" : true
   },
   "id" : "test2",
   "full_name" : "test2",
   "default_branch" : "master",
   "private" : true
}

Contents

Contents of a File

GET /projects/:project/contents/:path

Parameters

Name Description
path The content path.

Response

200 OK
{
   "url" : "https://api.bowtie.io/projects/test2/contents/simple.md",
   "path" : "simple.md",
   "encoding" : "base64",
   "content" : "IyBFeGFtcGxlCgpMb3JlbSBpcHN1bSBkb2xvciBzaXQgYW1ldCwgY29uc2Vj\ndGV0dXIgYWRpcGlzY2luZyBlbGl0LiBEdWlzIHZlbCByaXN1cyBldCBhdWd1\nZQp2dWxwdXRhdGUgaWFjdWxpcyBhYyBhdCBsaWJlcm8uIFV0IGV1IG9yY2kg\ndXQgZHVpIGdyYXZpZGEgdm9sdXRwYXQgZXUgc2VkCm1hdXJpcy4gUHJvaW4g\ndGVsbHVzIG1hdXJpcywgc29kYWxlcyBhYyBsaWd1bGEgZWdldCwgYWNjdW1z\nYW4gbWF0dGlzIHJpc3VzLiBJbgpzZWQgZmFjaWxpc2lzIGF1Z3VlLiBNYWVj\nZW5hcyBub24ganVzdG8gcmhvbmN1cywgdGluY2lkdW50IGxhY3VzIGV1LCBj\nb25ndWUKbGVjdHVzLiBVdCBub24gZnJpbmdpbGxhIG5pc2ksIGF0IHNlbXBl\nciB1cm5hLiBBZW5lYW4gYWMgZWdlc3RhcyBkaWFtLiBQcm9pbiBhYwp2b2x1\ndHBhdCBlc3QuIFV0IGV0IGxhY3VzIGVnZXQgbG9yZW0gdWxsYW1jb3JwZXIg\nY29udmFsbGlzIGlkIHZpdGFlIGVyb3MuIEFlbmVhbgpiaWJlbmR1bSBzaXQg\nYW1ldCBsYWN1cyBzZWQgdmVoaWN1bGEuIFByYWVzZW50IG9yY2kgdXJuYSwg\nbWFsZXN1YWRhIGluIHRlbGx1cwppbiwgY29tbW9kbyB0aW5jaWR1bnQgZW5p\nbS4gRHVpcyBpbnRlcmR1bSBlc3QgbWFzc2EsIHF1aXMgbGFvcmVldCBhdWd1\nZSB2ZWhpY3VsYQp1dC4gRG9uZWMgdXQgaXBzdW0gaXBzdW0uIFByb2luIGFj\nIG5lcXVlIGV0IGxpZ3VsYSBlbGVtZW50dW0gYmliZW5kdW0gZWdldAp2YXJp\ndXMgZGlhbS4K\n",
   "sha" : "2b9e0990c8841097fdf5a31228a92d5fb42d6aea",
   "type" : "file",
   "size" : 729,
   "name" : "simple.md"
}

Contents of a Directory

GET /projects/:project/contents/:path

Parameters

Name Description
path The content path.

Response

200 OK
[
   {
      "type" : "dir",
      "path" : "dir/manyfiles",
      "name" : "manyfiles",
      "url" : "https://api.bowtie.io/projects/test2/contents/dir/manyfiles",
      "sha" : "cff39c986049e140d91d399b08525e4834c13654",
      "size" : 0
   },
   ...
   {
      "url" : "https://api.bowtie.io/projects/test2/contents/dir/symlink-small.png",
      "sha" : "19b0438ee69ddeed0857275cd14ac85ce35153fd",
      "size" : 12,
      "type" : "file",
      "path" : "dir/symlink-small.png",
      "name" : "symlink-small.png"
   }
]

Creating a File

PUT /projects/:project/contents/:path

Parameters

Name Description
path required The content path.
message required Commit message.
content required Base64 encoded content.
committer Contains name and email of committer
author Contains name and email of author
build default: true. Should this commit trigger a new build?

Note: If the committer is not specified, the BowTie tailor committer information will be used. If the author is not specified, the value used for the committer will be used for the author.

Response

201 Created
{
   "content" : {
      "encoding" : "base64",
      "size" : 28,
      "content" : "V293LCB5b3UgY2FuIGRlY29kZSBCYXNlNjQhCg==",
      "sha" : "3e057a3ef8657ac247b7e17d7bd21045d32b9acb",
      "path" : "filename.txt",
      "name" : "filename.txt",
      "type" : "file"
   },
   "commit" : {
      "sha" : "1ecee5a29538c516f7b341362250b6040b002e88",
      "tree" : {
         "sha" : "bb9f31c7a8185d6161e7df461a86c723a3fab9d6"
      },
      "committer" : {
         "date" : "2016-01-20T17:05:30.000-07:00",
         "name" : "Tailor",
         "email" : "tailor@bowtie.io"
      },
      "message" : "Commit message",
      "parents" : [
         {
            "sha" : "3fb519de7803bd8f82b29e8c9283890647c06e43"
         }
      ],
      "author" : {
         "email" : "tailor@bowtie.io",
         "name" : "Tailor",
         "date" : "2016-01-20T17:05:30.000-07:00"
      }
   },
   "task": {
      "name" : "Tasks/Branch Build Task",
      "status" : "running",
      "messages" : [],
      "url" : "https://api.bowtie.io/tasks/1b90f1f5d5-1545106991.json",
      "count" : {
         "pending" : 7,
         "failed": 0,
         "waiting": 0,
         "completed": 0
      }
   }
}

Updating a File

PUT /projects/:project/contents/:path

Parameters

Name Description
path required The content path.
message required Commit message.
content required Base64 encoded content.
sha required The blob SHA being replaced.
committer Contains name and email of committer
author Contains name and email of author
build default: true. Should this commit trigger a new build?

Note: If the committer is not specified, the BowTie tailor committer information will be used. If the author is not specified, the value used for the committer will be used for the author.

Response

200 OK
{
   "content" : {
      "encoding" : "base64",
      "sha" : "1d8ea01ab7bc123399cecafbae8765e3f733188d",
      "size" : 31,
      "type" : "file",
      "content" : "SG93IG11Y2ggZnJlZSB0aW1lIGRvIHlvdSBoYXZlPw==\n",
      "path" : "filename.txt",
      "name" : "filename.txt"
   },
   "commit" : {
      "committer" : {
         "name" : "Tailor",
         "email" : "tailor@bowtie.io",
         "date" : "2016-01-20T17:09:08.000-07:00"
      },
      "tree" : {
         "sha" : "e5cd27911dc57e3f85a88c4c355ddf491f3fc83b"
      },
      "author" : {
         "name" : "Tailor",
         "email" : "tailor@bowtie.io",
         "date" : "2016-01-20T17:09:08.000-07:00"
      },
      "parents" : [
         {
            "sha" : "1ecee5a29538c516f7b341362250b6040b002e88"
         }
      ],
      "message" : "Update message",
      "sha" : "cab52b412d0ffc0098c48d288e7c80dddc30dfc7"
   },
   "task": {
      "name" : "Tasks/Branch Build Task",
      "status" : "running",
      "messages" : [],
      "url" : "https://api.bowtie.io/tasks/1b90f1f5d5-1545106991.json",
      "count" : {
         "pending" : 7,
         "failed": 0,
         "waiting": 0,
         "completed": 0
      }
   }
}

Deleting a File

DELETE /projects/:project/contents/:path
Name Description
path required The content path.
message required Commit message.
content required Base64 encoded content.
sha required The blob SHA being replaced.
committer Contains name and email of committer
author Contains name and email of author
build default: true. Should this commit trigger a new build?

Note: If the committer is not specified, the BowTie tailor committer information will be used. If the author is not specified, the value used for the committer will be used for the author.

Response

200 OK
{
   "content" : null,
   "commit" : {
      "tree" : {
         "sha" : "4533d4ea9bd9cb0b9aa30ff18ac57c952fd44633"
      },
      "parents" : [
         {
            "sha" : "cab52b412d0ffc0098c48d288e7c80dddc30dfc7"
         }
      ],
      "committer" : {
         "name" : "Tailor",
         "date" : "2016-01-20T17:10:08.000-07:00",
         "email" : "tailor@bowtie.io"
      },
      "message" : "Deleted filename.txt",
      "author" : {
         "name" : "Tailor",
         "email" : "tailor@bowtie.io",
         "date" : "2016-01-20T17:10:08.000-07:00"
      },
      "sha" : "bb4fa3f561aecba8b6e80bd5df120df132edb9dc"
   },
   "task": {
      "name" : "Tasks/Branch Build Task",
      "status" : "running",
      "messages" : [],
      "url" : "https://api.bowtie.io/tasks/1b90f1f5d5-1545106991.json",
      "count" : {
         "pending" : 7,
         "failed": 0,
         "waiting": 0,
         "completed": 0
      }
   }
}

Branches

GET /projects/:project/branches

Response

Status: 200 OK
[
   {
      "commit" : {
         "sha" : "871f54d837ad7ce63f4948086e9ab25b994bddcd",
         "url" : "https://api.bowtie.io/projects/test2/commits/871f54d837ad7ce63f4948086e9ab25b994bddcd"
      },
      "name" : "master"
   }
]

Commits

List Commits

GET /projects/:project/commits

Parameters

Name Description
sha Walk the commit hierarchy starting at this SHA. Defaults to master.
path Limit commits to those containing this path.

Response

200 OK
[
   {
      "sha" : "74d4214794d676942717b6bd2467f7896af87fa9",
      "url" : "https://api.bowtie.io/projects/test2/commits/74d4214794d676942717b6bd2467f7896af87fa9",
      "commit" : {
         "url" : "https://api.bowtie.io/projects/test2/git/commits/74d4214794d676942717b6bd2467f7896af87fa9",
         "tree" : {
            "url" : "https://api.bowtie.io/projects/test2/git/trees/c002e58c5789f262a7dc55a5830f6c2f0b003cf3",
            "sha" : "c002e58c5789f262a7dc55a5830f6c2f0b003cf3"
         },
         "committer" : {
            "name" : "James Kassemi",
            "date" : "2016-01-14T21:52:30Z",
            "email" : "jkassemi@gmail.com"
         },
         "message" : "Tmp\n",
         "author" : {
            "date" : "2016-01-14T21:52:15Z",
            "email" : "jkassemi@gmail.com",
            "name" : "James Kassemi"
         }
      },
      "author" : {},
      "committer" : {},
      "parents" : [
         {
            "url" : "https://api.bowtie.io/projects/test2/git/commits/5b16b94100d3b5a82bf9dfaa08bbe4aaa3079d22",
            "sha" : "5b16b94100d3b5a82bf9dfaa08bbe4aaa3079d22"
         }
      ]
   },
   ...
   {
      "sha" : "de9550a92893ee356cf03b8ea79b126c429c5019",
      "url" : "https://api.bowtie.io/projects/test2/commits/de9550a92893ee356cf03b8ea79b126c429c5019",
      "commit" : {
         "url" : "https://api.bowtie.io/projects/test2/git/commits/de9550a92893ee356cf03b8ea79b126c429c5019",
         "tree" : {
            "url" : "https://api.bowtie.io/projects/test2/git/trees/36b27a6ceda2d191e926024f21b9e8e719d3ad9e",
            "sha" : "36b27a6ceda2d191e926024f21b9e8e719d3ad9e"
         },
         "committer" : {
            "name" : "James Kassemi",
            "date" : "2016-01-04T03:57:22Z",
            "email" : "jkassemi@gmail.com"
         },
         "message" : "Initial commit\n",
         "author" : {
            "name" : "James Kassemi",
            "email" : "jkassemi@gmail.com",
            "date" : "2016-01-04T03:57:22Z"
         }
      },
      "author" : {},
      "committer" : {},
      "parents" : []
   }
]

Commit Details

GET /projects/:project/commits/:sha

Response

200 OK
{
   "sha" : "871f54d837ad7ce63f4948086e9ab25b994bddcd",
   "url" : "https://api.bowtie.io/projects/test2/commits/871f54d837ad7ce63f4948086e9ab25b994bddcd",
   "parents" : [
      {
         "url" : "https://api.bowtie.io/projects/test2/git/commits/74d4214794d676942717b6bd2467f7896af87fa9",
         "sha" : "74d4214794d676942717b6bd2467f7896af87fa9"
      }
   ],
   "commit" : {
      "committer" : {
         "name" : "James Kassemi",
         "email" : "jkassemi@gmail.com",
         "date" : "2016-01-20T22:39:39Z"
      },
      "tree" : {
         "url" : "https://api.bowtie.io/projects/test2/git/trees/0ae998f559b4dec08aebffa952ed28162b8bc303",
         "sha" : "0ae998f559b4dec08aebffa952ed28162b8bc303"
      },
      "author" : {
         "date" : "2016-01-20T22:39:39Z",
         "email" : "jkassemi@gmail.com",
         "name" : "James Kassemi"
      },
      "message" : "Changes simple.html\n",
      "url" : "https://api.bowtie.io/projects/test2/git/commits/871f54d837ad7ce63f4948086e9ab25b994bddcd"
   },
   "files" : [
      {
         "deletions" : 2,
         "blob_url" : "https://api.bowtie.io/projects/test2/git/blobs/2628a1f38bd870780340adbc8b17f8af79d21cec",
         "status" : "modified",
         "changes" : 2,
         "additions" : 0,
         "filename" : "simple.html"
      }
   ],
   "author" : {},
   "committer" : {},
   "stats" : {
      "additions" : 0,
      "changes" : 2,
      "deletions" : 2
   }
}

Git Trees

Tree Details

GET /projects/:project/git/trees/c002e58c5789f262a7dc55a5830f6c2f0b003cf3

Note: If truncated is true then you should perform this operation on a local repository for full tree details.

Note: The size property of each tree entry may be zero or null depending on current system performance.

Response

Status: 200 OK
{
   "url" : "https://api.bowtie.io/projects/:project/git/trees/:sha",
   "truncated" : false,
   "tree" : [
      {
         "url" : "https://api.bowtie.io/projects/sample-repository/git/blobs/4cd60ccd8dd1f8c7c3245964dc0b1ac7effe7dae",
         "size" : 0,
         "path" : ".gitmodules",
         "mode" : "100644",
         "type" : "blob",
         "sha" : "4cd60ccd8dd1f8c7c3245964dc0b1ac7effe7dae"
      },
      {
         "sha" : "0ff96456ba5fd118a4f14050cbc39fe742ebc58e",
         "type" : null,
         "mode" : "160000",
         "size" : null,
         "path" : "bowtie-io",
         "url" : "https://api.bowtie.io/projects/sample-repository/git/blobs/0ff96456ba5fd118a4f14050cbc39fe742ebc58e"
      },
      ...
      {
         "url" : "https://api.bowtie.io/projects/sample-repository/git/blobs/cf1e531988e831555b5865d6549d50815ce64c59",
         "size" : 0,
         "mode" : "100644",
         "path" : "tarball",
         "type" : "blob",
         "sha" : "cf1e531988e831555b5865d6549d50815ce64c59"
      }
   ],
   "sha" : "c002e58c5789f262a7dc55a5830f6c2f0b003cf3"
}

Tree Details (Recursive)

Recurse into entries of type ‘tree’.

Note: If truncated is ture then you should perform this operation on a local repository for full tree details.

Note: The size property of each tree entry may be zero or null depending on current system performance.

GET /projects/:project/git/trees/:sha?recursive=1

Response

Status: 200 OK
{
   "tree" : [
      {
         "sha" : "cff39c986049e140d91d399b08525e4834c13654",
         "mode" : "040000",
         "url" : "https://api.bowtie.io/projects/test2/git/trees/cff39c986049e140d91d399b08525e4834c13654",
         "type" : "tree",
         "path" : "manyfiles"
      },
      {
         "path" : "manyfiles/0012e4f1dc0e5920644dc5eed874ce6baa7e25d7.md",
         "type" : "blob",
         "url" : "https://api.bowtie.io/projects/test2/git/blobs/5cc1348497afbd1b8a2b0bea4d15666413a2dcab",
         "size" : 0,
         "mode" : "100644",
         "sha" : "5cc1348497afbd1b8a2b0bea4d15666413a2dcab"
      },
      {
         "sha" : "b2786cdcdc01d7ec1c11b9d3bcfb793bf3a81643",
         "mode" : "100644",
         "url" : "https://api.bowtie.io/projects/test2/git/blobs/b2786cdcdc01d7ec1c11b9d3bcfb793bf3a81643",
         "size" : 0,
         "type" : "blob",
         "path" : "manyfiles/0026476a20bfbd08714155bb66f0b4feb2d25c1c.md"
      },
      ...
      {
         "mode" : "100644",
         "sha" : "b6fdfc3c05ab5626fdf5d37f39e35706f4f4a7fa",
         "url" : "https://api.bowtie.io/projects/test2/git/blobs/b6fdfc3c05ab5626fdf5d37f39e35706f4f4a7fa",
         "size" : 0,
         "type" : "blob",
         "path" : "manyfiles/80cc9feae5756e54abd79a88f8a4e233160b5674.md"
      }
   ],
   "url" : "https://api.bowtie.io/projects/test2/git/trees/fe8dfabd8a474e3dc1c21260944c7205d9ba3079",
   "truncated" : true,
   "sha" : "fe8dfabd8a474e3dc1c21260944c7205d9ba3079"
}

Git Blobs

Blob Details

GET /projects/:project/git/blobs/:sha

Note: content is strict Base64 encoded (See ruby’s Base64.strict_encode64 method).

Response

Status: 200 OK
{
   "content" : "IyBFeGFtcGxlCgpMb3JlbSBpcHN1bSBkb2xvciBzaXQgYW1ldCwgY29uc2VjdGV0dXIgYWRpcGlzY2luZyBlbGl0LiBEdWlzIHZlbCByaXN1cyBldCBhdWd1ZQp2dWxwdXRhdGUgaWFjdWxpcyBhYyBhdCBsaWJlcm8uIFV0IGV1IG9yY2kgdXQgZHVpIGdyYXZpZGEgdm9sdXRwYXQgZXUgc2VkCm1hdXJpcy4gUHJvaW4gdGVsbHVzIG1hdXJpcywgc29kYWxlcyBhYyBsaWd1bGEgZWdldCwgYWNjdW1zYW4gbWF0dGlzIHJpc3VzLiBJbgpzZWQgZmFjaWxpc2lzIGF1Z3VlLiBNYWVjZW5hcyBub24ganVzdG8gcmhvbmN1cywgdGluY2lkdW50IGxhY3VzIGV1LCBjb25ndWUKbGVjdHVzLiBVdCBub24gZnJpbmdpbGxhIG5pc2ksIGF0IHNlbXBlciB1cm5hLiBBZW5lYW4gYWMgZWdlc3RhcyBkaWFtLiBQcm9pbiBhYwp2b2x1dHBhdCBlc3QuIFV0IGV0IGxhY3VzIGVnZXQgbG9yZW0gdWxsYW1jb3JwZXIgY29udmFsbGlzIGlkIHZpdGFlIGVyb3MuIEFlbmVhbgpiaWJlbmR1bSBzaXQgYW1ldCBsYWN1cyBzZWQgdmVoaWN1bGEuIFByYWVzZW50IG9yY2kgdXJuYSwgbWFsZXN1YWRhIGluIHRlbGx1cwppbiwgY29tbW9kbyB0aW5jaWR1bnQgZW5pbS4gRHVpcyBpbnRlcmR1bSBlc3QgbWFzc2EsIHF1aXMgbGFvcmVldCBhdWd1ZSB2ZWhpY3VsYQp1dC4gRG9uZWMgdXQgaXBzdW0gaXBzdW0uIFByb2luIGFjIG5lcXVlIGV0IGxpZ3VsYSBlbGVtZW50dW0gYmliZW5kdW0gZWdldAp2YXJpdXMgZGlhbS4K",
   "size" : 729,
   "encoding" : "base64",
   "sha" : "2b9e0990c8841097fdf5a31228a92d5fb42d6aea",
   "url" : "https://api.bowtie.io/projects/test2/git/blobs/2b9e0990c8841097fdf5a31228a92d5fb42d6aea"
}

Raw Content

GET /projects/:project/git/blobs/:sha
Accept: application/vnd.bowtie.v3.raw

Note: The content type may alternately be application/vnd.github.v3.raw. This is provided for compatibility with some applications built toward GitHub’s API.

Response

Status: 200 OK
# Example

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis vel risus et augue
vulputate iaculis ac at libero. Ut eu orci ut dui gravida volutpat eu sed
mauris. Proin tellus mauris, sodales ac ligula eget, accumsan mattis risus. In
sed facilisis augue. Maecenas non justo rhoncus, tincidunt lacus eu, congue
lectus. Ut non fringilla nisi, at semper urna. Aenean ac egestas diam. Proin ac
volutpat est. Ut et lacus eget lorem ullamcorper convallis id vitae eros. Aenean
bibendum sit amet lacus sed vehicula. Praesent orci urna, malesuada in tellus
in, commodo tincidunt enim. Duis interdum est massa, quis laoreet augue vehicula
ut. Donec ut ipsum ipsum. Proin ac neque et ligula elementum bibendum eget
varius diam.

Status

GET /status

Response

Status: 200 OK
{
   "status" : "good"
}

Tasks

GET /tasks/:task

Response

{
   "task" : {
      "name" : "Build",
      "status" : "completed",
      "url" : "https://api.dev.bowtie.io/tasks/2f90f25d01-1454104132.json",
      "messages" : []
      "count" : {
         "completed" : 7,
         "failed" : 0,
         "waiting" : 0,
         "pending" : 0
      }
   },
   "progress" : [
      {
         "name" : "Extract Snapshot",
         "status" : "completed",
         "messages" : [],
         "count" : {
            "completed" : 1,
            "failed" : 0,
            "waiting" : 0,
            "pending" : 0
         }
      },
      ...
      {
         "name" : "Expire Cache",
         "status" : "completed",
         "messages" : [],
         "count" : {
            "completed" : 1,
            "failed" : 0,
            "waiting" : 0,
            "pending" : 0
         }
      }
   ]
}

Release Notes

BowTie developers are continuously shipping new code, but will always attempt to maintain backwards compatibility unless otherwise stated.

Major updates and release notes are provided below.

11/15/2014 MVP Release

This is the first semi-public release of the BowTie platform. Access by invitation only.

release snapshot 11-15-14

1/31/2015 Release

This is an update to the semi-public relase of the BowTie platform. Access remains by invitation only.

release snapshot 1-31-2015

3/15/2015 Release

This is an update to the semi-public release of the BowTie platform. Access remains by invitation only.

release snapshot 3-15-2015

6/15/2015 Release

Internal improvements to our backend storage system, publishing performance, and minor bug fixes. Access remains by invitation only.

6/18/2015 Release

6/25/2015 Release

8/10/2015 Release

10/29/2015 Release

11/18/2015 Release

12/08/2015 Release

This is the first public release of the BowTie platform. Public access to anyone.

release snapshot 12-08-15

01/06/2015 Release

System Status

System and component status is provided by the BowTie status page at http://status.bowtie.io/. Our automated monitoring system triggers incidents and we’ll announce maintenance windows and availability issues here.