Skip to content
This repository was archived by the owner on Oct 1, 2020. It is now read-only.

Public API

Stephen Yeargin edited this page Jul 22, 2016 · 2 revisions

This document outlines the endpoints for a public API. While called "public", the creation of new applications may be restricted for some time to either internal projects (a mobile app) or partner integrations (their web or mobile app).

Authentication

The process begins with the developer registering an application. This will generate a client_id and client_secret to begin the OAuth 2.0 workflow. A third parameter, redirect_uri, will be saved with the name of the application.

Authorization Code

The first step is to retrieve the Authorization Code by going through the approval workflow.

GET https://www.myseatshare.com/oauth/authorization?client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URI&response_type=code

You will be prompted to login and approve the application if you have not already. Afterward, this will return you to the redirect_uri with a code appended to it.

From that page, you will make a second call to get the Access Token

Access Token

GET https://www.myseatshare.com/oauth/token?client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET&code=RETURNED_CODE&grant_type=authorization_code&redirect_uri=YOUR_REDIRECT_URI

This will respond with JSON data similar to the below:

{
 "access_token": "de6780bc506a0446309bd9362820ba8aed28aa506c71eedbe1c5c4f9dd350e54",
 "token_type": "bearer"
}

Signing Requests

The access_token can now be used to sign requests against the API for a particular user context.

* Connected to www.myseatshare.com (74.207.226.100) port 443 (#0)
> GET /api/v1/some-endpoint HTTP/1.1
> Host: www.myseatshare.com
> Authorization: bearer de6780bc506a0446309bd9362820ba8aed28aa506c71eedbe1c5c4f9dd350e54;

REST Endpoints

Users

List all users

Restricted to users that are mutual members of your groups.

GET /api/v1/users

List users in a particular group

Restricted to your groups.

GET /api/v1/users?group_id=:id

Retrieve your user record

GET /api/v1/users/me

Update your user record

PUT /api/v1/users/me

Retrieve a user

Restricted to users that are mutual members of your groups.

GET /api/v1/users/:id

User Aliases

List all user aliases

Restricted to users that are mutual members of your groups.

GET /api/v1/user_aliases

Create a new user alias

Restricted to only create user aliases for yourself.

POST /api/v1/user_aliases

Retrieve a user alias

Restricted to you and users that are mutual members of your groups.

GET /api/v1/user_aliases/:id

Update a user alias

Restricted to your user aliases.

PUT /api/v1/user_aliases/:id

Delete a user alias

Restricted to your user aliases.

DELETE /api/v1/user_aliases/:id

Groups

List all groups

Restricted to groups of which you are a member or administrator.

GET /api/v1/groups

Retrieve a group

Restricted to groups of which you are a member or administrator.

GET /api/v1/groups/:id

Update a group

Restricted to groups of which you are an administrator.

PUT /api/v1/groups/:id

Event Information

List all events

Restricted to events in groups of which you are a member.

GET /api/v1/events

List past events

Restricted to events in groups of which you are a member.

GET /api/v1/events?show=past

List future events

Restricted to events in groups of which you are a member.

GET /api/v1/events?show=future

Retrieve an event

Restricted to events in groups of which you are a member.

GET /api/v1/events?group_id=:id

Tickets

List all tickets

Restricted to tickets in groups of which you are a member.

GET /api/v1/tickets

List owned tickets

Restricted to tickets that you created (own).

GET /api/v1/tickets?owner=me

List assigned tickets

Restricted to tickets that are assigned to you.

GET /api/v1/tickets?assignee=me

List tickets from past events

Restricted to tickets you own or are assigned.

GET /api/v1/tickets?show=past

List tickets for future events

Restricted to tickets you own or are assigned.

GET /api/v1/tickets?show=future

List tickets for a group

Restricted to groups of which you are a member.

GET /api/v1/tickets?group_id=:id

List tickets for an event

Restricted to tickets for events in groups of which you are a member.

GET /api/v1/tickets?event_id=:id

Retrieve a ticket

Restricted to tickets for events in groups of which you are a member.

GET /api/v1/ticket/:id

Update a ticket

Restricted to tickets you own or are assigned.

PUT /api/v1/ticket/:id

Delete a ticket

Restricted to tickets you own or are assigned.

DELETE /api/v1/ticket/:id

Errors

The API may return an error object such as the one below. You can rely on either the contents of the response or the returned HTTP status code.

{
  "error": "Not Found",
  "error_detail": "The record you requested could not be found.",
  "code": 404
}

Below is an explanation of the potential error codes:

Code Message Explanation
400 Bad Request The posted data or query provided does not pass our validation. See documentation for expected format
401 Unauthorized Your authentication token is invalid or has expired.
404 Not Found The record you requested could not be found.
403 Forbidden You are authorized, but attempting to access or change a record that you cannot.
500 Internal Server Error Your request caused an error in our API. This caused an alert, and we will look into fixing it. Please contact support.
503 Service Unavailable The API wasn't able to fulfill your request because of an outage. Please contact support.
Clone this wiki locally