GigaCC API (1.0.0)

Download OpenAPI specification:Download

OAuth2トークン発行

アクセストークンおよびリフレッシュトークンを発行する。
引数の値がない場合、引数自体の省略とみなす。この他のパラメータは無視される。パラメータの重複は許可されない。
リクエストパラメータ及びエラーを含むレスポンスパラメータはRFC 6749 - The OAuth 2.0 Authorization Frameworkに準拠している。

Authorizations:
basic
Request Body schema: application/x-www-form-urlencoded
One of
grant_type
required
string
Value: "client_credentials"

client_credentials固定

Responses

Request samples

Content type
application/x-www-form-urlencoded
Example
grant_type=client_credentials

Response samples

Content type
application/json
{
  • "access_token": "0123456...",
  • "token_type": "bearer",
  • "expires_in": 3600,
  • "refresh_token": "0123456..."
}

Directories

ディレクトリ

ディレクトリ内項目一覧取得

指定IDのディレクトリ直下の項目の一覧を取得する

Authorizations:
OAuth2
path Parameters
required
string or string

ディレクトリID
"root"の場合はボリュームのルートディレクトリを表す。
"root"以外の場合は半角数字

query Parameters
limit
integer <int64>

取得する一覧件数の上限

offset
integer <int64>

取得する一覧の開始位置

Responses

Request samples

// AsyncHttp
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "https://GigaCCのFQDN/webapi/directories/1/items")
  .setHeader("Accept", "application/json")
  .setHeader("Authorization", "Bearer 123")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();

// NetHttp
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://GigaCCのFQDN/webapi/directories/1/items"))
    .header("Accept", "application/json")
    .header("Authorization", "Bearer 123")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());

// OkHttp
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://GigaCCのFQDN/webapi/directories/1/items")
  .get()
  .addHeader("Accept", "application/json")
  .addHeader("Authorization", "Bearer 123")
  .build();

Response response = client.newCall(request).execute();

// Unirest
HttpResponse<String> response = Unirest.get("https://GigaCCのFQDN/webapi/directories/1/items")
  .header("Accept", "application/json")
  .header("Authorization", "Bearer 123")
  .asString();

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "total_count": 10
}

Folders

フォルダ

フォルダ内項目一覧取得

指定IDのフォルダ直下の項目の一覧を取得する

Authorizations:
OAuth2
path Parameters
id
required
number <int64>

フォルダID

query Parameters
limit
integer <int64>

取得する一覧件数の上限

offset
integer <int64>

取得する一覧の開始位置

Responses

Request samples

// AsyncHttp
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "https://GigaCCのFQDN/webapi/folders/1/items")
  .setHeader("Accept", "application/json")
  .setHeader("Authorization", "Bearer 123")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();

// NetHttp
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://GigaCCのFQDN/webapi/folders/1/items"))
    .header("Accept", "application/json")
    .header("Authorization", "Bearer 123")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());

// OkHttp
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://GigaCCのFQDN/webapi/folders/1/items")
  .get()
  .addHeader("Accept", "application/json")
  .addHeader("Authorization", "Bearer 123")
  .build();

Response response = client.newCall(request).execute();

// Unirest
HttpResponse<String> response = Unirest.get("https://GigaCCのFQDN/webapi/folders/1/items")
  .header("Accept", "application/json")
  .header("Authorization", "Bearer 123")
  .asString();

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "total_count": 10
}

フォルダ作成

フォルダを作成する
Request bodyのparentはフォルダを直下に作成する項目IDで、typeにfileは指定不可

Authorizations:
OAuth2
Request Body schema: application/json
name
required
string

フォルダ名

required
object (ItemRef)

項目参照
項目の参照を表す

description
string

説明

Responses

Request samples

Content type
application/json
{
  • "name": "フォルダ名",
  • "parent": {
    },
  • "description": "説明"
}

Response samples

Content type
application/json
{
  • "type": "folder",
  • "id": 123456,
  • "name": "フォルダ名"
}

フォルダ移動

指定IDのフォルダを指定の場所に移動する
Request bodyのparent.typeにfileは指定不可

Authorizations:
OAuth2
path Parameters
id
required
integer <int64>

フォルダID

Request Body schema: application/json
required
object (ItemRef)

項目参照
項目の参照を表す

name_conflict_behavior
required
string
Enum: "skip" "overwrite" "rename"

名前衝突時解決方法
skip: スキップ
overwrite: 上書き
指定した場合、応答結果の各項目において、移動前後で一部のメタデータ(共有ノート使用中など)が異なる場合がある
rename: リネーム

Responses

Request samples

Content type
application/json
{
  • "parent": {
    },
  • "name_conflict_behavior": "skip"
}

Response samples

Content type
application/json
[
  • {
    }
]

フォルダ更新

指定IDのフォルダの指定された要素を更新する

Authorizations:
OAuth2
path Parameters
id
required
integer <int64>

フォルダID

Request Body schema: application/json
name
required
string

フォルダ名

Responses

Request samples

Content type
application/json
{
  • "name": "フォルダ名"
}

Response samples

Content type
application/json
{
  • "type": "folder",
  • "id": 123456,
  • "name": "フォルダ名"
}

フォルダ削除

指定IDのフォルダを削除する

Authorizations:
OAuth2
path Parameters
id
required
integer <int64>

フォルダID

Responses

Request samples

// AsyncHttp
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "https://GigaCCのFQDN/webapi/folders/1")
  .setHeader("Accept", "application/json")
  .setHeader("Authorization", "Bearer 123")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();

// NetHttp
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://GigaCCのFQDN/webapi/folders/1"))
    .header("Accept", "application/json")
    .header("Authorization", "Bearer 123")
    .method("DELETE", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());

// OkHttp
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://GigaCCのFQDN/webapi/folders/1")
  .delete(null)
  .addHeader("Accept", "application/json")
  .addHeader("Authorization", "Bearer 123")
  .build();

Response response = client.newCall(request).execute();

// Unirest
HttpResponse<String> response = Unirest.delete("https://GigaCCのFQDN/webapi/folders/1")
  .header("Accept", "application/json")
  .header("Authorization", "Bearer 123")
  .asString();

Response samples

Content type
application/json
[
  • {
    }
]

フォルダコピー

指定IDのフォルダを指定の場所にコピーする。

Authorizations:
OAuth2
path Parameters
id
required
integer <int64>

フォルダID

Request Body schema: application/json
required
required
object (ItemRef)

項目参照
項目の参照を表す

name_conflict_behavior
required
string (NameConflictBehavior)
Enum: "skip" "overwrite" "rename"

名前衝突時解決方法
skip: スキップ
overwrite: 上書き
 指定した場合、応答結果の各項目において、移動前後で一部のメタデータ(共有ノート使用中など)が異なる場合がある
rename: リネーム

Responses

Request samples

Content type
application/json
{
  • "parent": {
    },
  • "name_conflict_behavior": "skip"
}

Response samples

Content type
application/json
[
  • {
    }
]

Files

ファイル

ファイル詳細取得

指定IDのファイルの詳細を取得する

Authorizations:
OAuth2
path Parameters
id
required
integer <int64>

ファイルID

Responses

Request samples

// AsyncHttp
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "https://GigaCCのFQDN/webapi/files/1")
  .setHeader("Accept", "application/json")
  .setHeader("Authorization", "Bearer 123")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();

// NetHttp
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://GigaCCのFQDN/webapi/files/1"))
    .header("Accept", "application/json")
    .header("Authorization", "Bearer 123")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());

// OkHttp
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://GigaCCのFQDN/webapi/files/1")
  .get()
  .addHeader("Accept", "application/json")
  .addHeader("Authorization", "Bearer 123")
  .build();

Response response = client.newCall(request).execute();

// Unirest
HttpResponse<String> response = Unirest.get("https://GigaCCのFQDN/webapi/files/1")
  .header("Accept", "application/json")
  .header("Authorization", "Bearer 123")
  .asString();

Response samples

Content type
application/json
{
  • "type": "file",
  • "id": 123456,
  • "name": "ファイル名",
  • "parent_folder": {
    },
  • "parent_directory": {
    },
  • "size": 123456,
  • "creator": {
    },
  • "is_locked": false,
  • "is_checked_out": false,
  • "has_password": false,
  • "used_by_note": false,
  • "used_by_access_url": false,
  • "meta_info": [
    ],
  • "available_in": {
    },
  • "description": "説明",
  • "created_at": "2019-08-24T14:15:22Z",
  • "content_created_at": "2019-08-24T14:15:22Z",
  • "content_modified_at": "2019-08-24T14:15:22Z"
}

ファイル更新

指定IDのファイルの指定された要素を更新する

Authorizations:
OAuth2
path Parameters
id
required
integer <int64>

ファイルID

Request Body schema: application/json
name
required
string

ファイル名

Responses

Request samples

Content type
application/json
{
  • "name": "ファイル名"
}

Response samples

Content type
application/json
{
  • "type": "file",
  • "id": 123456,
  • "name": "ファイル名"
}

ファイル削除

指定IDのファイルを削除する

Authorizations:
OAuth2
path Parameters
id
required
integer <int64>

ファイルID

Responses

Request samples

// AsyncHttp
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "https://GigaCCのFQDN/webapi/files/1")
  .setHeader("Accept", "application/json")
  .setHeader("Authorization", "Bearer 123")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();

// NetHttp
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://GigaCCのFQDN/webapi/files/1"))
    .header("Accept", "application/json")
    .header("Authorization", "Bearer 123")
    .method("DELETE", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());

// OkHttp
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://GigaCCのFQDN/webapi/files/1")
  .delete(null)
  .addHeader("Accept", "application/json")
  .addHeader("Authorization", "Bearer 123")
  .build();

Response response = client.newCall(request).execute();

// Unirest
HttpResponse<String> response = Unirest.delete("https://GigaCCのFQDN/webapi/files/1")
  .header("Accept", "application/json")
  .header("Authorization", "Bearer 123")
  .asString();

Response samples

Content type
application/json
{
  • "type": "エラー種別",
  • "error": "OAuth2トークン発行のエラー種別",
  • "error_description": "メッセージ",
  • "parameter_names": [
    ],
  • "valid_values": [
    ],
  • "valid_range": {
    },
  • "item": {
    }
}

ファイルダウンロード

指定IDのファイルをダウンロードする

Authorizations:
OAuth2
path Parameters
id
required
integer <int64>

ファイルID

Responses

Request samples

// AsyncHttp
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "https://GigaCCのFQDN/webapi/files/1/content")
  .setHeader("Accept", "application/octet-stream, application/json")
  .setHeader("Authorization", "Bearer 123")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();

// NetHttp
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://GigaCCのFQDN/webapi/files/1/content"))
    .header("Accept", "application/octet-stream, application/json")
    .header("Authorization", "Bearer 123")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());

// OkHttp
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://GigaCCのFQDN/webapi/files/1/content")
  .get()
  .addHeader("Accept", "application/octet-stream, application/json")
  .addHeader("Authorization", "Bearer 123")
  .build();

Response response = client.newCall(request).execute();

// Unirest
HttpResponse<String> response = Unirest.get("https://GigaCCのFQDN/webapi/files/1/content")
  .header("Accept", "application/octet-stream, application/json")
  .header("Authorization", "Bearer 123")
  .asString();

Response samples

Content type
application/json
{
  • "type": "エラー種別",
  • "error": "OAuth2トークン発行のエラー種別",
  • "error_description": "メッセージ",
  • "parameter_names": [
    ],
  • "valid_values": [
    ],
  • "valid_range": {
    },
  • "item": {
    }
}

ファイルアップロード

指定のファイルをアップロードする

Authorizations:
OAuth2
Request Body schema: multipart/form-data
required
object

メタデータ

required
string <binary>

Responses

Request samples

String path = "C:\\Users\\test\\testdata.txt";
byte[] file = new byte[1024];

FileInputStream fs = new FileInputStream(path);
BufferedInputStream bis = new BufferedInputStream(fs);

// ファイルを読み込む
bis.read(file);
bis.close();

// バイナリからStringに変換する
String strFile = new String(file);

// AsyncHttp
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "https://GigaCCのFQDN/webapi/files")
  .setHeader("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
  .setHeader("Accept", "application/json")
  .setHeader("Authorization", "Bearer 123")
  .setBody("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"metadata\"\r\n\r\n{ \"parent\": { \"id\": 1, \"type\": \"directory\" }, \"description\": \"説明\", \"name_conflict_behavior\": \"skip\" }\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"upload.txt\"\r\nContent-Type: text/plain\r\n\r\n\r\n" + strFile + "\r\n-----011000010111000001101001--\r\n")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();

// NetHttp
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://GigaCCのFQDN/webapi/files"))
    .header("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
    .header("Accept", "application/json")
    .header("Authorization", "Bearer 123")
    .method("POST", HttpRequest.BodyPublishers.ofString("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"metadata\"\r\n\r\n{ \"parent\": { \"id\": 1, \"type\": \"directory\" }, \"description\": \"説明\", \"name_conflict_behavior\": \"skip\" }\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"upload.txt\"\r\nContent-Type: text/plain\r\n\r\n\r\n" + strFile + "\r\n-----011000010111000001101001--\r\n"))
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());

// OkHttp
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("multipart/form-data; boundary=---011000010111000001101001");
RequestBody body = RequestBody.create("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"metadata\"\r\n\r\n{ \"parent\": { \"id\": 1, \"type\": \"directory\" }, \"description\": \"説明\", \"name_conflict_behavior\": \"skip\" }\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"upload.txt\"\r\nContent-Type: text/plain\r\n\r\n\r\n" + strFile + "\r\n-----011000010111000001101001--\r\n", mediaType);
Request request = new Request.Builder()
  .url("https://GigaCCのFQDN/webapi/files")
  .post(body)
  .addHeader("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
  .addHeader("Accept", "application/json")
  .addHeader("Authorization", "Bearer 123")
  .build();

Response response = client.newCall(request).execute();
System.out.println(response.body().string());

// Unirest
HttpResponse<String> response = Unirest.post("https://GigaCCのFQDN/webapi/files")
  .header("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
  .header("Accept", "application/json")
  .header("Authorization", "Bearer 123")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"metadata\"\r\n\r\n{ \"parent\": { \"id\": 1, \"type\": \"directory\" }, \"description\": \"説明\", \"name_conflict_behavior\": \"skip\" }\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"upload.txt\"\r\nContent-Type: text/plain\r\n\r\n\r\n" + strFile + "\r\n-----011000010111000001101001--\r\n")
  .asString();

System.out.println(response.getBody());

Response samples

Content type
application/json
{
  • "type": "file",
  • "id": 123456,
  • "name": "ファイル名",
  • "parent_folder": {
    },
  • "parent_directory": {
    },
  • "size": 123456,
  • "creator": {
    },
  • "is_locked": false,
  • "is_checked_out": false,
  • "has_password": false,
  • "used_by_note": false,
  • "used_by_access_url": false,
  • "available_in": {
    },
  • "description": "説明",
  • "createdd_at": "2019-08-24T14:15:22Z",
  • "content_created_at": "2019-08-24T14:15:22Z",
  • "content_modified_at": "2019-08-24T14:15:22Z"
}

ファイル移動

指定IDのファイルを指定の場所に移動する

Authorizations:
OAuth2
path Parameters
id
required
integer <int64>

ファイルID

Request Body schema: application/json
required
object (ItemRef)

項目参照
項目の参照を表す

name_conflict_behavior
required
string (NameConflictBehavior)
Enum: "skip" "overwrite" "rename"

名前衝突時解決方法
skip: スキップ
overwrite: 上書き
 指定した場合、応答結果の各項目において、移動前後で一部のメタデータ(共有ノート使用中など)が異なる場合がある
rename: リネーム

Responses

Request samples

Content type
application/json
{
  • "parent": {
    },
  • "name_conflict_behavior": "skip"
}

Response samples

Content type
application/json
{
  • "type": "file",
  • "id": 123456,
  • "name": "ファイル名"
}

ファイルコピー

指定IDのファイルを指定の場所にコピーする
Request bodyのparent.typeにfileは指定不可

Authorizations:
OAuth2
path Parameters
id
required
integer <int64>

ファイルID

Request Body schema: application/json
required
object (ItemRef)

項目参照
項目の参照を表す

name_conflict_behavior
required
string (NameConflictBehavior)
Enum: "skip" "overwrite" "rename"

名前衝突時解決方法
skip: スキップ
overwrite: 上書き
 指定した場合、応答結果の各項目において、移動前後で一部のメタデータ(共有ノート使用中など)が異なる場合がある
rename: リネーム

Responses

Request samples

Content type
application/json
{
  • "parent": {
    },
  • "name_conflict_behavior": "skip"
}

Response samples

Content type
application/json
{
  • "type": "file",
  • "id": 123456,
  • "name": "ファイル名"
}

Search

検索

ファイル・フォルダ検索

指定IDのディレクトリまたはフォルダ配下のファイルおよびフォルダを検索する

Authorizations:
OAuth2
query Parameters
ancestor_id
required
integer <int64>

ディレクトリIDまたはフォルダID

ancestor_type
required
string
Enum: "directory" "folder"

directory: ディレクトリ
folder: フォルダ

keyword
string

キーワード

create_time_at_range
Array of strings <date-time> [ items <date-time > ]

登録期間。以下に例を示す
・開始日時と終了日時を指定する場合
 "2021-03-01T00:00:00.000+09:00,2021-03-31T00:00:00.000+09:00"
・開始日時が省略されている場合
 "2021-03-01T00:00:00.000+09:00,"
・終了日時が省略されている場合
 ",2021-03-31T00:00:00.000+09:00"
・両方とも省略されている場合
 ","

limit
integer <int64>

取得する一覧件数の上限

offset
integer <int64>

取得する一覧の開始位置

Responses

Request samples

// AsyncHttp
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "https://GigaCCのFQDN/webapi/search?ancestor_id=1&ancestor_type=directory")
  .setHeader("Accept", "application/json")
  .setHeader("Authorization", "Bearer 123")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();

// NetHttp
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://GigaCCのFQDN/webapi/search?ancestor_id=1&ancestor_type=directory"))
    .header("Accept", "application/json")
    .header("Authorization", "Bearer 123")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());

// OkHttp
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://GigaCCのFQDN/webapi/search?ancestor_id=1&ancestor_type=directory")
  .get()
  .addHeader("Accept", "application/json")
  .addHeader("Authorization", "Bearer 123")
  .build();

Response response = client.newCall(request).execute();

// Unirest
HttpResponse<String> response = Unirest.get("https://GigaCCのFQDN/webapi/search?ancestor_id=1&ancestor_type=directory")
  .header("Accept", "application/json")
  .header("Authorization", "Bearer 123")
  .asString();

Response samples

Content type
application/json
[
  • {
    }
]