Skip to content

Instantly share code, notes, and snippets.

@shankie-codes
Created September 26, 2017 15:24
Show Gist options
  • Save shankie-codes/0213468e656e121cf88c9f76003dda26 to your computer and use it in GitHub Desktop.
Save shankie-codes/0213468e656e121cf88c9f76003dda26 to your computer and use it in GitHub Desktop.
{
"swagger": "2.0",
"info": {
"version": "0.0.1",
"title": "Artist Advance API"
},
"securityDefinitions": {
"auth0": {
"type": "oauth2",
"flow": "implicit",
"authorizationUrl": "https://artist-advance.eu.auth0.com/authorize",
"scopes": {
"openid": "Grants openID access"
}
}
},
"host": "localhost:8000",
"basePath": "/api/v1",
"schemes": [
"http",
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/events/{id}": {
"get": {
"operationId": "getEvent",
"x-swagger-router-controller": "event.controller",
"description": "Get a single event by ID",
"parameters": [
{
"name": "id",
"type": "string",
"in": "path",
"required": true,
"description": "ID of event to fetch"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"allOf": [
{
"type": "object",
"description": "Time and ID fields for new objects. Not modelled directly in Mongoose, comes from a combination of the built-in id/_id field, along with the { timestamps: true } option",
"properties": {
"id": {
"type": "string",
"description": "System-generated ID of the object"
},
"createdAt": {
"type": "string",
"format": "date-time",
"description": "Date-time that entry was added, in ISO-8601 format"
},
"updatedAt": {
"type": "string",
"format": "date-time",
"description": "Date-time that entry was updated, in ISO-8601 format"
}
}
},
{
"type": "object",
"required": [
"name",
"start_date",
"end_date",
"act_submission_deadline"
],
"properties": {
"name": {
"type": "string",
"description": "Name of the event",
"example": "Glaston-barry 2018"
},
"start_date": {
"type": "string",
"format": "date-time",
"example": "1985-04-12T23:20:50.52Z"
},
"end_date": {
"type": "string",
"format": "date-time",
"example": "1985-04-12T23:20:50.52Z",
"description": "End date of the event. By default, requests only return current and future events"
},
"act_submission_deadline": {
"type": "string",
"format": "date-time",
"example": "1985-04-12T23:20:50.52Z",
"description": "Certain fields on the acts on this event will be locked after this date"
},
"event_administrators": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "ID of the user",
"example": "ILZ0Oz1OiH91tEyzBh"
},
"name": {
"type": "string",
"description": "User's full name",
"example": "Bobby Tables"
},
"avatarUrl": {
"type": "string",
"description": "URI for the user's avatar",
"example": "https://imgs.xkcd.com/comics/exploits_of_a_mom.png"
},
"email": {
"type": "string",
"description": "Users's email address",
"example": "bobby@tables.com"
}
}
}
},
"stages": {
"type": "array",
"description": "A list of stages at the event",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of the stage",
"example": "Pyramid Stage"
},
"attachments": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "A filename. Either user-entered or generated.",
"example": "my-really-usefule-file.pdf"
},
"url": {
"type": "string",
"description": "URL where the file is available. TBC where these are served from!",
"example": "https://myfile.com/my-really-usefule-file.pdf"
}
}
},
"description": "Attachments for a particular stage"
}
}
}
},
"attachments": {
"description": "Event attachments",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "A filename. Either user-entered or generated.",
"example": "my-really-usefule-file.pdf"
},
"url": {
"type": "string",
"description": "URL where the file is available. TBC where these are served from!",
"example": "https://myfile.com/my-really-usefule-file.pdf"
}
}
},
"guest_rules": {
"type": "string",
"description": "Free text field to describe guest rules",
"example": "You're allowed to bring guests (each act will be assigned an allocation), but you have to donate £5 to Oxfam"
},
"image": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "A filename. Either user-entered or generated.",
"example": "my-really-usefule-file.pdf"
},
"url": {
"type": "string",
"description": "URL where the file is available. TBC where these are served from!",
"example": "https://myfile.com/my-really-usefule-file.pdf"
}
}
},
"form_fields": {
"type": "array",
"items": {
"type": "object",
"required": [
"field_type",
"label",
"help_text"
],
"properties": {
"field_type": {
"type": "string",
"enum": [
"text",
"textarea",
"date",
"number",
"url",
"email",
"radio_button",
"boolean"
]
},
"validation_error_message": {
"type": "string",
"description": "Text to display to the user if their input is not valid",
"example": "Please enter a date in yy/mm/dd and ensure that it's between the event start date and event end date",
"default": "Please complete this field"
},
"label": {
"type": "string",
"description": "The primary question label displayed to the user",
"example": "Act name"
},
"help_text": {
"type": "string",
"description": "Information displayed to the user about what to consider and input into this field",
"example": "Enter the name of your act as you'd like it to appear on all documentation"
},
"response": {
"description": "The response submitted by users"
}
}
}
},
"acts": {
"type": "array"
}
}
}
]
}
},
"default": {
"description": "Error",
"schema": {
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
}
}
},
"put": {
"operationId": "updateEvent",
"x-swagger-router-controller": "event.controller",
"description": "Update an event by ID. Returns a complete representation of the updated event.",
"parameters": [
{
"name": "id",
"description": "Id of the event to be updated",
"type": "string",
"in": "path",
"required": true
},
{
"name": "body",
"description": "Event properties",
"in": "body",
"required": true,
"schema": {
"type": "object",
"required": [
"name",
"start_date",
"end_date",
"act_submission_deadline"
],
"properties": {
"name": {
"type": "string",
"description": "Name of the event",
"example": "Glaston-barry 2018"
},
"start_date": {
"type": "string",
"format": "date-time",
"example": "1985-04-12T23:20:50.52Z"
},
"end_date": {
"type": "string",
"format": "date-time",
"example": "1985-04-12T23:20:50.52Z",
"description": "End date of the event. By default, requests only return current and future events"
},
"act_submission_deadline": {
"type": "string",
"format": "date-time",
"example": "1985-04-12T23:20:50.52Z",
"description": "Certain fields on the acts on this event will be locked after this date"
},
"event_administrators": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "ID of the user",
"example": "ILZ0Oz1OiH91tEyzBh"
},
"name": {
"type": "string",
"description": "User's full name",
"example": "Bobby Tables"
},
"avatarUrl": {
"type": "string",
"description": "URI for the user's avatar",
"example": "https://imgs.xkcd.com/comics/exploits_of_a_mom.png"
},
"email": {
"type": "string",
"description": "Users's email address",
"example": "bobby@tables.com"
}
}
}
},
"stages": {
"type": "array",
"description": "A list of stages at the event",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of the stage",
"example": "Pyramid Stage"
},
"attachments": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "A filename. Either user-entered or generated.",
"example": "my-really-usefule-file.pdf"
},
"url": {
"type": "string",
"description": "URL where the file is available. TBC where these are served from!",
"example": "https://myfile.com/my-really-usefule-file.pdf"
}
}
},
"description": "Attachments for a particular stage"
}
}
}
},
"attachments": {
"description": "Event attachments",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "A filename. Either user-entered or generated.",
"example": "my-really-usefule-file.pdf"
},
"url": {
"type": "string",
"description": "URL where the file is available. TBC where these are served from!",
"example": "https://myfile.com/my-really-usefule-file.pdf"
}
}
},
"guest_rules": {
"type": "string",
"description": "Free text field to describe guest rules",
"example": "You're allowed to bring guests (each act will be assigned an allocation), but you have to donate £5 to Oxfam"
},
"image": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "A filename. Either user-entered or generated.",
"example": "my-really-usefule-file.pdf"
},
"url": {
"type": "string",
"description": "URL where the file is available. TBC where these are served from!",
"example": "https://myfile.com/my-really-usefule-file.pdf"
}
}
},
"form_fields": {
"type": "array",
"items": {
"type": "object",
"required": [
"field_type",
"label",
"help_text"
],
"properties": {
"field_type": {
"type": "string",
"enum": [
"text",
"textarea",
"date",
"number",
"url",
"email",
"radio_button",
"boolean"
]
},
"validation_error_message": {
"type": "string",
"description": "Text to display to the user if their input is not valid",
"example": "Please enter a date in yy/mm/dd and ensure that it's between the event start date and event end date",
"default": "Please complete this field"
},
"label": {
"type": "string",
"description": "The primary question label displayed to the user",
"example": "Act name"
},
"help_text": {
"type": "string",
"description": "Information displayed to the user about what to consider and input into this field",
"example": "Enter the name of your act as you'd like it to appear on all documentation"
},
"response": {
"description": "The response submitted by users"
}
}
}
},
"acts": {
"type": "array"
}
}
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"allOf": [
{
"type": "object",
"description": "Time and ID fields for new objects. Not modelled directly in Mongoose, comes from a combination of the built-in id/_id field, along with the { timestamps: true } option",
"properties": {
"id": {
"type": "string",
"description": "System-generated ID of the object"
},
"createdAt": {
"type": "string",
"format": "date-time",
"description": "Date-time that entry was added, in ISO-8601 format"
},
"updatedAt": {
"type": "string",
"format": "date-time",
"description": "Date-time that entry was updated, in ISO-8601 format"
}
}
},
{
"type": "object",
"required": [
"name",
"start_date",
"end_date",
"act_submission_deadline"
],
"properties": {
"name": {
"type": "string",
"description": "Name of the event",
"example": "Glaston-barry 2018"
},
"start_date": {
"type": "string",
"format": "date-time",
"example": "1985-04-12T23:20:50.52Z"
},
"end_date": {
"type": "string",
"format": "date-time",
"example": "1985-04-12T23:20:50.52Z",
"description": "End date of the event. By default, requests only return current and future events"
},
"act_submission_deadline": {
"type": "string",
"format": "date-time",
"example": "1985-04-12T23:20:50.52Z",
"description": "Certain fields on the acts on this event will be locked after this date"
},
"event_administrators": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "ID of the user",
"example": "ILZ0Oz1OiH91tEyzBh"
},
"name": {
"type": "string",
"description": "User's full name",
"example": "Bobby Tables"
},
"avatarUrl": {
"type": "string",
"description": "URI for the user's avatar",
"example": "https://imgs.xkcd.com/comics/exploits_of_a_mom.png"
},
"email": {
"type": "string",
"description": "Users's email address",
"example": "bobby@tables.com"
}
}
}
},
"stages": {
"type": "array",
"description": "A list of stages at the event",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of the stage",
"example": "Pyramid Stage"
},
"attachments": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "A filename. Either user-entered or generated.",
"example": "my-really-usefule-file.pdf"
},
"url": {
"type": "string",
"description": "URL where the file is available. TBC where these are served from!",
"example": "https://myfile.com/my-really-usefule-file.pdf"
}
}
},
"description": "Attachments for a particular stage"
}
}
}
},
"attachments": {
"description": "Event attachments",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "A filename. Either user-entered or generated.",
"example": "my-really-usefule-file.pdf"
},
"url": {
"type": "string",
"description": "URL where the file is available. TBC where these are served from!",
"example": "https://myfile.com/my-really-usefule-file.pdf"
}
}
},
"guest_rules": {
"type": "string",
"description": "Free text field to describe guest rules",
"example": "You're allowed to bring guests (each act will be assigned an allocation), but you have to donate £5 to Oxfam"
},
"image": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "A filename. Either user-entered or generated.",
"example": "my-really-usefule-file.pdf"
},
"url": {
"type": "string",
"description": "URL where the file is available. TBC where these are served from!",
"example": "https://myfile.com/my-really-usefule-file.pdf"
}
}
},
"form_fields": {
"type": "array",
"items": {
"type": "object",
"required": [
"field_type",
"label",
"help_text"
],
"properties": {
"field_type": {
"type": "string",
"enum": [
"text",
"textarea",
"date",
"number",
"url",
"email",
"radio_button",
"boolean"
]
},
"validation_error_message": {
"type": "string",
"description": "Text to display to the user if their input is not valid",
"example": "Please enter a date in yy/mm/dd and ensure that it's between the event start date and event end date",
"default": "Please complete this field"
},
"label": {
"type": "string",
"description": "The primary question label displayed to the user",
"example": "Act name"
},
"help_text": {
"type": "string",
"description": "Information displayed to the user about what to consider and input into this field",
"example": "Enter the name of your act as you'd like it to appear on all documentation"
},
"response": {
"description": "The response submitted by users"
}
}
}
},
"acts": {
"type": "array"
}
}
}
]
}
},
"default": {
"description": "Error",
"schema": {
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
}
}
},
"delete": {
"operationId": "deleteEvent",
"x-swagger-router-controller": "event.controller",
"description": "Delete an event by ID",
"parameters": [
{
"name": "id",
"description": "Event id",
"type": "string",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "object",
"properties": {
"success": {
"type": "number",
"description": "returns 1 if successful"
},
"description": {
"type": "string",
"description": "a short comment"
}
},
"required": [
"success",
"description"
]
}
},
"default": {
"description": "Error",
"schema": {
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
}
}
}
},
"/events": {
"get": {
"operationId": "listEvents",
"x-swagger-router-controller": "event.controller",
"description": "Get all live events in the system",
"security": [
{
"auth0": [
"openid"
]
}
],
"parameters": [
{
"name": "name",
"in": "query",
"description": "Search string for name of event",
"required": false,
"type": "string"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "array",
"items": {
"allOf": [
{
"type": "object",
"description": "Time and ID fields for new objects. Not modelled directly in Mongoose, comes from a combination of the built-in id/_id field, along with the { timestamps: true } option",
"properties": {
"id": {
"type": "string",
"description": "System-generated ID of the object"
},
"createdAt": {
"type": "string",
"format": "date-time",
"description": "Date-time that entry was added, in ISO-8601 format"
},
"updatedAt": {
"type": "string",
"format": "date-time",
"description": "Date-time that entry was updated, in ISO-8601 format"
}
}
},
{
"type": "object",
"required": [
"name",
"start_date",
"end_date",
"act_submission_deadline"
],
"properties": {
"name": {
"type": "string",
"description": "Name of the event",
"example": "Glaston-barry 2018"
},
"start_date": {
"type": "string",
"format": "date-time",
"example": "1985-04-12T23:20:50.52Z"
},
"end_date": {
"type": "string",
"format": "date-time",
"example": "1985-04-12T23:20:50.52Z",
"description": "End date of the event. By default, requests only return current and future events"
},
"act_submission_deadline": {
"type": "string",
"format": "date-time",
"example": "1985-04-12T23:20:50.52Z",
"description": "Certain fields on the acts on this event will be locked after this date"
},
"event_administrators": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "ID of the user",
"example": "ILZ0Oz1OiH91tEyzBh"
},
"name": {
"type": "string",
"description": "User's full name",
"example": "Bobby Tables"
},
"avatarUrl": {
"type": "string",
"description": "URI for the user's avatar",
"example": "https://imgs.xkcd.com/comics/exploits_of_a_mom.png"
},
"email": {
"type": "string",
"description": "Users's email address",
"example": "bobby@tables.com"
}
}
}
},
"stages": {
"type": "array",
"description": "A list of stages at the event",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of the stage",
"example": "Pyramid Stage"
},
"attachments": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "A filename. Either user-entered or generated.",
"example": "my-really-usefule-file.pdf"
},
"url": {
"type": "string",
"description": "URL where the file is available. TBC where these are served from!",
"example": "https://myfile.com/my-really-usefule-file.pdf"
}
}
},
"description": "Attachments for a particular stage"
}
}
}
},
"attachments": {
"description": "Event attachments",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "A filename. Either user-entered or generated.",
"example": "my-really-usefule-file.pdf"
},
"url": {
"type": "string",
"description": "URL where the file is available. TBC where these are served from!",
"example": "https://myfile.com/my-really-usefule-file.pdf"
}
}
},
"guest_rules": {
"type": "string",
"description": "Free text field to describe guest rules",
"example": "You're allowed to bring guests (each act will be assigned an allocation), but you have to donate £5 to Oxfam"
},
"image": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "A filename. Either user-entered or generated.",
"example": "my-really-usefule-file.pdf"
},
"url": {
"type": "string",
"description": "URL where the file is available. TBC where these are served from!",
"example": "https://myfile.com/my-really-usefule-file.pdf"
}
}
},
"form_fields": {
"type": "array",
"items": {
"type": "object",
"required": [
"field_type",
"label",
"help_text"
],
"properties": {
"field_type": {
"type": "string",
"enum": [
"text",
"textarea",
"date",
"number",
"url",
"email",
"radio_button",
"boolean"
]
},
"validation_error_message": {
"type": "string",
"description": "Text to display to the user if their input is not valid",
"example": "Please enter a date in yy/mm/dd and ensure that it's between the event start date and event end date",
"default": "Please complete this field"
},
"label": {
"type": "string",
"description": "The primary question label displayed to the user",
"example": "Act name"
},
"help_text": {
"type": "string",
"description": "Information displayed to the user about what to consider and input into this field",
"example": "Enter the name of your act as you'd like it to appear on all documentation"
},
"response": {
"description": "The response submitted by users"
}
}
}
},
"acts": {
"type": "array"
}
}
}
]
}
}
},
"default": {
"description": "Error",
"schema": {
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
}
}
},
"post": {
"operationId": "addEvent",
"x-swagger-router-controller": "event.controller",
"description": "Add a new event. Returns a complete representation of the added event.",
"parameters": [
{
"name": "event",
"description": "Properties to add to the event",
"in": "body",
"required": true,
"schema": {
"type": "object",
"required": [
"name",
"start_date",
"end_date",
"act_submission_deadline"
],
"properties": {
"name": {
"type": "string",
"description": "Name of the event",
"example": "Glaston-barry 2018"
},
"start_date": {
"type": "string",
"format": "date-time",
"example": "1985-04-12T23:20:50.52Z"
},
"end_date": {
"type": "string",
"format": "date-time",
"example": "1985-04-12T23:20:50.52Z",
"description": "End date of the event. By default, requests only return current and future events"
},
"act_submission_deadline": {
"type": "string",
"format": "date-time",
"example": "1985-04-12T23:20:50.52Z",
"description": "Certain fields on the acts on this event will be locked after this date"
},
"event_administrators": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "ID of the user",
"example": "ILZ0Oz1OiH91tEyzBh"
},
"name": {
"type": "string",
"description": "User's full name",
"example": "Bobby Tables"
},
"avatarUrl": {
"type": "string",
"description": "URI for the user's avatar",
"example": "https://imgs.xkcd.com/comics/exploits_of_a_mom.png"
},
"email": {
"type": "string",
"description": "Users's email address",
"example": "bobby@tables.com"
}
}
}
},
"stages": {
"type": "array",
"description": "A list of stages at the event",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of the stage",
"example": "Pyramid Stage"
},
"attachments": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "A filename. Either user-entered or generated.",
"example": "my-really-usefule-file.pdf"
},
"url": {
"type": "string",
"description": "URL where the file is available. TBC where these are served from!",
"example": "https://myfile.com/my-really-usefule-file.pdf"
}
}
},
"description": "Attachments for a particular stage"
}
}
}
},
"attachments": {
"description": "Event attachments",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "A filename. Either user-entered or generated.",
"example": "my-really-usefule-file.pdf"
},
"url": {
"type": "string",
"description": "URL where the file is available. TBC where these are served from!",
"example": "https://myfile.com/my-really-usefule-file.pdf"
}
}
},
"guest_rules": {
"type": "string",
"description": "Free text field to describe guest rules",
"example": "You're allowed to bring guests (each act will be assigned an allocation), but you have to donate £5 to Oxfam"
},
"image": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "A filename. Either user-entered or generated.",
"example": "my-really-usefule-file.pdf"
},
"url": {
"type": "string",
"description": "URL where the file is available. TBC where these are served from!",
"example": "https://myfile.com/my-really-usefule-file.pdf"
}
}
},
"form_fields": {
"type": "array",
"items": {
"type": "object",
"required": [
"field_type",
"label",
"help_text"
],
"properties": {
"field_type": {
"type": "string",
"enum": [
"text",
"textarea",
"date",
"number",
"url",
"email",
"radio_button",
"boolean"
]
},
"validation_error_message": {
"type": "string",
"description": "Text to display to the user if their input is not valid",
"example": "Please enter a date in yy/mm/dd and ensure that it's between the event start date and event end date",
"default": "Please complete this field"
},
"label": {
"type": "string",
"description": "The primary question label displayed to the user",
"example": "Act name"
},
"help_text": {
"type": "string",
"description": "Information displayed to the user about what to consider and input into this field",
"example": "Enter the name of your act as you'd like it to appear on all documentation"
},
"response": {
"description": "The response submitted by users"
}
}
}
},
"acts": {
"type": "array"
}
}
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"allOf": [
{
"type": "object",
"description": "Time and ID fields for new objects. Not modelled directly in Mongoose, comes from a combination of the built-in id/_id field, along with the { timestamps: true } option",
"properties": {
"id": {
"type": "string",
"description": "System-generated ID of the object"
},
"createdAt": {
"type": "string",
"format": "date-time",
"description": "Date-time that entry was added, in ISO-8601 format"
},
"updatedAt": {
"type": "string",
"format": "date-time",
"description": "Date-time that entry was updated, in ISO-8601 format"
}
}
},
{
"type": "object",
"required": [
"name",
"start_date",
"end_date",
"act_submission_deadline"
],
"properties": {
"name": {
"type": "string",
"description": "Name of the event",
"example": "Glaston-barry 2018"
},
"start_date": {
"type": "string",
"format": "date-time",
"example": "1985-04-12T23:20:50.52Z"
},
"end_date": {
"type": "string",
"format": "date-time",
"example": "1985-04-12T23:20:50.52Z",
"description": "End date of the event. By default, requests only return current and future events"
},
"act_submission_deadline": {
"type": "string",
"format": "date-time",
"example": "1985-04-12T23:20:50.52Z",
"description": "Certain fields on the acts on this event will be locked after this date"
},
"event_administrators": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "ID of the user",
"example": "ILZ0Oz1OiH91tEyzBh"
},
"name": {
"type": "string",
"description": "User's full name",
"example": "Bobby Tables"
},
"avatarUrl": {
"type": "string",
"description": "URI for the user's avatar",
"example": "https://imgs.xkcd.com/comics/exploits_of_a_mom.png"
},
"email": {
"type": "string",
"description": "Users's email address",
"example": "bobby@tables.com"
}
}
}
},
"stages": {
"type": "array",
"description": "A list of stages at the event",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of the stage",
"example": "Pyramid Stage"
},
"attachments": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "A filename. Either user-entered or generated.",
"example": "my-really-usefule-file.pdf"
},
"url": {
"type": "string",
"description": "URL where the file is available. TBC where these are served from!",
"example": "https://myfile.com/my-really-usefule-file.pdf"
}
}
},
"description": "Attachments for a particular stage"
}
}
}
},
"attachments": {
"description": "Event attachments",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "A filename. Either user-entered or generated.",
"example": "my-really-usefule-file.pdf"
},
"url": {
"type": "string",
"description": "URL where the file is available. TBC where these are served from!",
"example": "https://myfile.com/my-really-usefule-file.pdf"
}
}
},
"guest_rules": {
"type": "string",
"description": "Free text field to describe guest rules",
"example": "You're allowed to bring guests (each act will be assigned an allocation), but you have to donate £5 to Oxfam"
},
"image": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "A filename. Either user-entered or generated.",
"example": "my-really-usefule-file.pdf"
},
"url": {
"type": "string",
"description": "URL where the file is available. TBC where these are served from!",
"example": "https://myfile.com/my-really-usefule-file.pdf"
}
}
},
"form_fields": {
"type": "array",
"items": {
"type": "object",
"required": [
"field_type",
"label",
"help_text"
],
"properties": {
"field_type": {
"type": "string",
"enum": [
"text",
"textarea",
"date",
"number",
"url",
"email",
"radio_button",
"boolean"
]
},
"validation_error_message": {
"type": "string",
"description": "Text to display to the user if their input is not valid",
"example": "Please enter a date in yy/mm/dd and ensure that it's between the event start date and event end date",
"default": "Please complete this field"
},
"label": {
"type": "string",
"description": "The primary question label displayed to the user",
"example": "Act name"
},
"help_text": {
"type": "string",
"description": "Information displayed to the user about what to consider and input into this field",
"example": "Enter the name of your act as you'd like it to appear on all documentation"
},
"response": {
"description": "The response submitted by users"
}
}
}
},
"acts": {
"type": "array"
}
}
}
]
}
},
"default": {
"description": "Error",
"schema": {
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
}
}
}
},
"/users/{id}": {
"get": {
"operationId": "getUser",
"x-swagger-router-controller": "user.controller",
"description": "Get a single user by ID",
"security": [
{
"auth0": [
"openid"
]
}
],
"parameters": [
{
"name": "id",
"type": "string",
"in": "path",
"required": true,
"description": "ID of user to fetch"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"allOf": [
{
"type": "object",
"required": [
"email"
],
"properties": {
"email": {
"type": "string",
"description": "User's email",
"example": "hello@properdesign.co.uk"
},
"given_name": {
"type": "string",
"description": "User's given (or first) name",
"example": "Chuck"
},
"family_name": {
"type": "string",
"description": "User's family name",
"example": "Norris"
},
"picture": {
"type": "string",
"description": "URL to the user's picture",
"example": "http://cdn.business2community.com/wp-content/uploads/2016/03/Vd3MJo.jpg"
}
}
}
]
}
},
"default": {
"description": "Error",
"schema": {
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
}
}
},
"put": {
"operationId": "updateUser",
"x-swagger-router-controller": "user.controller",
"description": "Update an event by ID. Returns a complete representation of the updated event.",
"security": [
{
"auth0": [
"openid"
]
}
],
"parameters": [
{
"name": "id",
"description": "Id of the event to be updated",
"type": "string",
"in": "path",
"required": true
},
{
"name": "body",
"description": "Event properties",
"in": "body",
"required": true,
"schema": {
"allOf": [
{
"type": "object",
"required": [
"email"
],
"properties": {
"email": {
"type": "string",
"description": "User's email",
"example": "hello@properdesign.co.uk"
},
"given_name": {
"type": "string",
"description": "User's given (or first) name",
"example": "Chuck"
},
"family_name": {
"type": "string",
"description": "User's family name",
"example": "Norris"
},
"picture": {
"type": "string",
"description": "URL to the user's picture",
"example": "http://cdn.business2community.com/wp-content/uploads/2016/03/Vd3MJo.jpg"
}
}
},
{
"type": "object",
"properties": {
"password": {
"type": "string"
}
}
}
]
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"allOf": [
{
"type": "object",
"required": [
"email"
],
"properties": {
"email": {
"type": "string",
"description": "User's email",
"example": "hello@properdesign.co.uk"
},
"given_name": {
"type": "string",
"description": "User's given (or first) name",
"example": "Chuck"
},
"family_name": {
"type": "string",
"description": "User's family name",
"example": "Norris"
},
"picture": {
"type": "string",
"description": "URL to the user's picture",
"example": "http://cdn.business2community.com/wp-content/uploads/2016/03/Vd3MJo.jpg"
}
}
}
]
}
},
"default": {
"description": "Error",
"schema": {
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
}
}
},
"delete": {
"operationId": "deleteUser",
"x-swagger-router-controller": "user.controller",
"description": "Delete a user by ID. Deletes them as far as the application is concerned; however, they are simply blocked in Auth0 so that they're recovereable",
"security": [
{
"auth0": [
"openid"
]
}
],
"parameters": [
{
"name": "id",
"description": "User id",
"type": "string",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "object",
"properties": {
"success": {
"type": "number",
"description": "returns 1 if successful"
},
"description": {
"type": "string",
"description": "a short comment"
}
},
"required": [
"success",
"description"
]
}
},
"default": {
"description": "Error",
"schema": {
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
}
}
}
},
"/users": {
"get": {
"operationId": "listUsers",
"x-swagger-router-controller": "user.controller",
"description": "Get all users. Queries Auth0 for all users that have a status !== blocked",
"security": [
{
"auth0": [
"openid"
]
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "array",
"items": {
"allOf": [
{
"type": "object",
"required": [
"email"
],
"properties": {
"email": {
"type": "string",
"description": "User's email",
"example": "hello@properdesign.co.uk"
},
"given_name": {
"type": "string",
"description": "User's given (or first) name",
"example": "Chuck"
},
"family_name": {
"type": "string",
"description": "User's family name",
"example": "Norris"
},
"picture": {
"type": "string",
"description": "URL to the user's picture",
"example": "http://cdn.business2community.com/wp-content/uploads/2016/03/Vd3MJo.jpg"
}
}
}
]
}
}
},
"default": {
"description": "Error",
"schema": {
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
}
}
},
"post": {
"operationId": "addUser",
"x-swagger-router-controller": "user.controller",
"description": "Add a new user. Returns a complete representation of the added user.",
"security": [
{
"auth0": [
"openid"
]
}
],
"parameters": [
{
"name": "user",
"description": "Properties to add to the user",
"in": "body",
"required": true,
"schema": {
"type": "object",
"required": [
"email"
],
"properties": {
"email": {
"type": "string",
"description": "User's email",
"example": "hello@properdesign.co.uk"
},
"given_name": {
"type": "string",
"description": "User's given (or first) name",
"example": "Chuck"
},
"family_name": {
"type": "string",
"description": "User's family name",
"example": "Norris"
},
"picture": {
"type": "string",
"description": "URL to the user's picture",
"example": "http://cdn.business2community.com/wp-content/uploads/2016/03/Vd3MJo.jpg"
}
}
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"allOf": [
{
"type": "object",
"required": [
"email"
],
"properties": {
"email": {
"type": "string",
"description": "User's email",
"example": "hello@properdesign.co.uk"
},
"given_name": {
"type": "string",
"description": "User's given (or first) name",
"example": "Chuck"
},
"family_name": {
"type": "string",
"description": "User's family name",
"example": "Norris"
},
"picture": {
"type": "string",
"description": "URL to the user's picture",
"example": "http://cdn.business2community.com/wp-content/uploads/2016/03/Vd3MJo.jpg"
}
}
}
]
}
},
"default": {
"description": "Error",
"schema": {
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment