OpenAPI Specification
openapi: 3.1.0
info:
title: COR Attachments Auth API
description: The COR API lets you integrate with projectcor.com applications using simple HTTP methods, in either XML or JSON formats, making this an ideal API for developing integrations with other softwares, external clients or mobile applications
version: 1.0.0
servers:
- url: https://api.projectcor.com/v1
description: Production server
security:
- bearerAuth: []
tags:
- name: Auth
paths:
/oauth/token:
post:
tags:
- Auth
summary: JWT Authorization by Client credentials
description: We'll be using the OAuth2 Client Credentials workflow as an authentication strategy and JWTs for the format of the tokens.
security: []
parameters:
- name: grant_type
in: query
required: true
schema:
type: string
enum:
- client_credentials
default: client_credentials
responses:
'200':
description: Successfully authenticated
content:
application/json:
schema:
$ref: '#/components/schemas/AuthResponse'
/oauth2/token:
post:
tags:
- Auth
summary: JWT Authorization by Authorization code
description: The authorization code is obtained by using an authorization server (COR) as an intermediary between the client and resource owner.
security: []
parameters:
- name: grant_type
in: query
required: true
schema:
type: string
enum:
- authorization_code
default: authorization_code
- name: code
in: query
required: true
schema:
type: string
description: Authorization code obtained from consent screen
responses:
'200':
description: Successfully authenticated
content:
application/json:
schema:
$ref: '#/components/schemas/AuthResponse'
/auth/login:
post:
tags:
- Auth
summary: JWT Authorization by User Credentials
security: []
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
required:
- email
- password
properties:
email:
type: string
format: email
description: User E-Mail
password:
type: string
format: password
description: User Password
responses:
'200':
description: Successfully authenticated
content:
application/json:
schema:
$ref: '#/components/schemas/AuthResponse'
/me:
get:
tags:
- Auth
summary: Get Authenticated User
description: Returns information about the currently authenticated user
responses:
'200':
description: User information
content:
application/json:
schema:
$ref: '#/components/schemas/User'
/oauth/refreshtoken:
post:
tags:
- Auth
summary: JWT Refresh Token
description: Refresh the user token
security: []
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
required:
- refresh_token
properties:
refresh_token:
type: string
description: Refresh token
responses:
'200':
description: Token refreshed successfully
content:
application/json:
schema:
$ref: '#/components/schemas/AuthResponse'
components:
schemas:
AuthResponse:
type: object
properties:
access_token:
type: string
token_type:
type: string
expires_in:
type: integer
refresh_token:
type: string
LeaveType:
type: object
properties:
id:
type: integer
name:
type: string
type_code:
type: string
company_id:
type: integer
nullable: true
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
deleted_at:
type: string
format: date-time
nullable: true
icon_name:
type: string
Label:
type: object
properties:
id:
type: integer
hex:
type: string
description: Hex color code
hsl:
type: string
nullable: true
rgb:
type: string
nullable: true
lang:
type: string
name:
type: string
color_id:
type: integer
Leave:
type: object
properties:
id:
type: integer
user_id:
type: integer
company_id:
type: integer
leave_type_id:
type: integer
start:
type: string
format: date-time
end:
type: string
format: date-time
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
deleted_at:
type: string
format: date-time
nullable: true
all_day:
type: boolean
leaveType:
$ref: '#/components/schemas/LeaveType'
UserBase:
type: object
properties:
id:
type: integer
first_name:
type: string
last_name:
type: string
picture:
type: string
description: URL to user's profile picture
email:
type: string
format: email
cuil:
type: string
remaining_hours:
type: number
user_position_id:
type: integer
role_id:
type: integer
description: 1=C-Level, 2=Director, 3=Project Manager, 4=Collaborator, 5=Freelancer, 6=Client
daily_hours:
type: number
plan_id:
type: integer
description: 4=Project Management, 5=Capacity Planning
plan_name:
type: string
hidden:
type: boolean
position_name:
type: string
nullable: true
category_id:
type: integer
nullable: true
category_name:
type: string
nullable: true
gmt:
type: string
description: UTC offset from the user's last login location. Indicates the timezone configured at their last login.
example: -03:00
leaves:
type: array
items:
$ref: '#/components/schemas/Leave'
User:
allOf:
- $ref: '#/components/schemas/UserBase'
- type: object
properties:
labels:
type: array
items:
$ref: '#/components/schemas/Label'
nullable: true
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
basicAuth:
type: http
scheme: basic