Cosense (Scrapbox) HTTP API

Edit

previewPageEdit

編集の dry-run

何も書き込まずに `previewId` を返す。 有効期限は数分で、`expireAt` だけが ISO 8601 の文字列で返る。 **ヘッダーの資格情報が必須**である。 PAT でも Service Account Access Key でも通るが、cookie では通らない。 | リクエスト | 結果 | | --- | --- | | cookie のみ、`Origin` なし | 403 `CrossOriginWriteNotAllowedError` | | cookie + `Origin: https://scrapbox.io` | 403 `PersonalAccessTokenRequiredError` | | PAT(`Origin` の有無を問わない) | 200 | `CrossOriginWriteNotAllowedError` は cookie 認証に対する CSRF ガードであり、 PAT 経路では `Origin` を見ていない。そのためこのクライアントは `Origin` を送らない。 `changes` は配列順に適用され、anchor は適用時点で存在していなければならない。 新規行の `lines.id` は **クライアントが生成する** (`scrapbox.edits.new_line_id()` が `secrets.token_hex(12)`)。 `pagePreview` は v2 ページ取得と同じ形の全体が返る。 新規作成 (`pageId` を送らない) では次のようになる。 - **1 行目の `_insert` のテキストがページタイトルになる。** `changes` が空だと `first change must be an _insert to create a new page` で拒否される - `persistent` は false、`commitId` は key ごと不在。 ただし `linesCount` と `charsCount` は入る(実体の無いページの取得とは違う) - `pagePreview.id` にはクライアントが送った 1 行目の line id が入る。 submit 後の実 page id も同じ値になる - 同名ページがあると、**この時点で既に**タイトルに `_2` が付き、 1 行目のテキストも書き換わっている


/pages/v2/{projectName}/page-edit-for-ai/preview

Usage and SDK Samples

curl -X POST \
-H "x-service-account-access-key: [[apiKey]]" \
-H "x-personal-access-token: [[apiKey]]" \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://scrapbox.io/api/pages/v2/{projectName}/page-edit-for-ai/preview" \
 -d '{
  "pageId" : "pageId",
  "changes" : [ {
    "_insert" : "_insert",
    "lines" : {
      "id" : "id",
      "text" : "text",
      "origText" : "origText"
    }
  }, {
    "_insert" : "_insert",
    "lines" : {
      "id" : "id",
      "text" : "text",
      "origText" : "origText"
    }
  } ]
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.EditApi;

import java.io.File;
import java.util.*;

public class EditApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure API key authorization: ServiceAccount
        ApiKeyAuth ServiceAccount = (ApiKeyAuth) defaultClient.getAuthentication("ServiceAccount");
        ServiceAccount.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //ServiceAccount.setApiKeyPrefix("Token");

        // Configure API key authorization: PersonalAccessToken
        ApiKeyAuth PersonalAccessToken = (ApiKeyAuth) defaultClient.getAuthentication("PersonalAccessToken");
        PersonalAccessToken.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //PersonalAccessToken.setApiKeyPrefix("Token");

        // Create an instance of the API class
        EditApi apiInstance = new EditApi();
        String projectName = help-jp; // String | プロジェクト名(URL に使われる `name`)
        EditPreviewRequest editPreviewRequest = {"pageId":"6a78192b3a6ddc39bdf42b47","changes":[{"_update":"6a78192b3a6ddc39bdf42b47","lines":{"text":"hey"}}]}; // EditPreviewRequest | 

        try {
            EditPreviewResponse result = apiInstance.previewPageEdit(projectName, editPreviewRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling EditApi#previewPageEdit");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String projectName = new String(); // String | プロジェクト名(URL に使われる `name`)
final EditPreviewRequest editPreviewRequest = new EditPreviewRequest(); // EditPreviewRequest | 

try {
    final result = await api_instance.previewPageEdit(projectName, editPreviewRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->previewPageEdit: $e\n');
}

import org.openapitools.client.api.EditApi;

public class EditApiExample {
    public static void main(String[] args) {
        EditApi apiInstance = new EditApi();
        String projectName = help-jp; // String | プロジェクト名(URL に使われる `name`)
        EditPreviewRequest editPreviewRequest = {"pageId":"6a78192b3a6ddc39bdf42b47","changes":[{"_update":"6a78192b3a6ddc39bdf42b47","lines":{"text":"hey"}}]}; // EditPreviewRequest | 

        try {
            EditPreviewResponse result = apiInstance.previewPageEdit(projectName, editPreviewRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling EditApi#previewPageEdit");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: ServiceAccount)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"x-service-account-access-key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"x-service-account-access-key"];

// Configure API key authorization: (authentication scheme: PersonalAccessToken)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"x-personal-access-token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"x-personal-access-token"];


// Create an instance of the API class
EditApi *apiInstance = [[EditApi alloc] init];
String *projectName = help-jp; // プロジェクト名(URL に使われる `name`) (default to null)
EditPreviewRequest *editPreviewRequest = {"pageId":"6a78192b3a6ddc39bdf42b47","changes":[{"_update":"6a78192b3a6ddc39bdf42b47","lines":{"text":"hey"}}]}; // 

// 編集の dry-run
[apiInstance previewPageEditWith:projectName
    editPreviewRequest:editPreviewRequest
              completionHandler: ^(EditPreviewResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var CosenseScrapboxHttpApi = require('cosense__scrapbox_http_api');
var defaultClient = CosenseScrapboxHttpApi.ApiClient.instance;

// Configure API key authorization: ServiceAccount
var ServiceAccount = defaultClient.authentications['ServiceAccount'];
ServiceAccount.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ServiceAccount.apiKeyPrefix['x-service-account-access-key'] = "Token";

// Configure API key authorization: PersonalAccessToken
var PersonalAccessToken = defaultClient.authentications['PersonalAccessToken'];
PersonalAccessToken.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//PersonalAccessToken.apiKeyPrefix['x-personal-access-token'] = "Token";

// Create an instance of the API class
var api = new CosenseScrapboxHttpApi.EditApi()
var projectName = help-jp; // {String} プロジェクト名(URL に使われる `name`)
var editPreviewRequest = {"pageId":"6a78192b3a6ddc39bdf42b47","changes":[{"_update":"6a78192b3a6ddc39bdf42b47","lines":{"text":"hey"}}]}; // {EditPreviewRequest} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.previewPageEdit(projectName, editPreviewRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class previewPageEditExample
    {
        public void main()
        {
            // Configure API key authorization: ServiceAccount
            Configuration.Default.ApiKey.Add("x-service-account-access-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("x-service-account-access-key", "Bearer");
            // Configure API key authorization: PersonalAccessToken
            Configuration.Default.ApiKey.Add("x-personal-access-token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("x-personal-access-token", "Bearer");

            // Create an instance of the API class
            var apiInstance = new EditApi();
            var projectName = help-jp;  // String | プロジェクト名(URL に使われる `name`) (default to null)
            var editPreviewRequest = new EditPreviewRequest(); // EditPreviewRequest | 

            try {
                // 編集の dry-run
                EditPreviewResponse result = apiInstance.previewPageEdit(projectName, editPreviewRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling EditApi.previewPageEdit: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: ServiceAccount
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('x-service-account-access-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-service-account-access-key', 'Bearer');

// Configure API key authorization: PersonalAccessToken
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('x-personal-access-token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-personal-access-token', 'Bearer');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\EditApi();
$projectName = help-jp; // String | プロジェクト名(URL に使われる `name`)
$editPreviewRequest = {"pageId":"6a78192b3a6ddc39bdf42b47","changes":[{"_update":"6a78192b3a6ddc39bdf42b47","lines":{"text":"hey"}}]}; // EditPreviewRequest | 

try {
    $result = $api_instance->previewPageEdit($projectName, $editPreviewRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EditApi->previewPageEdit: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::EditApi;

# Configure API key authorization: ServiceAccount
$WWW::OPenAPIClient::Configuration::api_key->{'x-service-account-access-key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'x-service-account-access-key'} = "Bearer";

# Configure API key authorization: PersonalAccessToken
$WWW::OPenAPIClient::Configuration::api_key->{'x-personal-access-token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'x-personal-access-token'} = "Bearer";

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::EditApi->new();
my $projectName = help-jp; # String | プロジェクト名(URL に使われる `name`)
my $editPreviewRequest = WWW::OPenAPIClient::Object::EditPreviewRequest->new(); # EditPreviewRequest | 

eval {
    my $result = $api_instance->previewPageEdit(projectName => $projectName, editPreviewRequest => $editPreviewRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling EditApi->previewPageEdit: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ServiceAccount
openapi_client.configuration.api_key['x-service-account-access-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['x-service-account-access-key'] = 'Bearer'

# Configure API key authorization: PersonalAccessToken
openapi_client.configuration.api_key['x-personal-access-token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['x-personal-access-token'] = 'Bearer'

# Create an instance of the API class
api_instance = openapi_client.EditApi()
projectName = help-jp # String | プロジェクト名(URL に使われる `name`) (default to null)
editPreviewRequest = {"pageId":"6a78192b3a6ddc39bdf42b47","changes":[{"_update":"6a78192b3a6ddc39bdf42b47","lines":{"text":"hey"}}]} # EditPreviewRequest | 

try:
    # 編集の dry-run
    api_response = api_instance.preview_page_edit(projectName, editPreviewRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling EditApi->previewPageEdit: %s\n" % e)
extern crate EditApi;

pub fn main() {
    let projectName = help-jp; // String
    let editPreviewRequest = {"pageId":"6a78192b3a6ddc39bdf42b47","changes":[{"_update":"6a78192b3a6ddc39bdf42b47","lines":{"text":"hey"}}]}; // EditPreviewRequest

    let mut context = EditApi::Context::default();
    let result = client.previewPageEdit(projectName, editPreviewRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Path parameters
Name Description
projectName*
String
プロジェクト名(URL に使われる `name`)
Required
Body parameters
Name Description
editPreviewRequest *

Responses


submitPageEdit

preview した編集を確定する

**ヘッダーの資格情報が必須**である。cookie では通らない。 `previewId` は 1 回限りで、submit すると消費される。 preview を作ったのと別のプロジェクトに submit することはできない。 新規作成時に同名ページが既にあると、サーバーがタイトルに suffix を付けることがある。 確定 URL は要求したタイトルではなくレスポンスの `page.title` から組み立てる。


/pages/v2/{projectName}/page-edit-for-ai/submit

Usage and SDK Samples

curl -X POST \
-H "x-service-account-access-key: [[apiKey]]" \
-H "x-personal-access-token: [[apiKey]]" \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://scrapbox.io/api/pages/v2/{projectName}/page-edit-for-ai/submit" \
 -d '{
  "previewId" : "previewId"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.EditApi;

import java.io.File;
import java.util.*;

public class EditApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure API key authorization: ServiceAccount
        ApiKeyAuth ServiceAccount = (ApiKeyAuth) defaultClient.getAuthentication("ServiceAccount");
        ServiceAccount.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //ServiceAccount.setApiKeyPrefix("Token");

        // Configure API key authorization: PersonalAccessToken
        ApiKeyAuth PersonalAccessToken = (ApiKeyAuth) defaultClient.getAuthentication("PersonalAccessToken");
        PersonalAccessToken.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //PersonalAccessToken.setApiKeyPrefix("Token");

        // Create an instance of the API class
        EditApi apiInstance = new EditApi();
        String projectName = help-jp; // String | プロジェクト名(URL に使われる `name`)
        EditSubmitRequest editSubmitRequest = ; // EditSubmitRequest | 

        try {
            EditSubmitResponse result = apiInstance.submitPageEdit(projectName, editSubmitRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling EditApi#submitPageEdit");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String projectName = new String(); // String | プロジェクト名(URL に使われる `name`)
final EditSubmitRequest editSubmitRequest = new EditSubmitRequest(); // EditSubmitRequest | 

try {
    final result = await api_instance.submitPageEdit(projectName, editSubmitRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->submitPageEdit: $e\n');
}

import org.openapitools.client.api.EditApi;

public class EditApiExample {
    public static void main(String[] args) {
        EditApi apiInstance = new EditApi();
        String projectName = help-jp; // String | プロジェクト名(URL に使われる `name`)
        EditSubmitRequest editSubmitRequest = ; // EditSubmitRequest | 

        try {
            EditSubmitResponse result = apiInstance.submitPageEdit(projectName, editSubmitRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling EditApi#submitPageEdit");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: ServiceAccount)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"x-service-account-access-key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"x-service-account-access-key"];

// Configure API key authorization: (authentication scheme: PersonalAccessToken)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"x-personal-access-token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"x-personal-access-token"];


// Create an instance of the API class
EditApi *apiInstance = [[EditApi alloc] init];
String *projectName = help-jp; // プロジェクト名(URL に使われる `name`) (default to null)
EditSubmitRequest *editSubmitRequest = ; // 

// preview した編集を確定する
[apiInstance submitPageEditWith:projectName
    editSubmitRequest:editSubmitRequest
              completionHandler: ^(EditSubmitResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var CosenseScrapboxHttpApi = require('cosense__scrapbox_http_api');
var defaultClient = CosenseScrapboxHttpApi.ApiClient.instance;

// Configure API key authorization: ServiceAccount
var ServiceAccount = defaultClient.authentications['ServiceAccount'];
ServiceAccount.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ServiceAccount.apiKeyPrefix['x-service-account-access-key'] = "Token";

// Configure API key authorization: PersonalAccessToken
var PersonalAccessToken = defaultClient.authentications['PersonalAccessToken'];
PersonalAccessToken.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//PersonalAccessToken.apiKeyPrefix['x-personal-access-token'] = "Token";

// Create an instance of the API class
var api = new CosenseScrapboxHttpApi.EditApi()
var projectName = help-jp; // {String} プロジェクト名(URL に使われる `name`)
var editSubmitRequest = ; // {EditSubmitRequest} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.submitPageEdit(projectName, editSubmitRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class submitPageEditExample
    {
        public void main()
        {
            // Configure API key authorization: ServiceAccount
            Configuration.Default.ApiKey.Add("x-service-account-access-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("x-service-account-access-key", "Bearer");
            // Configure API key authorization: PersonalAccessToken
            Configuration.Default.ApiKey.Add("x-personal-access-token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("x-personal-access-token", "Bearer");

            // Create an instance of the API class
            var apiInstance = new EditApi();
            var projectName = help-jp;  // String | プロジェクト名(URL に使われる `name`) (default to null)
            var editSubmitRequest = new EditSubmitRequest(); // EditSubmitRequest | 

            try {
                // preview した編集を確定する
                EditSubmitResponse result = apiInstance.submitPageEdit(projectName, editSubmitRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling EditApi.submitPageEdit: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: ServiceAccount
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('x-service-account-access-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-service-account-access-key', 'Bearer');

// Configure API key authorization: PersonalAccessToken
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('x-personal-access-token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-personal-access-token', 'Bearer');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\EditApi();
$projectName = help-jp; // String | プロジェクト名(URL に使われる `name`)
$editSubmitRequest = ; // EditSubmitRequest | 

try {
    $result = $api_instance->submitPageEdit($projectName, $editSubmitRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EditApi->submitPageEdit: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::EditApi;

# Configure API key authorization: ServiceAccount
$WWW::OPenAPIClient::Configuration::api_key->{'x-service-account-access-key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'x-service-account-access-key'} = "Bearer";

# Configure API key authorization: PersonalAccessToken
$WWW::OPenAPIClient::Configuration::api_key->{'x-personal-access-token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'x-personal-access-token'} = "Bearer";

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::EditApi->new();
my $projectName = help-jp; # String | プロジェクト名(URL に使われる `name`)
my $editSubmitRequest = WWW::OPenAPIClient::Object::EditSubmitRequest->new(); # EditSubmitRequest | 

eval {
    my $result = $api_instance->submitPageEdit(projectName => $projectName, editSubmitRequest => $editSubmitRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling EditApi->submitPageEdit: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ServiceAccount
openapi_client.configuration.api_key['x-service-account-access-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['x-service-account-access-key'] = 'Bearer'

# Configure API key authorization: PersonalAccessToken
openapi_client.configuration.api_key['x-personal-access-token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['x-personal-access-token'] = 'Bearer'

# Create an instance of the API class
api_instance = openapi_client.EditApi()
projectName = help-jp # String | プロジェクト名(URL に使われる `name`) (default to null)
editSubmitRequest =  # EditSubmitRequest | 

try:
    # preview した編集を確定する
    api_response = api_instance.submit_page_edit(projectName, editSubmitRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling EditApi->submitPageEdit: %s\n" % e)
extern crate EditApi;

pub fn main() {
    let projectName = help-jp; // String
    let editSubmitRequest = ; // EditSubmitRequest

    let mut context = EditApi::Context::default();
    let result = client.submitPageEdit(projectName, editSubmitRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Path parameters
Name Description
projectName*
String
プロジェクト名(URL に使われる `name`)
Required
Body parameters
Name Description
editSubmitRequest *

Responses


Files

downloadFile

ファイル本体のダウンロード

302 で Google Cloud Storage の署名付き URL にリダイレクトする。 署名の有効期限は実測で 300 秒だった。 | リクエスト | リダイレクト先のバケット | | --- | --- | | `?type=thumbnail` なし | `scrapbox-file-distribute` | | `?type=thumbnail` あり | `scrapbox-file-thumbnail` | `_attach_pat` がホスト名で送信先を絞っているため、この署名付き URL に PAT は付かない。


/files/{fileId}

Usage and SDK Samples

curl -X GET \
-H "x-service-account-access-key: [[apiKey]]" \
-H "x-personal-access-token: [[apiKey]]" \
 \
 -H "Accept: application/json" \
 "https://scrapbox.io/api/files/{fileId}?type=type_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FilesApi;

import java.io.File;
import java.util.*;

public class FilesApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure API key authorization: ServiceAccount
        ApiKeyAuth ServiceAccount = (ApiKeyAuth) defaultClient.getAuthentication("ServiceAccount");
        ServiceAccount.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //ServiceAccount.setApiKeyPrefix("Token");

        // Configure API key authorization: PersonalAccessToken
        ApiKeyAuth PersonalAccessToken = (ApiKeyAuth) defaultClient.getAuthentication("PersonalAccessToken");
        PersonalAccessToken.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //PersonalAccessToken.setApiKeyPrefix("Token");

        // Configure API key authorization: SessionCookie
        ApiKeyAuth SessionCookie = (ApiKeyAuth) defaultClient.getAuthentication("SessionCookie");
        SessionCookie.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //SessionCookie.setApiKeyPrefix("Token");

        // Create an instance of the API class
        FilesApi apiInstance = new FilesApi();
        String fileId = 5f151efbacbb17001a58f120.png; // String | 拡張子付きのファイル ID
        String type = type_example; // String | `thumbnail` で縮小版を取る。
JPEG と PNG 以外は縮小版を持たず原本が返る。


        try {
            apiInstance.downloadFile(fileId, type);
        } catch (ApiException e) {
            System.err.println("Exception when calling FilesApi#downloadFile");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String fileId = new String(); // String | 拡張子付きのファイル ID
final String type = new String(); // String | `thumbnail` で縮小版を取る。
JPEG と PNG 以外は縮小版を持たず原本が返る。


try {
    final result = await api_instance.downloadFile(fileId, type);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->downloadFile: $e\n');
}

import org.openapitools.client.api.FilesApi;

public class FilesApiExample {
    public static void main(String[] args) {
        FilesApi apiInstance = new FilesApi();
        String fileId = 5f151efbacbb17001a58f120.png; // String | 拡張子付きのファイル ID
        String type = type_example; // String | `thumbnail` で縮小版を取る。
JPEG と PNG 以外は縮小版を持たず原本が返る。


        try {
            apiInstance.downloadFile(fileId, type);
        } catch (ApiException e) {
            System.err.println("Exception when calling FilesApi#downloadFile");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: ServiceAccount)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"x-service-account-access-key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"x-service-account-access-key"];

// Configure API key authorization: (authentication scheme: PersonalAccessToken)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"x-personal-access-token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"x-personal-access-token"];

// Configure API key authorization: (authentication scheme: SessionCookie)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"connect.sid"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"connect.sid"];


// Create an instance of the API class
FilesApi *apiInstance = [[FilesApi alloc] init];
String *fileId = 5f151efbacbb17001a58f120.png; // 拡張子付きのファイル ID (default to null)
String *type = type_example; // `thumbnail` で縮小版を取る。
JPEG と PNG 以外は縮小版を持たず原本が返る。
 (optional) (default to null)

// ファイル本体のダウンロード
[apiInstance downloadFileWith:fileId
    type:type
              completionHandler: ^(NSError* error) {
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var CosenseScrapboxHttpApi = require('cosense__scrapbox_http_api');
var defaultClient = CosenseScrapboxHttpApi.ApiClient.instance;

// Configure API key authorization: ServiceAccount
var ServiceAccount = defaultClient.authentications['ServiceAccount'];
ServiceAccount.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ServiceAccount.apiKeyPrefix['x-service-account-access-key'] = "Token";

// Configure API key authorization: PersonalAccessToken
var PersonalAccessToken = defaultClient.authentications['PersonalAccessToken'];
PersonalAccessToken.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//PersonalAccessToken.apiKeyPrefix['x-personal-access-token'] = "Token";

// Configure API key authorization: SessionCookie
var SessionCookie = defaultClient.authentications['SessionCookie'];
SessionCookie.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SessionCookie.apiKeyPrefix['connect.sid'] = "Token";

// Create an instance of the API class
var api = new CosenseScrapboxHttpApi.FilesApi()
var fileId = 5f151efbacbb17001a58f120.png; // {String} 拡張子付きのファイル ID
var opts = {
  'type': type_example // {String} `thumbnail` で縮小版を取る。
JPEG と PNG 以外は縮小版を持たず原本が返る。

};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.downloadFile(fileId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class downloadFileExample
    {
        public void main()
        {
            // Configure API key authorization: ServiceAccount
            Configuration.Default.ApiKey.Add("x-service-account-access-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("x-service-account-access-key", "Bearer");
            // Configure API key authorization: PersonalAccessToken
            Configuration.Default.ApiKey.Add("x-personal-access-token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("x-personal-access-token", "Bearer");
            // Configure API key authorization: SessionCookie
            Configuration.Default.ApiKey.Add("connect.sid", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("connect.sid", "Bearer");

            // Create an instance of the API class
            var apiInstance = new FilesApi();
            var fileId = 5f151efbacbb17001a58f120.png;  // String | 拡張子付きのファイル ID (default to null)
            var type = type_example;  // String | `thumbnail` で縮小版を取る。
JPEG と PNG 以外は縮小版を持たず原本が返る。
 (optional)  (default to null)

            try {
                // ファイル本体のダウンロード
                apiInstance.downloadFile(fileId, type);
            } catch (Exception e) {
                Debug.Print("Exception when calling FilesApi.downloadFile: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: ServiceAccount
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('x-service-account-access-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-service-account-access-key', 'Bearer');

// Configure API key authorization: PersonalAccessToken
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('x-personal-access-token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-personal-access-token', 'Bearer');

// Configure API key authorization: SessionCookie
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('connect.sid', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('connect.sid', 'Bearer');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\FilesApi();
$fileId = 5f151efbacbb17001a58f120.png; // String | 拡張子付きのファイル ID
$type = type_example; // String | `thumbnail` で縮小版を取る。
JPEG と PNG 以外は縮小版を持たず原本が返る。


try {
    $api_instance->downloadFile($fileId, $type);
} catch (Exception $e) {
    echo 'Exception when calling FilesApi->downloadFile: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::FilesApi;

# Configure API key authorization: ServiceAccount
$WWW::OPenAPIClient::Configuration::api_key->{'x-service-account-access-key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'x-service-account-access-key'} = "Bearer";

# Configure API key authorization: PersonalAccessToken
$WWW::OPenAPIClient::Configuration::api_key->{'x-personal-access-token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'x-personal-access-token'} = "Bearer";

# Configure API key authorization: SessionCookie
$WWW::OPenAPIClient::Configuration::api_key->{'connect.sid'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'connect.sid'} = "Bearer";

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::FilesApi->new();
my $fileId = 5f151efbacbb17001a58f120.png; # String | 拡張子付きのファイル ID
my $type = type_example; # String | `thumbnail` で縮小版を取る。
JPEG と PNG 以外は縮小版を持たず原本が返る。


eval {
    $api_instance->downloadFile(fileId => $fileId, type => $type);
};
if ($@) {
    warn "Exception when calling FilesApi->downloadFile: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ServiceAccount
openapi_client.configuration.api_key['x-service-account-access-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['x-service-account-access-key'] = 'Bearer'

# Configure API key authorization: PersonalAccessToken
openapi_client.configuration.api_key['x-personal-access-token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['x-personal-access-token'] = 'Bearer'

# Configure API key authorization: SessionCookie
openapi_client.configuration.api_key['connect.sid'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['connect.sid'] = 'Bearer'

# Create an instance of the API class
api_instance = openapi_client.FilesApi()
fileId = 5f151efbacbb17001a58f120.png # String | 拡張子付きのファイル ID (default to null)
type = type_example # String | `thumbnail` で縮小版を取る。
JPEG と PNG 以外は縮小版を持たず原本が返る。
 (optional) (default to null)

try:
    # ファイル本体のダウンロード
    api_instance.download_file(fileId, type=type)
except ApiException as e:
    print("Exception when calling FilesApi->downloadFile: %s\n" % e)
extern crate FilesApi;

pub fn main() {
    let fileId = 5f151efbacbb17001a58f120.png; // String
    let type = type_example; // String

    let mut context = FilesApi::Context::default();
    let result = client.downloadFile(fileId, type, &context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Path parameters
Name Description
fileId*
String
拡張子付きのファイル ID
Required
Query parameters
Name Description
type
String
`thumbnail` で縮小版を取る。 JPEG と PNG 以外は縮小版を持たず原本が返る。

Responses

Name Type Format Description
Location URI uri


getFileInfo

アップロードファイルのメタデータ

プロジェクトにアップロードされたファイルのメタデータと、そこから抽出されたテキスト。 **公開プロジェクトのファイルでも無認証では 401 になる。** 存在しない fileId は無認証でも 404 (`File not found.`) が返る。


/gcs/{fileId}/info

Usage and SDK Samples

curl -X GET \
-H "x-service-account-access-key: [[apiKey]]" \
-H "x-personal-access-token: [[apiKey]]" \
 \
 -H "Accept: application/json" \
 "https://scrapbox.io/api/gcs/{fileId}/info"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FilesApi;

import java.io.File;
import java.util.*;

public class FilesApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure API key authorization: ServiceAccount
        ApiKeyAuth ServiceAccount = (ApiKeyAuth) defaultClient.getAuthentication("ServiceAccount");
        ServiceAccount.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //ServiceAccount.setApiKeyPrefix("Token");

        // Configure API key authorization: PersonalAccessToken
        ApiKeyAuth PersonalAccessToken = (ApiKeyAuth) defaultClient.getAuthentication("PersonalAccessToken");
        PersonalAccessToken.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //PersonalAccessToken.setApiKeyPrefix("Token");

        // Configure API key authorization: SessionCookie
        ApiKeyAuth SessionCookie = (ApiKeyAuth) defaultClient.getAuthentication("SessionCookie");
        SessionCookie.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //SessionCookie.setApiKeyPrefix("Token");

        // Create an instance of the API class
        FilesApi apiInstance = new FilesApi();
        String fileId = 5f151efbacbb17001a58f120; // String | 24 桁の 16 進数。
`bare_file_id()` が拡張子付きの ID や完全な URL から素の ID を取り出す。


        try {
            FileInfo result = apiInstance.getFileInfo(fileId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FilesApi#getFileInfo");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String fileId = new String(); // String | 24 桁の 16 進数。
`bare_file_id()` が拡張子付きの ID や完全な URL から素の ID を取り出す。


try {
    final result = await api_instance.getFileInfo(fileId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->getFileInfo: $e\n');
}

import org.openapitools.client.api.FilesApi;

public class FilesApiExample {
    public static void main(String[] args) {
        FilesApi apiInstance = new FilesApi();
        String fileId = 5f151efbacbb17001a58f120; // String | 24 桁の 16 進数。
`bare_file_id()` が拡張子付きの ID や完全な URL から素の ID を取り出す。


        try {
            FileInfo result = apiInstance.getFileInfo(fileId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FilesApi#getFileInfo");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: ServiceAccount)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"x-service-account-access-key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"x-service-account-access-key"];

// Configure API key authorization: (authentication scheme: PersonalAccessToken)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"x-personal-access-token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"x-personal-access-token"];

// Configure API key authorization: (authentication scheme: SessionCookie)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"connect.sid"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"connect.sid"];


// Create an instance of the API class
FilesApi *apiInstance = [[FilesApi alloc] init];
String *fileId = 5f151efbacbb17001a58f120; // 24 桁の 16 進数。
`bare_file_id()` が拡張子付きの ID や完全な URL から素の ID を取り出す。
 (default to null)

// アップロードファイルのメタデータ
[apiInstance getFileInfoWith:fileId
              completionHandler: ^(FileInfo output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var CosenseScrapboxHttpApi = require('cosense__scrapbox_http_api');
var defaultClient = CosenseScrapboxHttpApi.ApiClient.instance;

// Configure API key authorization: ServiceAccount
var ServiceAccount = defaultClient.authentications['ServiceAccount'];
ServiceAccount.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ServiceAccount.apiKeyPrefix['x-service-account-access-key'] = "Token";

// Configure API key authorization: PersonalAccessToken
var PersonalAccessToken = defaultClient.authentications['PersonalAccessToken'];
PersonalAccessToken.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//PersonalAccessToken.apiKeyPrefix['x-personal-access-token'] = "Token";

// Configure API key authorization: SessionCookie
var SessionCookie = defaultClient.authentications['SessionCookie'];
SessionCookie.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SessionCookie.apiKeyPrefix['connect.sid'] = "Token";

// Create an instance of the API class
var api = new CosenseScrapboxHttpApi.FilesApi()
var fileId = 5f151efbacbb17001a58f120; // {String} 24 桁の 16 進数。
`bare_file_id()` が拡張子付きの ID や完全な URL から素の ID を取り出す。


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getFileInfo(fileId, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class getFileInfoExample
    {
        public void main()
        {
            // Configure API key authorization: ServiceAccount
            Configuration.Default.ApiKey.Add("x-service-account-access-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("x-service-account-access-key", "Bearer");
            // Configure API key authorization: PersonalAccessToken
            Configuration.Default.ApiKey.Add("x-personal-access-token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("x-personal-access-token", "Bearer");
            // Configure API key authorization: SessionCookie
            Configuration.Default.ApiKey.Add("connect.sid", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("connect.sid", "Bearer");

            // Create an instance of the API class
            var apiInstance = new FilesApi();
            var fileId = 5f151efbacbb17001a58f120;  // String | 24 桁の 16 進数。
`bare_file_id()` が拡張子付きの ID や完全な URL から素の ID を取り出す。
 (default to null)

            try {
                // アップロードファイルのメタデータ
                FileInfo result = apiInstance.getFileInfo(fileId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling FilesApi.getFileInfo: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: ServiceAccount
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('x-service-account-access-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-service-account-access-key', 'Bearer');

// Configure API key authorization: PersonalAccessToken
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('x-personal-access-token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-personal-access-token', 'Bearer');

// Configure API key authorization: SessionCookie
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('connect.sid', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('connect.sid', 'Bearer');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\FilesApi();
$fileId = 5f151efbacbb17001a58f120; // String | 24 桁の 16 進数。
`bare_file_id()` が拡張子付きの ID や完全な URL から素の ID を取り出す。


try {
    $result = $api_instance->getFileInfo($fileId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FilesApi->getFileInfo: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::FilesApi;

# Configure API key authorization: ServiceAccount
$WWW::OPenAPIClient::Configuration::api_key->{'x-service-account-access-key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'x-service-account-access-key'} = "Bearer";

# Configure API key authorization: PersonalAccessToken
$WWW::OPenAPIClient::Configuration::api_key->{'x-personal-access-token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'x-personal-access-token'} = "Bearer";

# Configure API key authorization: SessionCookie
$WWW::OPenAPIClient::Configuration::api_key->{'connect.sid'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'connect.sid'} = "Bearer";

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::FilesApi->new();
my $fileId = 5f151efbacbb17001a58f120; # String | 24 桁の 16 進数。
`bare_file_id()` が拡張子付きの ID や完全な URL から素の ID を取り出す。


eval {
    my $result = $api_instance->getFileInfo(fileId => $fileId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling FilesApi->getFileInfo: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ServiceAccount
openapi_client.configuration.api_key['x-service-account-access-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['x-service-account-access-key'] = 'Bearer'

# Configure API key authorization: PersonalAccessToken
openapi_client.configuration.api_key['x-personal-access-token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['x-personal-access-token'] = 'Bearer'

# Configure API key authorization: SessionCookie
openapi_client.configuration.api_key['connect.sid'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['connect.sid'] = 'Bearer'

# Create an instance of the API class
api_instance = openapi_client.FilesApi()
fileId = 5f151efbacbb17001a58f120 # String | 24 桁の 16 進数。
`bare_file_id()` が拡張子付きの ID や完全な URL から素の ID を取り出す。
 (default to null)

try:
    # アップロードファイルのメタデータ
    api_response = api_instance.get_file_info(fileId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling FilesApi->getFileInfo: %s\n" % e)
extern crate FilesApi;

pub fn main() {
    let fileId = 5f151efbacbb17001a58f120; // String

    let mut context = FilesApi::Context::default();
    let result = client.getFileInfo(fileId, &context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Path parameters
Name Description
fileId*
String
24 桁の 16 進数。 `bare_file_id()` が拡張子付きの ID や完全な URL から素の ID を取り出す。
Required

Responses


getGyazoOEmbed

Gyazo の oEmbed を中継する

`get_file()` に Gyazo の URL を渡し、その URL に拡張子が無いときだけ叩く。 拡張子があれば oEmbed を経ずに `https://i.gyazo.com/<path>` へ直接組み替える。 `type` が `video` の場合、oEmbed の `url` は返らない。 `get_file()` は元 URL の hash から `https://i.gyazo.com/<hash>.mp4` を組み立てる。 数値 field は空文字で返ることがあり、`GyazoOEmbedBase` の `field_validator` が 空文字を `None` に、数値文字列を数値に正規化する。 **エラーの形が `/api/` の他のエンドポイントと違い、`name` field を持たない。**


/oembed-proxy/gyazo

Usage and SDK Samples

curl -X GET \
 -H "Accept: application/json" \
 "https://scrapbox.io/api/oembed-proxy/gyazo?url=https://gyazo.com/07a850cf5f1404b494507cc6ec95b1b3"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FilesApi;

import java.io.File;
import java.util.*;

public class FilesApiExample {
    public static void main(String[] args) {

        // Create an instance of the API class
        FilesApi apiInstance = new FilesApi();
        URI url = https://gyazo.com/07a850cf5f1404b494507cc6ec95b1b3; // URI | `https://gyazo.com/`(hash は 32 桁 16 進数)

        try {
            GyazoOEmbedResponse result = apiInstance.getGyazoOEmbed(url);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FilesApi#getGyazoOEmbed");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final URI url = new URI(); // URI | `https://gyazo.com/`(hash は 32 桁 16 進数)

try {
    final result = await api_instance.getGyazoOEmbed(url);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->getGyazoOEmbed: $e\n');
}

import org.openapitools.client.api.FilesApi;

public class FilesApiExample {
    public static void main(String[] args) {
        FilesApi apiInstance = new FilesApi();
        URI url = https://gyazo.com/07a850cf5f1404b494507cc6ec95b1b3; // URI | `https://gyazo.com/`(hash は 32 桁 16 進数)

        try {
            GyazoOEmbedResponse result = apiInstance.getGyazoOEmbed(url);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FilesApi#getGyazoOEmbed");
            e.printStackTrace();
        }
    }
}


// Create an instance of the API class
FilesApi *apiInstance = [[FilesApi alloc] init];
URI *url = https://gyazo.com/07a850cf5f1404b494507cc6ec95b1b3; // `https://gyazo.com/`(hash は 32 桁 16 進数) (default to null)

// Gyazo の oEmbed を中継する
[apiInstance getGyazoOEmbedWith:url
              completionHandler: ^(GyazoOEmbedResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var CosenseScrapboxHttpApi = require('cosense__scrapbox_http_api');

// Create an instance of the API class
var api = new CosenseScrapboxHttpApi.FilesApi()
var url = https://gyazo.com/07a850cf5f1404b494507cc6ec95b1b3; // {URI} `https://gyazo.com/`(hash は 32 桁 16 進数)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getGyazoOEmbed(url, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class getGyazoOEmbedExample
    {
        public void main()
        {

            // Create an instance of the API class
            var apiInstance = new FilesApi();
            var url = https://gyazo.com/07a850cf5f1404b494507cc6ec95b1b3;  // URI | `https://gyazo.com/`(hash は 32 桁 16 進数) (default to null)

            try {
                // Gyazo の oEmbed を中継する
                GyazoOEmbedResponse result = apiInstance.getGyazoOEmbed(url);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling FilesApi.getGyazoOEmbed: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\FilesApi();
$url = https://gyazo.com/07a850cf5f1404b494507cc6ec95b1b3; // URI | `https://gyazo.com/`(hash は 32 桁 16 進数)

try {
    $result = $api_instance->getGyazoOEmbed($url);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FilesApi->getGyazoOEmbed: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::FilesApi;

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::FilesApi->new();
my $url = https://gyazo.com/07a850cf5f1404b494507cc6ec95b1b3; # URI | `https://gyazo.com/`(hash は 32 桁 16 進数)

eval {
    my $result = $api_instance->getGyazoOEmbed(url => $url);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling FilesApi->getGyazoOEmbed: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Create an instance of the API class
api_instance = openapi_client.FilesApi()
url = https://gyazo.com/07a850cf5f1404b494507cc6ec95b1b3 # URI | `https://gyazo.com/`(hash は 32 桁 16 進数) (default to null)

try:
    # Gyazo の oEmbed を中継する
    api_response = api_instance.get_gyazo_o_embed(url)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling FilesApi->getGyazoOEmbed: %s\n" % e)
extern crate FilesApi;

pub fn main() {
    let url = https://gyazo.com/07a850cf5f1404b494507cc6ec95b1b3; // URI

    let mut context = FilesApi::Context::default();
    let result = client.getGyazoOEmbed(url, &context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Query parameters
Name Description
url*
URI (uri)
`https://gyazo.com/<hash>`(hash は 32 桁 16 進数)
Required

Responses


History

getCommits

ページの編集履歴

タイトルではなく pageId 起点なので、リネームをまたいで追跡できる。 **公開プロジェクトでも無認証では 401 になる。**


/commits/{projectName}/{pageId}

Usage and SDK Samples

curl -X GET \
-H "x-service-account-access-key: [[apiKey]]" \
-H "x-personal-access-token: [[apiKey]]" \
 \
 -H "Accept: application/json" \
 "https://scrapbox.io/api/commits/{projectName}/{pageId}?head=head_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.HistoryApi;

import java.io.File;
import java.util.*;

public class HistoryApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure API key authorization: ServiceAccount
        ApiKeyAuth ServiceAccount = (ApiKeyAuth) defaultClient.getAuthentication("ServiceAccount");
        ServiceAccount.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //ServiceAccount.setApiKeyPrefix("Token");

        // Configure API key authorization: PersonalAccessToken
        ApiKeyAuth PersonalAccessToken = (ApiKeyAuth) defaultClient.getAuthentication("PersonalAccessToken");
        PersonalAccessToken.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //PersonalAccessToken.setApiKeyPrefix("Token");

        // Configure API key authorization: SessionCookie
        ApiKeyAuth SessionCookie = (ApiKeyAuth) defaultClient.getAuthentication("SessionCookie");
        SessionCookie.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //SessionCookie.setApiKeyPrefix("Token");

        // Create an instance of the API class
        HistoryApi apiInstance = new HistoryApi();
        String projectName = help-jp; // String | プロジェクト名(URL に使われる `name`)
        String pageId = 6a78192b3a6ddc39bdf42b47; // String | ページの不変 ID
        String head = head_example; // String | commitId。これより後の commit だけを返すカーソル。省略時は全履歴。
クライアントでは `since=` に対応する。


        try {
            CommitsResponse result = apiInstance.getCommits(projectName, pageId, head);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling HistoryApi#getCommits");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String projectName = new String(); // String | プロジェクト名(URL に使われる `name`)
final String pageId = new String(); // String | ページの不変 ID
final String head = new String(); // String | commitId。これより後の commit だけを返すカーソル。省略時は全履歴。
クライアントでは `since=` に対応する。


try {
    final result = await api_instance.getCommits(projectName, pageId, head);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->getCommits: $e\n');
}

import org.openapitools.client.api.HistoryApi;

public class HistoryApiExample {
    public static void main(String[] args) {
        HistoryApi apiInstance = new HistoryApi();
        String projectName = help-jp; // String | プロジェクト名(URL に使われる `name`)
        String pageId = 6a78192b3a6ddc39bdf42b47; // String | ページの不変 ID
        String head = head_example; // String | commitId。これより後の commit だけを返すカーソル。省略時は全履歴。
クライアントでは `since=` に対応する。


        try {
            CommitsResponse result = apiInstance.getCommits(projectName, pageId, head);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling HistoryApi#getCommits");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: ServiceAccount)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"x-service-account-access-key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"x-service-account-access-key"];

// Configure API key authorization: (authentication scheme: PersonalAccessToken)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"x-personal-access-token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"x-personal-access-token"];

// Configure API key authorization: (authentication scheme: SessionCookie)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"connect.sid"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"connect.sid"];


// Create an instance of the API class
HistoryApi *apiInstance = [[HistoryApi alloc] init];
String *projectName = help-jp; // プロジェクト名(URL に使われる `name`) (default to null)
String *pageId = 6a78192b3a6ddc39bdf42b47; // ページの不変 ID (default to null)
String *head = head_example; // commitId。これより後の commit だけを返すカーソル。省略時は全履歴。
クライアントでは `since=` に対応する。
 (optional) (default to null)

// ページの編集履歴
[apiInstance getCommitsWith:projectName
    pageId:pageId
    head:head
              completionHandler: ^(CommitsResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var CosenseScrapboxHttpApi = require('cosense__scrapbox_http_api');
var defaultClient = CosenseScrapboxHttpApi.ApiClient.instance;

// Configure API key authorization: ServiceAccount
var ServiceAccount = defaultClient.authentications['ServiceAccount'];
ServiceAccount.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ServiceAccount.apiKeyPrefix['x-service-account-access-key'] = "Token";

// Configure API key authorization: PersonalAccessToken
var PersonalAccessToken = defaultClient.authentications['PersonalAccessToken'];
PersonalAccessToken.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//PersonalAccessToken.apiKeyPrefix['x-personal-access-token'] = "Token";

// Configure API key authorization: SessionCookie
var SessionCookie = defaultClient.authentications['SessionCookie'];
SessionCookie.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SessionCookie.apiKeyPrefix['connect.sid'] = "Token";

// Create an instance of the API class
var api = new CosenseScrapboxHttpApi.HistoryApi()
var projectName = help-jp; // {String} プロジェクト名(URL に使われる `name`)
var pageId = 6a78192b3a6ddc39bdf42b47; // {String} ページの不変 ID
var opts = {
  'head': head_example // {String} commitId。これより後の commit だけを返すカーソル。省略時は全履歴。
クライアントでは `since=` に対応する。

};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getCommits(projectName, pageId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class getCommitsExample
    {
        public void main()
        {
            // Configure API key authorization: ServiceAccount
            Configuration.Default.ApiKey.Add("x-service-account-access-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("x-service-account-access-key", "Bearer");
            // Configure API key authorization: PersonalAccessToken
            Configuration.Default.ApiKey.Add("x-personal-access-token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("x-personal-access-token", "Bearer");
            // Configure API key authorization: SessionCookie
            Configuration.Default.ApiKey.Add("connect.sid", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("connect.sid", "Bearer");

            // Create an instance of the API class
            var apiInstance = new HistoryApi();
            var projectName = help-jp;  // String | プロジェクト名(URL に使われる `name`) (default to null)
            var pageId = 6a78192b3a6ddc39bdf42b47;  // String | ページの不変 ID (default to null)
            var head = head_example;  // String | commitId。これより後の commit だけを返すカーソル。省略時は全履歴。
クライアントでは `since=` に対応する。
 (optional)  (default to null)

            try {
                // ページの編集履歴
                CommitsResponse result = apiInstance.getCommits(projectName, pageId, head);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling HistoryApi.getCommits: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: ServiceAccount
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('x-service-account-access-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-service-account-access-key', 'Bearer');

// Configure API key authorization: PersonalAccessToken
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('x-personal-access-token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-personal-access-token', 'Bearer');

// Configure API key authorization: SessionCookie
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('connect.sid', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('connect.sid', 'Bearer');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\HistoryApi();
$projectName = help-jp; // String | プロジェクト名(URL に使われる `name`)
$pageId = 6a78192b3a6ddc39bdf42b47; // String | ページの不変 ID
$head = head_example; // String | commitId。これより後の commit だけを返すカーソル。省略時は全履歴。
クライアントでは `since=` に対応する。


try {
    $result = $api_instance->getCommits($projectName, $pageId, $head);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling HistoryApi->getCommits: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::HistoryApi;

# Configure API key authorization: ServiceAccount
$WWW::OPenAPIClient::Configuration::api_key->{'x-service-account-access-key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'x-service-account-access-key'} = "Bearer";

# Configure API key authorization: PersonalAccessToken
$WWW::OPenAPIClient::Configuration::api_key->{'x-personal-access-token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'x-personal-access-token'} = "Bearer";

# Configure API key authorization: SessionCookie
$WWW::OPenAPIClient::Configuration::api_key->{'connect.sid'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'connect.sid'} = "Bearer";

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::HistoryApi->new();
my $projectName = help-jp; # String | プロジェクト名(URL に使われる `name`)
my $pageId = 6a78192b3a6ddc39bdf42b47; # String | ページの不変 ID
my $head = head_example; # String | commitId。これより後の commit だけを返すカーソル。省略時は全履歴。
クライアントでは `since=` に対応する。


eval {
    my $result = $api_instance->getCommits(projectName => $projectName, pageId => $pageId, head => $head);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling HistoryApi->getCommits: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ServiceAccount
openapi_client.configuration.api_key['x-service-account-access-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['x-service-account-access-key'] = 'Bearer'

# Configure API key authorization: PersonalAccessToken
openapi_client.configuration.api_key['x-personal-access-token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['x-personal-access-token'] = 'Bearer'

# Configure API key authorization: SessionCookie
openapi_client.configuration.api_key['connect.sid'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['connect.sid'] = 'Bearer'

# Create an instance of the API class
api_instance = openapi_client.HistoryApi()
projectName = help-jp # String | プロジェクト名(URL に使われる `name`) (default to null)
pageId = 6a78192b3a6ddc39bdf42b47 # String | ページの不変 ID (default to null)
head = head_example # String | commitId。これより後の commit だけを返すカーソル。省略時は全履歴。
クライアントでは `since=` に対応する。
 (optional) (default to null)

try:
    # ページの編集履歴
    api_response = api_instance.get_commits(projectName, pageId, head=head)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling HistoryApi->getCommits: %s\n" % e)
extern crate HistoryApi;

pub fn main() {
    let projectName = help-jp; // String
    let pageId = 6a78192b3a6ddc39bdf42b47; // String
    let head = head_example; // String

    let mut context = HistoryApi::Context::default();
    let result = client.getCommits(projectName, pageId, head, &context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Path parameters
Name Description
projectName*
String
プロジェクト名(URL に使われる `name`)
Required
pageId*
String
ページの不変 ID
Required
Query parameters
Name Description
head
String
commitId。これより後の commit だけを返すカーソル。省略時は全履歴。 クライアントでは `since=` に対応する。

Responses


Pages

getPage

単一ページ(v1)

本文とメタデータ。 v2 との違いは、関連ページ (`relatedPages`) を同梱する代わりに正規化 field (`linksLc` / `iconsLc` / `projectLinksLc`) を持たないことだけである。 **存在しないページの扱いが二通りある。** 被リンクを持つページは実体が無くても 200 で返る。 その場合 `persistent` は false、`commitId` / `linesCount` / `charsCount` は key ごと落ち、`id` と `lines[].id` にはリクエストのたびに変わる仮の値が入る。 この仮の ID は編集の anchor には使えない。 被リンクも無い完全な未作成ページは 404 になる。


/pages/{projectName}/{encodedTitle}

Usage and SDK Samples

curl -X GET \
-H "x-service-account-access-key: [[apiKey]]" \
-H "x-personal-access-token: [[apiKey]]" \
 \
 -H "Accept: application/json" \
 "https://scrapbox.io/api/pages/{projectName}/{encodedTitle}"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PagesApi;

import java.io.File;
import java.util.*;

public class PagesApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure API key authorization: ServiceAccount
        ApiKeyAuth ServiceAccount = (ApiKeyAuth) defaultClient.getAuthentication("ServiceAccount");
        ServiceAccount.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //ServiceAccount.setApiKeyPrefix("Token");

        // Configure API key authorization: PersonalAccessToken
        ApiKeyAuth PersonalAccessToken = (ApiKeyAuth) defaultClient.getAuthentication("PersonalAccessToken");
        PersonalAccessToken.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //PersonalAccessToken.setApiKeyPrefix("Token");

        // Configure API key authorization: SessionCookie
        ApiKeyAuth SessionCookie = (ApiKeyAuth) defaultClient.getAuthentication("SessionCookie");
        SessionCookie.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //SessionCookie.setApiKeyPrefix("Token");

        // Create an instance of the API class
        PagesApi apiInstance = new PagesApi();
        String projectName = help-jp; // String | プロジェクト名(URL に使われる `name`)
        String encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0; // String | ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。


        try {
            PageDetail result = apiInstance.getPage(projectName, encodedTitle);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PagesApi#getPage");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String projectName = new String(); // String | プロジェクト名(URL に使われる `name`)
final String encodedTitle = new String(); // String | ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。


try {
    final result = await api_instance.getPage(projectName, encodedTitle);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->getPage: $e\n');
}

import org.openapitools.client.api.PagesApi;

public class PagesApiExample {
    public static void main(String[] args) {
        PagesApi apiInstance = new PagesApi();
        String projectName = help-jp; // String | プロジェクト名(URL に使われる `name`)
        String encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0; // String | ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。


        try {
            PageDetail result = apiInstance.getPage(projectName, encodedTitle);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PagesApi#getPage");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: ServiceAccount)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"x-service-account-access-key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"x-service-account-access-key"];

// Configure API key authorization: (authentication scheme: PersonalAccessToken)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"x-personal-access-token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"x-personal-access-token"];

// Configure API key authorization: (authentication scheme: SessionCookie)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"connect.sid"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"connect.sid"];


// Create an instance of the API class
PagesApi *apiInstance = [[PagesApi alloc] init];
String *projectName = help-jp; // プロジェクト名(URL に使われる `name`) (default to null)
String *encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0; // ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。
 (default to null)

// 単一ページ(v1)
[apiInstance getPageWith:projectName
    encodedTitle:encodedTitle
              completionHandler: ^(PageDetail output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var CosenseScrapboxHttpApi = require('cosense__scrapbox_http_api');
var defaultClient = CosenseScrapboxHttpApi.ApiClient.instance;

// Configure API key authorization: ServiceAccount
var ServiceAccount = defaultClient.authentications['ServiceAccount'];
ServiceAccount.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ServiceAccount.apiKeyPrefix['x-service-account-access-key'] = "Token";

// Configure API key authorization: PersonalAccessToken
var PersonalAccessToken = defaultClient.authentications['PersonalAccessToken'];
PersonalAccessToken.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//PersonalAccessToken.apiKeyPrefix['x-personal-access-token'] = "Token";

// Configure API key authorization: SessionCookie
var SessionCookie = defaultClient.authentications['SessionCookie'];
SessionCookie.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SessionCookie.apiKeyPrefix['connect.sid'] = "Token";

// Create an instance of the API class
var api = new CosenseScrapboxHttpApi.PagesApi()
var projectName = help-jp; // {String} プロジェクト名(URL に使われる `name`)
var encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0; // {String} ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getPage(projectName, encodedTitle, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class getPageExample
    {
        public void main()
        {
            // Configure API key authorization: ServiceAccount
            Configuration.Default.ApiKey.Add("x-service-account-access-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("x-service-account-access-key", "Bearer");
            // Configure API key authorization: PersonalAccessToken
            Configuration.Default.ApiKey.Add("x-personal-access-token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("x-personal-access-token", "Bearer");
            // Configure API key authorization: SessionCookie
            Configuration.Default.ApiKey.Add("connect.sid", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("connect.sid", "Bearer");

            // Create an instance of the API class
            var apiInstance = new PagesApi();
            var projectName = help-jp;  // String | プロジェクト名(URL に使われる `name`) (default to null)
            var encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0;  // String | ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。
 (default to null)

            try {
                // 単一ページ(v1)
                PageDetail result = apiInstance.getPage(projectName, encodedTitle);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling PagesApi.getPage: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: ServiceAccount
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('x-service-account-access-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-service-account-access-key', 'Bearer');

// Configure API key authorization: PersonalAccessToken
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('x-personal-access-token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-personal-access-token', 'Bearer');

// Configure API key authorization: SessionCookie
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('connect.sid', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('connect.sid', 'Bearer');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\PagesApi();
$projectName = help-jp; // String | プロジェクト名(URL に使われる `name`)
$encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0; // String | ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。


try {
    $result = $api_instance->getPage($projectName, $encodedTitle);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PagesApi->getPage: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::PagesApi;

# Configure API key authorization: ServiceAccount
$WWW::OPenAPIClient::Configuration::api_key->{'x-service-account-access-key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'x-service-account-access-key'} = "Bearer";

# Configure API key authorization: PersonalAccessToken
$WWW::OPenAPIClient::Configuration::api_key->{'x-personal-access-token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'x-personal-access-token'} = "Bearer";

# Configure API key authorization: SessionCookie
$WWW::OPenAPIClient::Configuration::api_key->{'connect.sid'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'connect.sid'} = "Bearer";

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::PagesApi->new();
my $projectName = help-jp; # String | プロジェクト名(URL に使われる `name`)
my $encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0; # String | ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。


eval {
    my $result = $api_instance->getPage(projectName => $projectName, encodedTitle => $encodedTitle);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling PagesApi->getPage: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ServiceAccount
openapi_client.configuration.api_key['x-service-account-access-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['x-service-account-access-key'] = 'Bearer'

# Configure API key authorization: PersonalAccessToken
openapi_client.configuration.api_key['x-personal-access-token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['x-personal-access-token'] = 'Bearer'

# Configure API key authorization: SessionCookie
openapi_client.configuration.api_key['connect.sid'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['connect.sid'] = 'Bearer'

# Create an instance of the API class
api_instance = openapi_client.PagesApi()
projectName = help-jp # String | プロジェクト名(URL に使われる `name`) (default to null)
encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0 # String | ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。
 (default to null)

try:
    # 単一ページ(v1)
    api_response = api_instance.get_page(projectName, encodedTitle)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PagesApi->getPage: %s\n" % e)
extern crate PagesApi;

pub fn main() {
    let projectName = help-jp; // String
    let encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0; // String

    let mut context = PagesApi::Context::default();
    let result = client.getPage(projectName, encodedTitle, &context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Path parameters
Name Description
projectName*
String
プロジェクト名(URL に使われる `name`)
Required
encodedTitle*
String
ページタイトル。 サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、 クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も すべて percent-encode する。 空白は `%20` でも `_` でも同じページに解決される。 人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、 `%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。
Required

Responses


getPageIcon

ページアイコンへのリダイレクト

画像そのものではなくリダイレクト先の URL が欲しいので、 `get_page_icon_url()` だけは `follow_redirects=False` で叩き `Location` を読む。 リダイレクト先はアイコンの実体によって変わる。 | アイコンの持ち方 | `Location` の例 | | --- | --- | | Gyazo 画像 | `https://gyazo.com/<hash>/max_size/400` | | プロジェクトのアップロードファイル | `https://scrapbox.io/files/<fileId>.png?type=thumbnail&size=small` |


/pages/{projectName}/{encodedTitle}/icon

Usage and SDK Samples

curl -X GET \
-H "x-service-account-access-key: [[apiKey]]" \
-H "x-personal-access-token: [[apiKey]]" \
 \
 -H "Accept: application/json" \
 "https://scrapbox.io/api/pages/{projectName}/{encodedTitle}/icon"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PagesApi;

import java.io.File;
import java.util.*;

public class PagesApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure API key authorization: ServiceAccount
        ApiKeyAuth ServiceAccount = (ApiKeyAuth) defaultClient.getAuthentication("ServiceAccount");
        ServiceAccount.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //ServiceAccount.setApiKeyPrefix("Token");

        // Configure API key authorization: PersonalAccessToken
        ApiKeyAuth PersonalAccessToken = (ApiKeyAuth) defaultClient.getAuthentication("PersonalAccessToken");
        PersonalAccessToken.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //PersonalAccessToken.setApiKeyPrefix("Token");

        // Configure API key authorization: SessionCookie
        ApiKeyAuth SessionCookie = (ApiKeyAuth) defaultClient.getAuthentication("SessionCookie");
        SessionCookie.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //SessionCookie.setApiKeyPrefix("Token");

        // Create an instance of the API class
        PagesApi apiInstance = new PagesApi();
        String projectName = help-jp; // String | プロジェクト名(URL に使われる `name`)
        String encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0; // String | ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。


        try {
            apiInstance.getPageIcon(projectName, encodedTitle);
        } catch (ApiException e) {
            System.err.println("Exception when calling PagesApi#getPageIcon");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String projectName = new String(); // String | プロジェクト名(URL に使われる `name`)
final String encodedTitle = new String(); // String | ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。


try {
    final result = await api_instance.getPageIcon(projectName, encodedTitle);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->getPageIcon: $e\n');
}

import org.openapitools.client.api.PagesApi;

public class PagesApiExample {
    public static void main(String[] args) {
        PagesApi apiInstance = new PagesApi();
        String projectName = help-jp; // String | プロジェクト名(URL に使われる `name`)
        String encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0; // String | ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。


        try {
            apiInstance.getPageIcon(projectName, encodedTitle);
        } catch (ApiException e) {
            System.err.println("Exception when calling PagesApi#getPageIcon");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: ServiceAccount)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"x-service-account-access-key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"x-service-account-access-key"];

// Configure API key authorization: (authentication scheme: PersonalAccessToken)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"x-personal-access-token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"x-personal-access-token"];

// Configure API key authorization: (authentication scheme: SessionCookie)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"connect.sid"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"connect.sid"];


// Create an instance of the API class
PagesApi *apiInstance = [[PagesApi alloc] init];
String *projectName = help-jp; // プロジェクト名(URL に使われる `name`) (default to null)
String *encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0; // ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。
 (default to null)

// ページアイコンへのリダイレクト
[apiInstance getPageIconWith:projectName
    encodedTitle:encodedTitle
              completionHandler: ^(NSError* error) {
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var CosenseScrapboxHttpApi = require('cosense__scrapbox_http_api');
var defaultClient = CosenseScrapboxHttpApi.ApiClient.instance;

// Configure API key authorization: ServiceAccount
var ServiceAccount = defaultClient.authentications['ServiceAccount'];
ServiceAccount.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ServiceAccount.apiKeyPrefix['x-service-account-access-key'] = "Token";

// Configure API key authorization: PersonalAccessToken
var PersonalAccessToken = defaultClient.authentications['PersonalAccessToken'];
PersonalAccessToken.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//PersonalAccessToken.apiKeyPrefix['x-personal-access-token'] = "Token";

// Configure API key authorization: SessionCookie
var SessionCookie = defaultClient.authentications['SessionCookie'];
SessionCookie.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SessionCookie.apiKeyPrefix['connect.sid'] = "Token";

// Create an instance of the API class
var api = new CosenseScrapboxHttpApi.PagesApi()
var projectName = help-jp; // {String} プロジェクト名(URL に使われる `name`)
var encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0; // {String} ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.getPageIcon(projectName, encodedTitle, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class getPageIconExample
    {
        public void main()
        {
            // Configure API key authorization: ServiceAccount
            Configuration.Default.ApiKey.Add("x-service-account-access-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("x-service-account-access-key", "Bearer");
            // Configure API key authorization: PersonalAccessToken
            Configuration.Default.ApiKey.Add("x-personal-access-token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("x-personal-access-token", "Bearer");
            // Configure API key authorization: SessionCookie
            Configuration.Default.ApiKey.Add("connect.sid", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("connect.sid", "Bearer");

            // Create an instance of the API class
            var apiInstance = new PagesApi();
            var projectName = help-jp;  // String | プロジェクト名(URL に使われる `name`) (default to null)
            var encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0;  // String | ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。
 (default to null)

            try {
                // ページアイコンへのリダイレクト
                apiInstance.getPageIcon(projectName, encodedTitle);
            } catch (Exception e) {
                Debug.Print("Exception when calling PagesApi.getPageIcon: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: ServiceAccount
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('x-service-account-access-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-service-account-access-key', 'Bearer');

// Configure API key authorization: PersonalAccessToken
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('x-personal-access-token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-personal-access-token', 'Bearer');

// Configure API key authorization: SessionCookie
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('connect.sid', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('connect.sid', 'Bearer');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\PagesApi();
$projectName = help-jp; // String | プロジェクト名(URL に使われる `name`)
$encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0; // String | ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。


try {
    $api_instance->getPageIcon($projectName, $encodedTitle);
} catch (Exception $e) {
    echo 'Exception when calling PagesApi->getPageIcon: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::PagesApi;

# Configure API key authorization: ServiceAccount
$WWW::OPenAPIClient::Configuration::api_key->{'x-service-account-access-key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'x-service-account-access-key'} = "Bearer";

# Configure API key authorization: PersonalAccessToken
$WWW::OPenAPIClient::Configuration::api_key->{'x-personal-access-token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'x-personal-access-token'} = "Bearer";

# Configure API key authorization: SessionCookie
$WWW::OPenAPIClient::Configuration::api_key->{'connect.sid'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'connect.sid'} = "Bearer";

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::PagesApi->new();
my $projectName = help-jp; # String | プロジェクト名(URL に使われる `name`)
my $encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0; # String | ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。


eval {
    $api_instance->getPageIcon(projectName => $projectName, encodedTitle => $encodedTitle);
};
if ($@) {
    warn "Exception when calling PagesApi->getPageIcon: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ServiceAccount
openapi_client.configuration.api_key['x-service-account-access-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['x-service-account-access-key'] = 'Bearer'

# Configure API key authorization: PersonalAccessToken
openapi_client.configuration.api_key['x-personal-access-token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['x-personal-access-token'] = 'Bearer'

# Configure API key authorization: SessionCookie
openapi_client.configuration.api_key['connect.sid'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['connect.sid'] = 'Bearer'

# Create an instance of the API class
api_instance = openapi_client.PagesApi()
projectName = help-jp # String | プロジェクト名(URL に使われる `name`) (default to null)
encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0 # String | ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。
 (default to null)

try:
    # ページアイコンへのリダイレクト
    api_instance.get_page_icon(projectName, encodedTitle)
except ApiException as e:
    print("Exception when calling PagesApi->getPageIcon: %s\n" % e)
extern crate PagesApi;

pub fn main() {
    let projectName = help-jp; // String
    let encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0; // String

    let mut context = PagesApi::Context::default();
    let result = client.getPageIcon(projectName, encodedTitle, &context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Path parameters
Name Description
projectName*
String
プロジェクト名(URL に使われる `name`)
Required
encodedTitle*
String
ページタイトル。 サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、 クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も すべて percent-encode する。 空白は `%20` でも `_` でも同じページに解決される。 人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、 `%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。
Required

Responses

Name Type Format Description
Location URI uri


getPageText

ページ本文のプレーンテキスト

`/api/` 配下で唯一 JSON を返さないエンドポイント。 1 行目はページタイトル、2 行目以降が本文になる。


/pages/{projectName}/{encodedTitle}/text

Usage and SDK Samples

curl -X GET \
-H "x-service-account-access-key: [[apiKey]]" \
-H "x-personal-access-token: [[apiKey]]" \
 \
 -H "Accept: text/plain,application/json" \
 "https://scrapbox.io/api/pages/{projectName}/{encodedTitle}/text"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PagesApi;

import java.io.File;
import java.util.*;

public class PagesApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure API key authorization: ServiceAccount
        ApiKeyAuth ServiceAccount = (ApiKeyAuth) defaultClient.getAuthentication("ServiceAccount");
        ServiceAccount.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //ServiceAccount.setApiKeyPrefix("Token");

        // Configure API key authorization: PersonalAccessToken
        ApiKeyAuth PersonalAccessToken = (ApiKeyAuth) defaultClient.getAuthentication("PersonalAccessToken");
        PersonalAccessToken.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //PersonalAccessToken.setApiKeyPrefix("Token");

        // Configure API key authorization: SessionCookie
        ApiKeyAuth SessionCookie = (ApiKeyAuth) defaultClient.getAuthentication("SessionCookie");
        SessionCookie.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //SessionCookie.setApiKeyPrefix("Token");

        // Create an instance of the API class
        PagesApi apiInstance = new PagesApi();
        String projectName = help-jp; // String | プロジェクト名(URL に使われる `name`)
        String encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0; // String | ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。


        try {
            'String' result = apiInstance.getPageText(projectName, encodedTitle);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PagesApi#getPageText");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String projectName = new String(); // String | プロジェクト名(URL に使われる `name`)
final String encodedTitle = new String(); // String | ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。


try {
    final result = await api_instance.getPageText(projectName, encodedTitle);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->getPageText: $e\n');
}

import org.openapitools.client.api.PagesApi;

public class PagesApiExample {
    public static void main(String[] args) {
        PagesApi apiInstance = new PagesApi();
        String projectName = help-jp; // String | プロジェクト名(URL に使われる `name`)
        String encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0; // String | ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。


        try {
            'String' result = apiInstance.getPageText(projectName, encodedTitle);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PagesApi#getPageText");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: ServiceAccount)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"x-service-account-access-key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"x-service-account-access-key"];

// Configure API key authorization: (authentication scheme: PersonalAccessToken)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"x-personal-access-token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"x-personal-access-token"];

// Configure API key authorization: (authentication scheme: SessionCookie)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"connect.sid"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"connect.sid"];


// Create an instance of the API class
PagesApi *apiInstance = [[PagesApi alloc] init];
String *projectName = help-jp; // プロジェクト名(URL に使われる `name`) (default to null)
String *encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0; // ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。
 (default to null)

// ページ本文のプレーンテキスト
[apiInstance getPageTextWith:projectName
    encodedTitle:encodedTitle
              completionHandler: ^('String' output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var CosenseScrapboxHttpApi = require('cosense__scrapbox_http_api');
var defaultClient = CosenseScrapboxHttpApi.ApiClient.instance;

// Configure API key authorization: ServiceAccount
var ServiceAccount = defaultClient.authentications['ServiceAccount'];
ServiceAccount.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ServiceAccount.apiKeyPrefix['x-service-account-access-key'] = "Token";

// Configure API key authorization: PersonalAccessToken
var PersonalAccessToken = defaultClient.authentications['PersonalAccessToken'];
PersonalAccessToken.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//PersonalAccessToken.apiKeyPrefix['x-personal-access-token'] = "Token";

// Configure API key authorization: SessionCookie
var SessionCookie = defaultClient.authentications['SessionCookie'];
SessionCookie.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SessionCookie.apiKeyPrefix['connect.sid'] = "Token";

// Create an instance of the API class
var api = new CosenseScrapboxHttpApi.PagesApi()
var projectName = help-jp; // {String} プロジェクト名(URL に使われる `name`)
var encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0; // {String} ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getPageText(projectName, encodedTitle, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class getPageTextExample
    {
        public void main()
        {
            // Configure API key authorization: ServiceAccount
            Configuration.Default.ApiKey.Add("x-service-account-access-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("x-service-account-access-key", "Bearer");
            // Configure API key authorization: PersonalAccessToken
            Configuration.Default.ApiKey.Add("x-personal-access-token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("x-personal-access-token", "Bearer");
            // Configure API key authorization: SessionCookie
            Configuration.Default.ApiKey.Add("connect.sid", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("connect.sid", "Bearer");

            // Create an instance of the API class
            var apiInstance = new PagesApi();
            var projectName = help-jp;  // String | プロジェクト名(URL に使われる `name`) (default to null)
            var encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0;  // String | ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。
 (default to null)

            try {
                // ページ本文のプレーンテキスト
                'String' result = apiInstance.getPageText(projectName, encodedTitle);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling PagesApi.getPageText: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: ServiceAccount
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('x-service-account-access-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-service-account-access-key', 'Bearer');

// Configure API key authorization: PersonalAccessToken
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('x-personal-access-token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-personal-access-token', 'Bearer');

// Configure API key authorization: SessionCookie
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('connect.sid', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('connect.sid', 'Bearer');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\PagesApi();
$projectName = help-jp; // String | プロジェクト名(URL に使われる `name`)
$encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0; // String | ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。


try {
    $result = $api_instance->getPageText($projectName, $encodedTitle);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PagesApi->getPageText: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::PagesApi;

# Configure API key authorization: ServiceAccount
$WWW::OPenAPIClient::Configuration::api_key->{'x-service-account-access-key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'x-service-account-access-key'} = "Bearer";

# Configure API key authorization: PersonalAccessToken
$WWW::OPenAPIClient::Configuration::api_key->{'x-personal-access-token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'x-personal-access-token'} = "Bearer";

# Configure API key authorization: SessionCookie
$WWW::OPenAPIClient::Configuration::api_key->{'connect.sid'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'connect.sid'} = "Bearer";

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::PagesApi->new();
my $projectName = help-jp; # String | プロジェクト名(URL に使われる `name`)
my $encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0; # String | ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。


eval {
    my $result = $api_instance->getPageText(projectName => $projectName, encodedTitle => $encodedTitle);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling PagesApi->getPageText: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ServiceAccount
openapi_client.configuration.api_key['x-service-account-access-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['x-service-account-access-key'] = 'Bearer'

# Configure API key authorization: PersonalAccessToken
openapi_client.configuration.api_key['x-personal-access-token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['x-personal-access-token'] = 'Bearer'

# Configure API key authorization: SessionCookie
openapi_client.configuration.api_key['connect.sid'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['connect.sid'] = 'Bearer'

# Create an instance of the API class
api_instance = openapi_client.PagesApi()
projectName = help-jp # String | プロジェクト名(URL に使われる `name`) (default to null)
encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0 # String | ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。
 (default to null)

try:
    # ページ本文のプレーンテキスト
    api_response = api_instance.get_page_text(projectName, encodedTitle)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PagesApi->getPageText: %s\n" % e)
extern crate PagesApi;

pub fn main() {
    let projectName = help-jp; // String
    let encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0; // String

    let mut context = PagesApi::Context::default();
    let result = client.getPageText(projectName, encodedTitle, &context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Path parameters
Name Description
projectName*
String
プロジェクト名(URL に使われる `name`)
Required
encodedTitle*
String
ページタイトル。 サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、 クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も すべて percent-encode する。 空白は `%20` でも `_` でも同じページに解決される。 人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、 `%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。
Required

Responses


getPageV2

単一ページ(v2)

v1 と同じページ情報を、正規化 field 付きで返す。 `relatedPages` は返らないので、関連ページが要るなら `links1hop` / `links2hop` を別に叩く。 編集 API のパスが `/pages/v2/...` 配下にあるため、編集の起点となる `id` と `lines[].id` を取るならこちらを使うほうが一貫する。


/pages/v2/{projectName}/{encodedTitle}

Usage and SDK Samples

curl -X GET \
-H "x-service-account-access-key: [[apiKey]]" \
-H "x-personal-access-token: [[apiKey]]" \
 \
 -H "Accept: application/json" \
 "https://scrapbox.io/api/pages/v2/{projectName}/{encodedTitle}"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PagesApi;

import java.io.File;
import java.util.*;

public class PagesApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure API key authorization: ServiceAccount
        ApiKeyAuth ServiceAccount = (ApiKeyAuth) defaultClient.getAuthentication("ServiceAccount");
        ServiceAccount.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //ServiceAccount.setApiKeyPrefix("Token");

        // Configure API key authorization: PersonalAccessToken
        ApiKeyAuth PersonalAccessToken = (ApiKeyAuth) defaultClient.getAuthentication("PersonalAccessToken");
        PersonalAccessToken.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //PersonalAccessToken.setApiKeyPrefix("Token");

        // Configure API key authorization: SessionCookie
        ApiKeyAuth SessionCookie = (ApiKeyAuth) defaultClient.getAuthentication("SessionCookie");
        SessionCookie.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //SessionCookie.setApiKeyPrefix("Token");

        // Create an instance of the API class
        PagesApi apiInstance = new PagesApi();
        String projectName = help-jp; // String | プロジェクト名(URL に使われる `name`)
        String encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0; // String | ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。


        try {
            PageDetailV2 result = apiInstance.getPageV2(projectName, encodedTitle);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PagesApi#getPageV2");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String projectName = new String(); // String | プロジェクト名(URL に使われる `name`)
final String encodedTitle = new String(); // String | ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。


try {
    final result = await api_instance.getPageV2(projectName, encodedTitle);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->getPageV2: $e\n');
}

import org.openapitools.client.api.PagesApi;

public class PagesApiExample {
    public static void main(String[] args) {
        PagesApi apiInstance = new PagesApi();
        String projectName = help-jp; // String | プロジェクト名(URL に使われる `name`)
        String encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0; // String | ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。


        try {
            PageDetailV2 result = apiInstance.getPageV2(projectName, encodedTitle);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PagesApi#getPageV2");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: ServiceAccount)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"x-service-account-access-key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"x-service-account-access-key"];

// Configure API key authorization: (authentication scheme: PersonalAccessToken)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"x-personal-access-token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"x-personal-access-token"];

// Configure API key authorization: (authentication scheme: SessionCookie)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"connect.sid"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"connect.sid"];


// Create an instance of the API class
PagesApi *apiInstance = [[PagesApi alloc] init];
String *projectName = help-jp; // プロジェクト名(URL に使われる `name`) (default to null)
String *encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0; // ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。
 (default to null)

// 単一ページ(v2)
[apiInstance getPageV2With:projectName
    encodedTitle:encodedTitle
              completionHandler: ^(PageDetailV2 output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var CosenseScrapboxHttpApi = require('cosense__scrapbox_http_api');
var defaultClient = CosenseScrapboxHttpApi.ApiClient.instance;

// Configure API key authorization: ServiceAccount
var ServiceAccount = defaultClient.authentications['ServiceAccount'];
ServiceAccount.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ServiceAccount.apiKeyPrefix['x-service-account-access-key'] = "Token";

// Configure API key authorization: PersonalAccessToken
var PersonalAccessToken = defaultClient.authentications['PersonalAccessToken'];
PersonalAccessToken.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//PersonalAccessToken.apiKeyPrefix['x-personal-access-token'] = "Token";

// Configure API key authorization: SessionCookie
var SessionCookie = defaultClient.authentications['SessionCookie'];
SessionCookie.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SessionCookie.apiKeyPrefix['connect.sid'] = "Token";

// Create an instance of the API class
var api = new CosenseScrapboxHttpApi.PagesApi()
var projectName = help-jp; // {String} プロジェクト名(URL に使われる `name`)
var encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0; // {String} ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getPageV2(projectName, encodedTitle, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class getPageV2Example
    {
        public void main()
        {
            // Configure API key authorization: ServiceAccount
            Configuration.Default.ApiKey.Add("x-service-account-access-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("x-service-account-access-key", "Bearer");
            // Configure API key authorization: PersonalAccessToken
            Configuration.Default.ApiKey.Add("x-personal-access-token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("x-personal-access-token", "Bearer");
            // Configure API key authorization: SessionCookie
            Configuration.Default.ApiKey.Add("connect.sid", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("connect.sid", "Bearer");

            // Create an instance of the API class
            var apiInstance = new PagesApi();
            var projectName = help-jp;  // String | プロジェクト名(URL に使われる `name`) (default to null)
            var encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0;  // String | ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。
 (default to null)

            try {
                // 単一ページ(v2)
                PageDetailV2 result = apiInstance.getPageV2(projectName, encodedTitle);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling PagesApi.getPageV2: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: ServiceAccount
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('x-service-account-access-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-service-account-access-key', 'Bearer');

// Configure API key authorization: PersonalAccessToken
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('x-personal-access-token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-personal-access-token', 'Bearer');

// Configure API key authorization: SessionCookie
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('connect.sid', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('connect.sid', 'Bearer');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\PagesApi();
$projectName = help-jp; // String | プロジェクト名(URL に使われる `name`)
$encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0; // String | ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。


try {
    $result = $api_instance->getPageV2($projectName, $encodedTitle);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PagesApi->getPageV2: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::PagesApi;

# Configure API key authorization: ServiceAccount
$WWW::OPenAPIClient::Configuration::api_key->{'x-service-account-access-key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'x-service-account-access-key'} = "Bearer";

# Configure API key authorization: PersonalAccessToken
$WWW::OPenAPIClient::Configuration::api_key->{'x-personal-access-token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'x-personal-access-token'} = "Bearer";

# Configure API key authorization: SessionCookie
$WWW::OPenAPIClient::Configuration::api_key->{'connect.sid'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'connect.sid'} = "Bearer";

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::PagesApi->new();
my $projectName = help-jp; # String | プロジェクト名(URL に使われる `name`)
my $encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0; # String | ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。


eval {
    my $result = $api_instance->getPageV2(projectName => $projectName, encodedTitle => $encodedTitle);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling PagesApi->getPageV2: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ServiceAccount
openapi_client.configuration.api_key['x-service-account-access-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['x-service-account-access-key'] = 'Bearer'

# Configure API key authorization: PersonalAccessToken
openapi_client.configuration.api_key['x-personal-access-token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['x-personal-access-token'] = 'Bearer'

# Configure API key authorization: SessionCookie
openapi_client.configuration.api_key['connect.sid'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['connect.sid'] = 'Bearer'

# Create an instance of the API class
api_instance = openapi_client.PagesApi()
projectName = help-jp # String | プロジェクト名(URL に使われる `name`) (default to null)
encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0 # String | ページタイトル。
サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、
クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も
すべて percent-encode する。
空白は `%20` でも `_` でも同じページに解決される。

人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、
`%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。
 (default to null)

try:
    # 単一ページ(v2)
    api_response = api_instance.get_page_v2(projectName, encodedTitle)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PagesApi->getPageV2: %s\n" % e)
extern crate PagesApi;

pub fn main() {
    let projectName = help-jp; // String
    let encodedTitle = %E3%83%96%E3%83%A9%E3%82%B1%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0; // String

    let mut context = PagesApi::Context::default();
    let result = client.getPageV2(projectName, encodedTitle, &context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Path parameters
Name Description
projectName*
String
プロジェクト名(URL に使われる `name`)
Required
encodedTitle*
String
ページタイトル。 サーバーの route が `/:project/:title` で `:title` に `/` を含められないため、 クライアントは `urllib.parse.quote(title, safe="")` で `/` も空白も非 ASCII も すべて percent-encode する。 空白は `%20` でも `_` でも同じページに解決される。 人間可読 URL を組み立てる `scrapbox.client.page_url()` はこれとは別のエンコードで、 `%` `/` `?` `#` だけを percent-encode して空白を `_` に置換する。
Required

Responses


getPages

プロジェクトのページ一覧

本文 (`lines`) は含まれない。 末尾のスラッシュは付けても付けなくても 200 が返る。 `limit` の範囲外は API 側でエラーにならず、黙って別の値に置き換えられる。 1000 超は 1000 に、0 以下は既定の 100 になる。 返ってきた件数だけでは丸めか最終ページかを区別できないため、 このクライアントは範囲外を送らず `ValueError` にする (`check_page_size()`)。 `sort` に未知の値を送ってもエラーにはならず、既定の並びで 200 が返る。 固定ページ (`pin > 0`) は `sort` の指定によらず `pin` の降順で先頭に並ぶ。


/pages/{projectName}

Usage and SDK Samples

curl -X GET \
-H "x-service-account-access-key: [[apiKey]]" \
-H "x-personal-access-token: [[apiKey]]" \
 \
 -H "Accept: application/json" \
 "https://scrapbox.io/api/pages/{projectName}?skip=56&limit=56&sort=sort_example&filterType=filterType_example&filterValue=filterValue_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PagesApi;

import java.io.File;
import java.util.*;

public class PagesApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure API key authorization: ServiceAccount
        ApiKeyAuth ServiceAccount = (ApiKeyAuth) defaultClient.getAuthentication("ServiceAccount");
        ServiceAccount.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //ServiceAccount.setApiKeyPrefix("Token");

        // Configure API key authorization: PersonalAccessToken
        ApiKeyAuth PersonalAccessToken = (ApiKeyAuth) defaultClient.getAuthentication("PersonalAccessToken");
        PersonalAccessToken.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //PersonalAccessToken.setApiKeyPrefix("Token");

        // Configure API key authorization: SessionCookie
        ApiKeyAuth SessionCookie = (ApiKeyAuth) defaultClient.getAuthentication("SessionCookie");
        SessionCookie.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //SessionCookie.setApiKeyPrefix("Token");

        // Create an instance of the API class
        PagesApi apiInstance = new PagesApi();
        String projectName = help-jp; // String | プロジェクト名(URL に使われる `name`)
        Integer skip = 56; // Integer | オフセット
        Integer limit = 56; // Integer | 1 リクエストで返る件数。
範囲外は API 側で丸められるため、このクライアントは 1〜1000 のみを送る。

        String sort = sort_example; // String | 
        String filterType = filterType_example; // String | クライアントは `icon` しか送らない。
`filterValue` と対で指定する。

        String filterValue = filterValue_example; // String | 絞り込み値。ログイン名 (`name`) であって表示名 (`displayName`) ではない。
本文中に `[.icon]` を持つページと、そのユーザーが編集したページが返る。


        try {
            PageListResponse result = apiInstance.getPages(projectName, skip, limit, sort, filterType, filterValue);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PagesApi#getPages");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String projectName = new String(); // String | プロジェクト名(URL に使われる `name`)
final Integer skip = new Integer(); // Integer | オフセット
final Integer limit = new Integer(); // Integer | 1 リクエストで返る件数。
範囲外は API 側で丸められるため、このクライアントは 1〜1000 のみを送る。

final String sort = new String(); // String | 
final String filterType = new String(); // String | クライアントは `icon` しか送らない。
`filterValue` と対で指定する。

final String filterValue = new String(); // String | 絞り込み値。ログイン名 (`name`) であって表示名 (`displayName`) ではない。
本文中に `[.icon]` を持つページと、そのユーザーが編集したページが返る。


try {
    final result = await api_instance.getPages(projectName, skip, limit, sort, filterType, filterValue);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->getPages: $e\n');
}

import org.openapitools.client.api.PagesApi;

public class PagesApiExample {
    public static void main(String[] args) {
        PagesApi apiInstance = new PagesApi();
        String projectName = help-jp; // String | プロジェクト名(URL に使われる `name`)
        Integer skip = 56; // Integer | オフセット
        Integer limit = 56; // Integer | 1 リクエストで返る件数。
範囲外は API 側で丸められるため、このクライアントは 1〜1000 のみを送る。

        String sort = sort_example; // String | 
        String filterType = filterType_example; // String | クライアントは `icon` しか送らない。
`filterValue` と対で指定する。

        String filterValue = filterValue_example; // String | 絞り込み値。ログイン名 (`name`) であって表示名 (`displayName`) ではない。
本文中に `[.icon]` を持つページと、そのユーザーが編集したページが返る。


        try {
            PageListResponse result = apiInstance.getPages(projectName, skip, limit, sort, filterType, filterValue);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PagesApi#getPages");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: ServiceAccount)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"x-service-account-access-key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"x-service-account-access-key"];

// Configure API key authorization: (authentication scheme: PersonalAccessToken)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"x-personal-access-token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"x-personal-access-token"];

// Configure API key authorization: (authentication scheme: SessionCookie)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"connect.sid"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"connect.sid"];


// Create an instance of the API class
PagesApi *apiInstance = [[PagesApi alloc] init];
String *projectName = help-jp; // プロジェクト名(URL に使われる `name`) (default to null)
Integer *skip = 56; // オフセット (optional) (default to 0)
Integer *limit = 56; // 1 リクエストで返る件数。
範囲外は API 側で丸められるため、このクライアントは 1〜1000 のみを送る。
 (optional) (default to 100)
String *sort = sort_example; //  (optional) (default to updated)
String *filterType = filterType_example; // クライアントは `icon` しか送らない。
`filterValue` と対で指定する。
 (optional) (default to null)
String *filterValue = filterValue_example; // 絞り込み値。ログイン名 (`name`) であって表示名 (`displayName`) ではない。
本文中に `[.icon]` を持つページと、そのユーザーが編集したページが返る。
 (optional) (default to null)

// プロジェクトのページ一覧
[apiInstance getPagesWith:projectName
    skip:skip
    limit:limit
    sort:sort
    filterType:filterType
    filterValue:filterValue
              completionHandler: ^(PageListResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var CosenseScrapboxHttpApi = require('cosense__scrapbox_http_api');
var defaultClient = CosenseScrapboxHttpApi.ApiClient.instance;

// Configure API key authorization: ServiceAccount
var ServiceAccount = defaultClient.authentications['ServiceAccount'];
ServiceAccount.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ServiceAccount.apiKeyPrefix['x-service-account-access-key'] = "Token";

// Configure API key authorization: PersonalAccessToken
var PersonalAccessToken = defaultClient.authentications['PersonalAccessToken'];
PersonalAccessToken.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//PersonalAccessToken.apiKeyPrefix['x-personal-access-token'] = "Token";

// Configure API key authorization: SessionCookie
var SessionCookie = defaultClient.authentications['SessionCookie'];
SessionCookie.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SessionCookie.apiKeyPrefix['connect.sid'] = "Token";

// Create an instance of the API class
var api = new CosenseScrapboxHttpApi.PagesApi()
var projectName = help-jp; // {String} プロジェクト名(URL に使われる `name`)
var opts = {
  'skip': 56, // {Integer} オフセット
  'limit': 56, // {Integer} 1 リクエストで返る件数。
範囲外は API 側で丸められるため、このクライアントは 1〜1000 のみを送る。

  'sort': sort_example, // {String} 
  'filterType': filterType_example, // {String} クライアントは `icon` しか送らない。
`filterValue` と対で指定する。

  'filterValue': filterValue_example // {String} 絞り込み値。ログイン名 (`name`) であって表示名 (`displayName`) ではない。
本文中に `[.icon]` を持つページと、そのユーザーが編集したページが返る。

};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getPages(projectName, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class getPagesExample
    {
        public void main()
        {
            // Configure API key authorization: ServiceAccount
            Configuration.Default.ApiKey.Add("x-service-account-access-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("x-service-account-access-key", "Bearer");
            // Configure API key authorization: PersonalAccessToken
            Configuration.Default.ApiKey.Add("x-personal-access-token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("x-personal-access-token", "Bearer");
            // Configure API key authorization: SessionCookie
            Configuration.Default.ApiKey.Add("connect.sid", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("connect.sid", "Bearer");

            // Create an instance of the API class
            var apiInstance = new PagesApi();
            var projectName = help-jp;  // String | プロジェクト名(URL に使われる `name`) (default to null)
            var skip = 56;  // Integer | オフセット (optional)  (default to 0)
            var limit = 56;  // Integer | 1 リクエストで返る件数。
範囲外は API 側で丸められるため、このクライアントは 1〜1000 のみを送る。
 (optional)  (default to 100)
            var sort = sort_example;  // String |  (optional)  (default to updated)
            var filterType = filterType_example;  // String | クライアントは `icon` しか送らない。
`filterValue` と対で指定する。
 (optional)  (default to null)
            var filterValue = filterValue_example;  // String | 絞り込み値。ログイン名 (`name`) であって表示名 (`displayName`) ではない。
本文中に `[.icon]` を持つページと、そのユーザーが編集したページが返る。
 (optional)  (default to null)

            try {
                // プロジェクトのページ一覧
                PageListResponse result = apiInstance.getPages(projectName, skip, limit, sort, filterType, filterValue);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling PagesApi.getPages: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: ServiceAccount
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('x-service-account-access-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-service-account-access-key', 'Bearer');

// Configure API key authorization: PersonalAccessToken
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('x-personal-access-token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-personal-access-token', 'Bearer');

// Configure API key authorization: SessionCookie
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('connect.sid', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('connect.sid', 'Bearer');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\PagesApi();
$projectName = help-jp; // String | プロジェクト名(URL に使われる `name`)
$skip = 56; // Integer | オフセット
$limit = 56; // Integer | 1 リクエストで返る件数。
範囲外は API 側で丸められるため、このクライアントは 1〜1000 のみを送る。

$sort = sort_example; // String | 
$filterType = filterType_example; // String | クライアントは `icon` しか送らない。
`filterValue` と対で指定する。

$filterValue = filterValue_example; // String | 絞り込み値。ログイン名 (`name`) であって表示名 (`displayName`) ではない。
本文中に `[.icon]` を持つページと、そのユーザーが編集したページが返る。


try {
    $result = $api_instance->getPages($projectName, $skip, $limit, $sort, $filterType, $filterValue);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PagesApi->getPages: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::PagesApi;

# Configure API key authorization: ServiceAccount
$WWW::OPenAPIClient::Configuration::api_key->{'x-service-account-access-key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'x-service-account-access-key'} = "Bearer";

# Configure API key authorization: PersonalAccessToken
$WWW::OPenAPIClient::Configuration::api_key->{'x-personal-access-token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'x-personal-access-token'} = "Bearer";

# Configure API key authorization: SessionCookie
$WWW::OPenAPIClient::Configuration::api_key->{'connect.sid'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'connect.sid'} = "Bearer";

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::PagesApi->new();
my $projectName = help-jp; # String | プロジェクト名(URL に使われる `name`)
my $skip = 56; # Integer | オフセット
my $limit = 56; # Integer | 1 リクエストで返る件数。
範囲外は API 側で丸められるため、このクライアントは 1〜1000 のみを送る。

my $sort = sort_example; # String | 
my $filterType = filterType_example; # String | クライアントは `icon` しか送らない。
`filterValue` と対で指定する。

my $filterValue = filterValue_example; # String | 絞り込み値。ログイン名 (`name`) であって表示名 (`displayName`) ではない。
本文中に `[.icon]` を持つページと、そのユーザーが編集したページが返る。


eval {
    my $result = $api_instance->getPages(projectName => $projectName, skip => $skip, limit => $limit, sort => $sort, filterType => $filterType, filterValue => $filterValue);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling PagesApi->getPages: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ServiceAccount
openapi_client.configuration.api_key['x-service-account-access-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['x-service-account-access-key'] = 'Bearer'

# Configure API key authorization: PersonalAccessToken
openapi_client.configuration.api_key['x-personal-access-token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['x-personal-access-token'] = 'Bearer'

# Configure API key authorization: SessionCookie
openapi_client.configuration.api_key['connect.sid'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['connect.sid'] = 'Bearer'

# Create an instance of the API class
api_instance = openapi_client.PagesApi()
projectName = help-jp # String | プロジェクト名(URL に使われる `name`) (default to null)
skip = 56 # Integer | オフセット (optional) (default to 0)
limit = 56 # Integer | 1 リクエストで返る件数。
範囲外は API 側で丸められるため、このクライアントは 1〜1000 のみを送る。
 (optional) (default to 100)
sort = sort_example # String |  (optional) (default to updated)
filterType = filterType_example # String | クライアントは `icon` しか送らない。
`filterValue` と対で指定する。
 (optional) (default to null)
filterValue = filterValue_example # String | 絞り込み値。ログイン名 (`name`) であって表示名 (`displayName`) ではない。
本文中に `[.icon]` を持つページと、そのユーザーが編集したページが返る。
 (optional) (default to null)

try:
    # プロジェクトのページ一覧
    api_response = api_instance.get_pages(projectName, skip=skip, limit=limit, sort=sort, filterType=filterType, filterValue=filterValue)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PagesApi->getPages: %s\n" % e)
extern crate PagesApi;

pub fn main() {
    let projectName = help-jp; // String
    let skip = 56; // Integer
    let limit = 56; // Integer
    let sort = sort_example; // String
    let filterType = filterType_example; // String
    let filterValue = filterValue_example; // String

    let mut context = PagesApi::Context::default();
    let result = client.getPages(projectName, skip, limit, sort, filterType, filterValue, &context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Path parameters
Name Description
projectName*
String
プロジェクト名(URL に使われる `name`)
Required
Query parameters
Name Description
skip
Integer
オフセット
limit
Integer
1 リクエストで返る件数。 範囲外は API 側で丸められるため、このクライアントは 1〜1000 のみを送る。
sort
String
filterType
String
クライアントは `icon` しか送らない。 `filterValue` と対で指定する。
filterValue
String
絞り込み値。ログイン名 (`name`) であって表示名 (`displayName`) ではない。 本文中に `[<name>.icon]` を持つページと、そのユーザーが編集したページが返る。

Responses


Projects

getMe

認証ユーザー自身の情報

`get_pages(filter_value=...)` に渡すのは `displayName` ではなく `name` なので、 その確認にこのエンドポイントを使う。 **無認証でも 401 にはならず、200 で `{"isGuest": true}` だけが返る** (2026-08-09 実測)。 認証の有無はステータスコードではなく body から読む必要がある。 `get_me()` は `id` の無い body を `NotAuthenticatedError` にする。 Service Account でも同じ `{"isGuest": true}` が返る。ユーザーではないため。


/users/me

Usage and SDK Samples

curl -X GET \
-H "x-service-account-access-key: [[apiKey]]" \
-H "x-personal-access-token: [[apiKey]]" \
 \
 -H "Accept: application/json" \
 "https://scrapbox.io/api/users/me"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.ProjectsApi;

import java.io.File;
import java.util.*;

public class ProjectsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure API key authorization: ServiceAccount
        ApiKeyAuth ServiceAccount = (ApiKeyAuth) defaultClient.getAuthentication("ServiceAccount");
        ServiceAccount.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //ServiceAccount.setApiKeyPrefix("Token");

        // Configure API key authorization: PersonalAccessToken
        ApiKeyAuth PersonalAccessToken = (ApiKeyAuth) defaultClient.getAuthentication("PersonalAccessToken");
        PersonalAccessToken.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //PersonalAccessToken.setApiKeyPrefix("Token");

        // Configure API key authorization: SessionCookie
        ApiKeyAuth SessionCookie = (ApiKeyAuth) defaultClient.getAuthentication("SessionCookie");
        SessionCookie.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //SessionCookie.setApiKeyPrefix("Token");

        // Create an instance of the API class
        ProjectsApi apiInstance = new ProjectsApi();

        try {
            getMe_200_response result = apiInstance.getMe();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProjectsApi#getMe");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();


try {
    final result = await api_instance.getMe();
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->getMe: $e\n');
}

import org.openapitools.client.api.ProjectsApi;

public class ProjectsApiExample {
    public static void main(String[] args) {
        ProjectsApi apiInstance = new ProjectsApi();

        try {
            getMe_200_response result = apiInstance.getMe();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProjectsApi#getMe");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: ServiceAccount)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"x-service-account-access-key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"x-service-account-access-key"];

// Configure API key authorization: (authentication scheme: PersonalAccessToken)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"x-personal-access-token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"x-personal-access-token"];

// Configure API key authorization: (authentication scheme: SessionCookie)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"connect.sid"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"connect.sid"];


// Create an instance of the API class
ProjectsApi *apiInstance = [[ProjectsApi alloc] init];

// 認証ユーザー自身の情報
[apiInstance getMeWithCompletionHandler: 
              ^(getMe_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var CosenseScrapboxHttpApi = require('cosense__scrapbox_http_api');
var defaultClient = CosenseScrapboxHttpApi.ApiClient.instance;

// Configure API key authorization: ServiceAccount
var ServiceAccount = defaultClient.authentications['ServiceAccount'];
ServiceAccount.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ServiceAccount.apiKeyPrefix['x-service-account-access-key'] = "Token";

// Configure API key authorization: PersonalAccessToken
var PersonalAccessToken = defaultClient.authentications['PersonalAccessToken'];
PersonalAccessToken.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//PersonalAccessToken.apiKeyPrefix['x-personal-access-token'] = "Token";

// Configure API key authorization: SessionCookie
var SessionCookie = defaultClient.authentications['SessionCookie'];
SessionCookie.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SessionCookie.apiKeyPrefix['connect.sid'] = "Token";

// Create an instance of the API class
var api = new CosenseScrapboxHttpApi.ProjectsApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getMe(callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class getMeExample
    {
        public void main()
        {
            // Configure API key authorization: ServiceAccount
            Configuration.Default.ApiKey.Add("x-service-account-access-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("x-service-account-access-key", "Bearer");
            // Configure API key authorization: PersonalAccessToken
            Configuration.Default.ApiKey.Add("x-personal-access-token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("x-personal-access-token", "Bearer");
            // Configure API key authorization: SessionCookie
            Configuration.Default.ApiKey.Add("connect.sid", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("connect.sid", "Bearer");

            // Create an instance of the API class
            var apiInstance = new ProjectsApi();

            try {
                // 認証ユーザー自身の情報
                getMe_200_response result = apiInstance.getMe();
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling ProjectsApi.getMe: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: ServiceAccount
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('x-service-account-access-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-service-account-access-key', 'Bearer');

// Configure API key authorization: PersonalAccessToken
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('x-personal-access-token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-personal-access-token', 'Bearer');

// Configure API key authorization: SessionCookie
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('connect.sid', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('connect.sid', 'Bearer');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\ProjectsApi();

try {
    $result = $api_instance->getMe();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProjectsApi->getMe: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::ProjectsApi;

# Configure API key authorization: ServiceAccount
$WWW::OPenAPIClient::Configuration::api_key->{'x-service-account-access-key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'x-service-account-access-key'} = "Bearer";

# Configure API key authorization: PersonalAccessToken
$WWW::OPenAPIClient::Configuration::api_key->{'x-personal-access-token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'x-personal-access-token'} = "Bearer";

# Configure API key authorization: SessionCookie
$WWW::OPenAPIClient::Configuration::api_key->{'connect.sid'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'connect.sid'} = "Bearer";

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::ProjectsApi->new();

eval {
    my $result = $api_instance->getMe();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ProjectsApi->getMe: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ServiceAccount
openapi_client.configuration.api_key['x-service-account-access-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['x-service-account-access-key'] = 'Bearer'

# Configure API key authorization: PersonalAccessToken
openapi_client.configuration.api_key['x-personal-access-token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['x-personal-access-token'] = 'Bearer'

# Configure API key authorization: SessionCookie
openapi_client.configuration.api_key['connect.sid'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['connect.sid'] = 'Bearer'

# Create an instance of the API class
api_instance = openapi_client.ProjectsApi()

try:
    # 認証ユーザー自身の情報
    api_response = api_instance.get_me()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ProjectsApi->getMe: %s\n" % e)
extern crate ProjectsApi;

pub fn main() {

    let mut context = ProjectsApi::Context::default();
    let result = client.getMe(&context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Responses


getProject

単一プロジェクトの情報

公開プロジェクトなら無認証で読める。 `GET /projects` の要素と重なるが、**同じ形ではない**。 こちらは設定 (`theme`, `translation`, `infobox` 等) とメンバー一覧を持ち、 `GET /projects` が持つ集計値 (`usersCount`, `adminsCount`, `isOwner`, `isAdmin`) を持たない。 **Service Account は自分が属するプロジェクトに対しても 401 になる。** 同じプロジェクトの `/users` は通るのに、こちらだけ通らない。


/projects/{projectName}

Usage and SDK Samples

curl -X GET \
-H "x-service-account-access-key: [[apiKey]]" \
-H "x-personal-access-token: [[apiKey]]" \
 \
 -H "Accept: application/json" \
 "https://scrapbox.io/api/projects/{projectName}"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.ProjectsApi;

import java.io.File;
import java.util.*;

public class ProjectsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure API key authorization: ServiceAccount
        ApiKeyAuth ServiceAccount = (ApiKeyAuth) defaultClient.getAuthentication("ServiceAccount");
        ServiceAccount.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //ServiceAccount.setApiKeyPrefix("Token");

        // Configure API key authorization: PersonalAccessToken
        ApiKeyAuth PersonalAccessToken = (ApiKeyAuth) defaultClient.getAuthentication("PersonalAccessToken");
        PersonalAccessToken.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //PersonalAccessToken.setApiKeyPrefix("Token");

        // Configure API key authorization: SessionCookie
        ApiKeyAuth SessionCookie = (ApiKeyAuth) defaultClient.getAuthentication("SessionCookie");
        SessionCookie.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //SessionCookie.setApiKeyPrefix("Token");

        // Create an instance of the API class
        ProjectsApi apiInstance = new ProjectsApi();
        String projectName = help-jp; // String | プロジェクト名(URL に使われる `name`)

        try {
            ProjectDetail result = apiInstance.getProject(projectName);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProjectsApi#getProject");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String projectName = new String(); // String | プロジェクト名(URL に使われる `name`)

try {
    final result = await api_instance.getProject(projectName);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->getProject: $e\n');
}

import org.openapitools.client.api.ProjectsApi;

public class ProjectsApiExample {
    public static void main(String[] args) {
        ProjectsApi apiInstance = new ProjectsApi();
        String projectName = help-jp; // String | プロジェクト名(URL に使われる `name`)

        try {
            ProjectDetail result = apiInstance.getProject(projectName);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProjectsApi#getProject");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: ServiceAccount)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"x-service-account-access-key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"x-service-account-access-key"];

// Configure API key authorization: (authentication scheme: PersonalAccessToken)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"x-personal-access-token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"x-personal-access-token"];

// Configure API key authorization: (authentication scheme: SessionCookie)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"connect.sid"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"connect.sid"];


// Create an instance of the API class
ProjectsApi *apiInstance = [[ProjectsApi alloc] init];
String *projectName = help-jp; // プロジェクト名(URL に使われる `name`) (default to null)

// 単一プロジェクトの情報
[apiInstance getProjectWith:projectName
              completionHandler: ^(ProjectDetail output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var CosenseScrapboxHttpApi = require('cosense__scrapbox_http_api');
var defaultClient = CosenseScrapboxHttpApi.ApiClient.instance;

// Configure API key authorization: ServiceAccount
var ServiceAccount = defaultClient.authentications['ServiceAccount'];
ServiceAccount.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ServiceAccount.apiKeyPrefix['x-service-account-access-key'] = "Token";

// Configure API key authorization: PersonalAccessToken
var PersonalAccessToken = defaultClient.authentications['PersonalAccessToken'];
PersonalAccessToken.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//PersonalAccessToken.apiKeyPrefix['x-personal-access-token'] = "Token";

// Configure API key authorization: SessionCookie
var SessionCookie = defaultClient.authentications['SessionCookie'];
SessionCookie.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SessionCookie.apiKeyPrefix['connect.sid'] = "Token";

// Create an instance of the API class
var api = new CosenseScrapboxHttpApi.ProjectsApi()
var projectName = help-jp; // {String} プロジェクト名(URL に使われる `name`)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getProject(projectName, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class getProjectExample
    {
        public void main()
        {
            // Configure API key authorization: ServiceAccount
            Configuration.Default.ApiKey.Add("x-service-account-access-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("x-service-account-access-key", "Bearer");
            // Configure API key authorization: PersonalAccessToken
            Configuration.Default.ApiKey.Add("x-personal-access-token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("x-personal-access-token", "Bearer");
            // Configure API key authorization: SessionCookie
            Configuration.Default.ApiKey.Add("connect.sid", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("connect.sid", "Bearer");

            // Create an instance of the API class
            var apiInstance = new ProjectsApi();
            var projectName = help-jp;  // String | プロジェクト名(URL に使われる `name`) (default to null)

            try {
                // 単一プロジェクトの情報
                ProjectDetail result = apiInstance.getProject(projectName);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling ProjectsApi.getProject: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: ServiceAccount
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('x-service-account-access-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-service-account-access-key', 'Bearer');

// Configure API key authorization: PersonalAccessToken
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('x-personal-access-token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-personal-access-token', 'Bearer');

// Configure API key authorization: SessionCookie
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('connect.sid', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('connect.sid', 'Bearer');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\ProjectsApi();
$projectName = help-jp; // String | プロジェクト名(URL に使われる `name`)

try {
    $result = $api_instance->getProject($projectName);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProjectsApi->getProject: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::ProjectsApi;

# Configure API key authorization: ServiceAccount
$WWW::OPenAPIClient::Configuration::api_key->{'x-service-account-access-key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'x-service-account-access-key'} = "Bearer";

# Configure API key authorization: PersonalAccessToken
$WWW::OPenAPIClient::Configuration::api_key->{'x-personal-access-token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'x-personal-access-token'} = "Bearer";

# Configure API key authorization: SessionCookie
$WWW::OPenAPIClient::Configuration::api_key->{'connect.sid'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'connect.sid'} = "Bearer";

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::ProjectsApi->new();
my $projectName = help-jp; # String | プロジェクト名(URL に使われる `name`)

eval {
    my $result = $api_instance->getProject(projectName => $projectName);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ProjectsApi->getProject: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ServiceAccount
openapi_client.configuration.api_key['x-service-account-access-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['x-service-account-access-key'] = 'Bearer'

# Configure API key authorization: PersonalAccessToken
openapi_client.configuration.api_key['x-personal-access-token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['x-personal-access-token'] = 'Bearer'

# Configure API key authorization: SessionCookie
openapi_client.configuration.api_key['connect.sid'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['connect.sid'] = 'Bearer'

# Create an instance of the API class
api_instance = openapi_client.ProjectsApi()
projectName = help-jp # String | プロジェクト名(URL に使われる `name`) (default to null)

try:
    # 単一プロジェクトの情報
    api_response = api_instance.get_project(projectName)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ProjectsApi->getProject: %s\n" % e)
extern crate ProjectsApi;

pub fn main() {
    let projectName = help-jp; // String

    let mut context = ProjectsApi::Context::default();
    let result = client.getProject(projectName, &context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Path parameters
Name Description
projectName*
String
プロジェクト名(URL に使われる `name`)
Required

Responses


getProjectUsers

プロジェクトのメンバー一覧

ページや行の著者 ID を名前に解決するのに使う。 **公開プロジェクトを無認証で叩くと `users` しか返らず、その要素も `{id, name}` だけになる。** `displayName` や `email` の存在を前提にはできない。 Service Account では通り、`email` や `photo` まで含むフル情報が返る。 `serviceAccounts` に自分自身が現れる。 著者 ID は現メンバー、退去者、Service Account のいずれにも該当しうるので、 名前を解決するなら 4 つの配列すべてを 1 つの id → 情報マップにマージする。


/projects/{projectName}/users

Usage and SDK Samples

curl -X GET \
-H "x-service-account-access-key: [[apiKey]]" \
-H "x-personal-access-token: [[apiKey]]" \
 \
 -H "Accept: application/json" \
 "https://scrapbox.io/api/projects/{projectName}/users"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.ProjectsApi;

import java.io.File;
import java.util.*;

public class ProjectsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure API key authorization: ServiceAccount
        ApiKeyAuth ServiceAccount = (ApiKeyAuth) defaultClient.getAuthentication("ServiceAccount");
        ServiceAccount.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //ServiceAccount.setApiKeyPrefix("Token");

        // Configure API key authorization: PersonalAccessToken
        ApiKeyAuth PersonalAccessToken = (ApiKeyAuth) defaultClient.getAuthentication("PersonalAccessToken");
        PersonalAccessToken.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //PersonalAccessToken.setApiKeyPrefix("Token");

        // Configure API key authorization: SessionCookie
        ApiKeyAuth SessionCookie = (ApiKeyAuth) defaultClient.getAuthentication("SessionCookie");
        SessionCookie.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //SessionCookie.setApiKeyPrefix("Token");

        // Create an instance of the API class
        ProjectsApi apiInstance = new ProjectsApi();
        String projectName = help-jp; // String | プロジェクト名(URL に使われる `name`)

        try {
            ProjectUsersResponse result = apiInstance.getProjectUsers(projectName);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProjectsApi#getProjectUsers");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String projectName = new String(); // String | プロジェクト名(URL に使われる `name`)

try {
    final result = await api_instance.getProjectUsers(projectName);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->getProjectUsers: $e\n');
}

import org.openapitools.client.api.ProjectsApi;

public class ProjectsApiExample {
    public static void main(String[] args) {
        ProjectsApi apiInstance = new ProjectsApi();
        String projectName = help-jp; // String | プロジェクト名(URL に使われる `name`)

        try {
            ProjectUsersResponse result = apiInstance.getProjectUsers(projectName);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProjectsApi#getProjectUsers");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: ServiceAccount)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"x-service-account-access-key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"x-service-account-access-key"];

// Configure API key authorization: (authentication scheme: PersonalAccessToken)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"x-personal-access-token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"x-personal-access-token"];

// Configure API key authorization: (authentication scheme: SessionCookie)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"connect.sid"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"connect.sid"];


// Create an instance of the API class
ProjectsApi *apiInstance = [[ProjectsApi alloc] init];
String *projectName = help-jp; // プロジェクト名(URL に使われる `name`) (default to null)

// プロジェクトのメンバー一覧
[apiInstance getProjectUsersWith:projectName
              completionHandler: ^(ProjectUsersResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var CosenseScrapboxHttpApi = require('cosense__scrapbox_http_api');
var defaultClient = CosenseScrapboxHttpApi.ApiClient.instance;

// Configure API key authorization: ServiceAccount
var ServiceAccount = defaultClient.authentications['ServiceAccount'];
ServiceAccount.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ServiceAccount.apiKeyPrefix['x-service-account-access-key'] = "Token";

// Configure API key authorization: PersonalAccessToken
var PersonalAccessToken = defaultClient.authentications['PersonalAccessToken'];
PersonalAccessToken.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//PersonalAccessToken.apiKeyPrefix['x-personal-access-token'] = "Token";

// Configure API key authorization: SessionCookie
var SessionCookie = defaultClient.authentications['SessionCookie'];
SessionCookie.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SessionCookie.apiKeyPrefix['connect.sid'] = "Token";

// Create an instance of the API class
var api = new CosenseScrapboxHttpApi.ProjectsApi()
var projectName = help-jp; // {String} プロジェクト名(URL に使われる `name`)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getProjectUsers(projectName, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class getProjectUsersExample
    {
        public void main()
        {
            // Configure API key authorization: ServiceAccount
            Configuration.Default.ApiKey.Add("x-service-account-access-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("x-service-account-access-key", "Bearer");
            // Configure API key authorization: PersonalAccessToken
            Configuration.Default.ApiKey.Add("x-personal-access-token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("x-personal-access-token", "Bearer");
            // Configure API key authorization: SessionCookie
            Configuration.Default.ApiKey.Add("connect.sid", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("connect.sid", "Bearer");

            // Create an instance of the API class
            var apiInstance = new ProjectsApi();
            var projectName = help-jp;  // String | プロジェクト名(URL に使われる `name`) (default to null)

            try {
                // プロジェクトのメンバー一覧
                ProjectUsersResponse result = apiInstance.getProjectUsers(projectName);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling ProjectsApi.getProjectUsers: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: ServiceAccount
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('x-service-account-access-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-service-account-access-key', 'Bearer');

// Configure API key authorization: PersonalAccessToken
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('x-personal-access-token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-personal-access-token', 'Bearer');

// Configure API key authorization: SessionCookie
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('connect.sid', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('connect.sid', 'Bearer');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\ProjectsApi();
$projectName = help-jp; // String | プロジェクト名(URL に使われる `name`)

try {
    $result = $api_instance->getProjectUsers($projectName);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProjectsApi->getProjectUsers: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::ProjectsApi;

# Configure API key authorization: ServiceAccount
$WWW::OPenAPIClient::Configuration::api_key->{'x-service-account-access-key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'x-service-account-access-key'} = "Bearer";

# Configure API key authorization: PersonalAccessToken
$WWW::OPenAPIClient::Configuration::api_key->{'x-personal-access-token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'x-personal-access-token'} = "Bearer";

# Configure API key authorization: SessionCookie
$WWW::OPenAPIClient::Configuration::api_key->{'connect.sid'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'connect.sid'} = "Bearer";

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::ProjectsApi->new();
my $projectName = help-jp; # String | プロジェクト名(URL に使われる `name`)

eval {
    my $result = $api_instance->getProjectUsers(projectName => $projectName);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ProjectsApi->getProjectUsers: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ServiceAccount
openapi_client.configuration.api_key['x-service-account-access-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['x-service-account-access-key'] = 'Bearer'

# Configure API key authorization: PersonalAccessToken
openapi_client.configuration.api_key['x-personal-access-token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['x-personal-access-token'] = 'Bearer'

# Configure API key authorization: SessionCookie
openapi_client.configuration.api_key['connect.sid'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['connect.sid'] = 'Bearer'

# Create an instance of the API class
api_instance = openapi_client.ProjectsApi()
projectName = help-jp # String | プロジェクト名(URL に使われる `name`) (default to null)

try:
    # プロジェクトのメンバー一覧
    api_response = api_instance.get_project_users(projectName)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ProjectsApi->getProjectUsers: %s\n" % e)
extern crate ProjectsApi;

pub fn main() {
    let projectName = help-jp; // String

    let mut context = ProjectsApi::Context::default();
    let result = client.getProjectUsers(projectName, &context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Path parameters
Name Description
projectName*
String
プロジェクト名(URL に使われる `name`)
Required

Responses


getProjects

参加しているプロジェクトの一覧

**認証が必須**である。 並び順は API 任せで、このクライアントはソートし直さない。 Service Account では 401 になる。ユーザーに紐づかないため。


/projects

Usage and SDK Samples

curl -X GET \
-H "x-personal-access-token: [[apiKey]]" \
 \
 -H "Accept: application/json" \
 "https://scrapbox.io/api/projects"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.ProjectsApi;

import java.io.File;
import java.util.*;

public class ProjectsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure API key authorization: PersonalAccessToken
        ApiKeyAuth PersonalAccessToken = (ApiKeyAuth) defaultClient.getAuthentication("PersonalAccessToken");
        PersonalAccessToken.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //PersonalAccessToken.setApiKeyPrefix("Token");

        // Configure API key authorization: SessionCookie
        ApiKeyAuth SessionCookie = (ApiKeyAuth) defaultClient.getAuthentication("SessionCookie");
        SessionCookie.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //SessionCookie.setApiKeyPrefix("Token");

        // Create an instance of the API class
        ProjectsApi apiInstance = new ProjectsApi();

        try {
            ProjectsResponse result = apiInstance.getProjects();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProjectsApi#getProjects");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();


try {
    final result = await api_instance.getProjects();
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->getProjects: $e\n');
}

import org.openapitools.client.api.ProjectsApi;

public class ProjectsApiExample {
    public static void main(String[] args) {
        ProjectsApi apiInstance = new ProjectsApi();

        try {
            ProjectsResponse result = apiInstance.getProjects();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProjectsApi#getProjects");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: PersonalAccessToken)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"x-personal-access-token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"x-personal-access-token"];

// Configure API key authorization: (authentication scheme: SessionCookie)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"connect.sid"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"connect.sid"];


// Create an instance of the API class
ProjectsApi *apiInstance = [[ProjectsApi alloc] init];

// 参加しているプロジェクトの一覧
[apiInstance getProjectsWithCompletionHandler: 
              ^(ProjectsResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var CosenseScrapboxHttpApi = require('cosense__scrapbox_http_api');
var defaultClient = CosenseScrapboxHttpApi.ApiClient.instance;

// Configure API key authorization: PersonalAccessToken
var PersonalAccessToken = defaultClient.authentications['PersonalAccessToken'];
PersonalAccessToken.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//PersonalAccessToken.apiKeyPrefix['x-personal-access-token'] = "Token";

// Configure API key authorization: SessionCookie
var SessionCookie = defaultClient.authentications['SessionCookie'];
SessionCookie.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SessionCookie.apiKeyPrefix['connect.sid'] = "Token";

// Create an instance of the API class
var api = new CosenseScrapboxHttpApi.ProjectsApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getProjects(callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class getProjectsExample
    {
        public void main()
        {
            // Configure API key authorization: PersonalAccessToken
            Configuration.Default.ApiKey.Add("x-personal-access-token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("x-personal-access-token", "Bearer");
            // Configure API key authorization: SessionCookie
            Configuration.Default.ApiKey.Add("connect.sid", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("connect.sid", "Bearer");

            // Create an instance of the API class
            var apiInstance = new ProjectsApi();

            try {
                // 参加しているプロジェクトの一覧
                ProjectsResponse result = apiInstance.getProjects();
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling ProjectsApi.getProjects: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: PersonalAccessToken
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('x-personal-access-token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-personal-access-token', 'Bearer');

// Configure API key authorization: SessionCookie
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('connect.sid', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('connect.sid', 'Bearer');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\ProjectsApi();

try {
    $result = $api_instance->getProjects();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProjectsApi->getProjects: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::ProjectsApi;

# Configure API key authorization: PersonalAccessToken
$WWW::OPenAPIClient::Configuration::api_key->{'x-personal-access-token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'x-personal-access-token'} = "Bearer";

# Configure API key authorization: SessionCookie
$WWW::OPenAPIClient::Configuration::api_key->{'connect.sid'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'connect.sid'} = "Bearer";

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::ProjectsApi->new();

eval {
    my $result = $api_instance->getProjects();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ProjectsApi->getProjects: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: PersonalAccessToken
openapi_client.configuration.api_key['x-personal-access-token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['x-personal-access-token'] = 'Bearer'

# Configure API key authorization: SessionCookie
openapi_client.configuration.api_key['connect.sid'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['connect.sid'] = 'Bearer'

# Create an instance of the API class
api_instance = openapi_client.ProjectsApi()

try:
    # 参加しているプロジェクトの一覧
    api_response = api_instance.get_projects()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ProjectsApi->getProjects: %s\n" % e)
extern crate ProjectsApi;

pub fn main() {

    let mut context = ProjectsApi::Context::default();
    let result = client.getProjects(&context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Responses