Authentication & Getting Started

This page will help you start making requests to the YGB API.

Requesting an API Key

To use the YGB API, you will need to request an API key. Please reach out to [email protected] and a member of the team will be able to generate you a key. You will need to have a live, configured venue before you can be issued an API key.

When requesting an API key, please provide details of the user the key will be for. When generating a key we must have it associated with a user.

We generally recommend having a user specifically for API requests. For example you might create a user [email protected].

Any API key will look something like this:

> ak1_y24xMhYRdMXA09nMI53NtiTgCSB8HK5gEMeulz49sdJYUWRIZp

It is a series of random alphanumeric characters, and will start with the prefix "ak1_".


Endpoints

YGB does not currently have regional API servers. All HTTPS API requests should be made to api.yourgolfbooking.com. If this changes and we add more endpoints, we will proactively reach out to venues to make them aware.

YGB does not support insecure requests to its API servers, so when specifying a protocol it will always be HTTPS.

The only exception to the above is if you make requests to any of YGB's local applications. These local applications running on your own network do not normally require a secure connection and can be accessed with HTTP.


Authenticating Requests

When making requests to endpoints that require authentication, you must pass an "X-API-KEY" header. The value of the header will be your API key.

Here's an example using Javascript's axios library:

const axios = require("axios");

const response = await axios.get("https://api.yourgolfbooking.com/users/me", {
	headers: {
  	"x-api-key": "ak1_y24xMhYRdMXA09nMI53NtiTgCSB8HK5gEMeulz49sdJYUWRIZp"
  }
});

GET /users/me HTTP/1.1
Host: api.yourgolfbooking.com
Accept: application/json
X-Api-Key: ak1_y24xMhYRdMXA09nMI53NtiTgCSB8HK5gEMeulz49sdJYUWRIZp