OmnisCode API (1.0.0)

Download OpenAPI specification:Download

License: Apache 2.0

コード共有SNS OmnisCode のAPI

Authentication

Bearer

'Authorization: Bearer $TOKEN'の形式でheaderにTokenを付与

Security Scheme Type API Key
Header parameter name: Authorization

user

ユーザー

Create user

事前にloginが必要

Authorizations:
Request Body schema: application/json
name
string
twitter_id
string
profile
string

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "twitter_id": "string",
  • "profile": "string"
}

Update user

事前にloginが必要

Authorizations:
Request Body schema: application/json
name
string
twitter_id
string
profile
string

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "twitter_id": "string",
  • "profile": "string"
}

Delete user

事前にloginが必要

Authorizations:

Responses

Get user by user id

User情報を取得

path Parameters
userID
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "twitter_id": "string",
  • "profile": "string",
  • "icon_url": "string"
}

Get posts by user id

Userが投稿したPost一覧を取得

path Parameters
userID
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get comments by user id

Userが投稿したComment一覧を取得

path Parameters
userID
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

post

スレッドのメインとなる投稿

Get posts

Post一覧を取得

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create post

事前にloginが必要

Authorizations:
Request Body schema: application/json
title
string
code
string

ソースコード

language
string

ソースコードの言語

content
string

説明の内容

source
string

postの引用元(urlなど)

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "code": "string",
  • "language": "string",
  • "content": "string",
  • "source": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "user_id": "string",
  • "title": "string",
  • "code": "string",
  • "language": "string",
  • "content": "string",
  • "source": "string",
  • "created_at": "2006-01-02T15:04:05+09:00",
  • "updated_at": "2006-01-02T15:04:05+09:00"
}

Find post by post id

path Parameters
postID
required
integer <int64>

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "user_id": "string",
  • "title": "string",
  • "code": "string",
  • "language": "string",
  • "content": "string",
  • "source": "string",
  • "created_at": "2006-01-02T15:04:05+09:00",
  • "updated_at": "2006-01-02T15:04:05+09:00"
}

Update post

事前にloginが必要

Authorizations:
path Parameters
postID
required
integer <int64>
Request Body schema: application/json
title
string
code
string

ソースコード

language
string

ソースコードの言語

content
string

説明の内容

source
string

postの引用元(urlなど)

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "code": "string",
  • "language": "string",
  • "content": "string",
  • "source": "string"
}

Delete post

事前にloginが必要

Authorizations:
path Parameters
postID
required
integer <int64>

Responses

comment

スレッドにつくコメント.コードに対するハイライトor変更が含まれる場合がある

Get comments by post id

Postに関連付けられるcommentの一覧を取得

path Parameters
postID
required
integer <int64>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create comment

事前にloginが必要

Authorizations:
path Parameters
postID
required
integer <int64>
Request Body schema: application/json
type
string
Enum: "highlight" "commit" "none"

highlight:コードのハイライトを含む commit:コードの変更を含む none:コメントのみ

content
string

コメントの内容(type:noneなら必要.他のtypeでも含んでいて良い)

first_line
integer <int32>

ハイライトする行の開始行数(type:highlightのみ必要)

last_line
integer <int32>

ハイライトする行の終了行数(type:highlightのみ必要)

code
string

変更後のコードすべてを含む(type:commitのみ必要)

Responses

Request samples

Content type
application/json
{
  • "type": "highlight",
  • "content": "string",
  • "first_line": 0,
  • "last_line": 0,
  • "code": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "user_id": "string",
  • "post_id": 0,
  • "type": "highlight",
  • "content": "string",
  • "first_line": 0,
  • "last_line": 0,
  • "code": "string",
  • "created_at": "2006-01-02T15:04:05+09:00",
  • "updated_at": "2006-01-02T15:04:05+09:00"
}

Get comment by ID

path Parameters
postID
required
integer <int64>
commentID
required
integer <int64>

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "user_id": "string",
  • "post_id": 0,
  • "type": "highlight",
  • "content": "string",
  • "first_line": 0,
  • "last_line": 0,
  • "code": "string",
  • "created_at": "2006-01-02T15:04:05+09:00",
  • "updated_at": "2006-01-02T15:04:05+09:00"
}

Update comment

事前にloginが必要

Authorizations:
path Parameters
postID
required
integer <int64>
commentID
required
integer <int64>
Request Body schema: application/json
type
string
Enum: "highlight" "commit" "none"

highlight:コードのハイライトを含む commit:コードの変更を含む none:コメントのみ

content
string

コメントの内容(type:noneなら必要.他のtypeでも含んでいて良い)

first_line
integer <int32>

ハイライトする行の開始行数(type:highlightのみ必要)

last_line
integer <int32>

ハイライトする行の終了行数(type:highlightのみ必要)

code
string

変更後のコードすべてを含む(type:commitのみ必要)

Responses

Request samples

Content type
application/json
{
  • "type": "highlight",
  • "content": "string",
  • "first_line": 0,
  • "last_line": 0,
  • "code": "string"
}

Response samples

Content type
application/json
{
  • "post": 0,
  • "message": "string"
}

Delete comment

事前にloginが必要

Authorizations:
path Parameters
postID
required
integer <int64>
commentID
required
integer <int64>

Responses

Response samples

Content type
application/json
{
  • "post": 0,
  • "message": "string"
}