Skip to content

Instantly share code, notes, and snippets.

@danielbraun
Last active June 30, 2019 12:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielbraun/9c5ad3b045c2abe864b41246ec7e6f91 to your computer and use it in GitHub Desktop.
Save danielbraun/9c5ad3b045c2abe864b41246ec7e6f91 to your computer and use it in GitHub Desktop.
openapi: 3.0.0
info:
title: Tasksheriff
version: 1.0.0
servers:
- url: 'https://api.tasksheriff.com'
components:
securitySchemes:
oAuth2:
type: oauth2
flows:
implicit:
authorizationUrl: /oauth/token
scopes: {}
security:
- oAuth2: []
paths:
'/api/files/{id}':
get:
summary: "Get Document Data"
'/api/user':
get:
summary: "Get Current User"
'/api/upload':
post:
summary: Upload files
parameters:
- in: header
name: Accept
schema:
type: string
enum:
- application/json
required: true
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
client_id:
type: integer
'files[]':
type: string
format: binary
responses:
'200':
description: Upload successfully
content:
application/json:
schema:
type: array
items:
type: object
'401':
description: Unauthenticated
'422':
description: The given data was invalid
/oauth/token:
post:
summary: Get access token
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- grant_type
- client_id
- client_secret
- username
- password
properties:
grant_type:
type: string
enum:
- password
client_id:
type: integer
client_secret:
type: string
username:
type: string
password:
type: string
responses:
'200':
description: Token created successfully
content:
application/json:
schema:
type: object
properties:
token_type:
type: string
expires_in:
type: integer
access_token:
type: string
refresh_token:
type: string
'400':
description: Invalid request
content:
application/json:
schema:
type: object
properties:
error:
type: string
message:
type: string
hint:
type: string
'401':
description: Invalid credentials
content:
application/json:
schema:
type: object
properties:
error:
type: string
message:
type: string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment