> ## Documentation Index
> Fetch the complete documentation index at: https://developer.box.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Box Signリクエストの作成

export const MultiRelatedLinks = ({sections = []}) => {
  if (!sections || sections.length === 0) {
    return null;
  }
  return <div className="space-y-8">
      {sections.map((section, index) => <RelatedLinks key={index} title={section.title} items={section.items} />)}
    </div>;
};

export const RelatedLinks = ({title, items = []}) => {
  const getBadgeClass = badge => {
    if (!badge) return "badge-default";
    const badgeType = badge.toLowerCase().replace(/\s+/g, "-");
    return `badge-${badge === "ガイド" ? "guide" : badgeType}`;
  };
  if (!items || items.length === 0) {
    return null;
  }
  return <div className="my-8">
      {}
      <h3 className="text-sm font-bold uppercase tracking-wider mb-4">{title}</h3>

      {}
      <div className="flex flex-col gap-3">
        {items.map((item, index) => <a key={index} href={item.href} className="py-2 px-3 rounded related_link hover:bg-[#f2f2f2] dark:hover:bg-[#111827] flex items-center gap-3 group no-underline hover:no-underline border-b-0">
            {}
            <span className={`px-2 py-1 rounded-full text-xs font-semibold uppercase tracking-wide flex-shrink-0 ${getBadgeClass(item.badge)}`}>
              {item.badge}
            </span>

            {}
            <span className="text-base">{item.label}</span>
          </a>)}
      </div>
    </div>;
};

export const Link = ({href, children, className, ...props}) => {
  const localizedHref = localizeLink(href);
  return <a href={localizedHref} className={className} {...props}>
      {children}
    </a>;
};

<Link href="/reference/post-sign-requests">Box Signリクエストを作成する</Link>には、署名が必要なファイル、署名済みドキュメント/[署名ログ][log]の保存先フォルダ、署名者を指定する必要があります。

<CodeGroup>
  ```sh cURL theme={null}
  curl -i -X POST "https://api.box.com/2.0/sign_requests" \
       -H "authorization: Bearer <ACCESS_TOKEN>" \
       -d '{
         "signers": [
            {
              "role": "signer",
              "email": "example_email@box.com"
            }
          ],
         "source_files": [
            {
              "type": "file",
              "id": "123456789"
            }
         ],
         "parent_folder":
            {
              "type": "folder",
              "id": "0987654321"
            }
       }'
  ```

  ```typescript Node/TypeScript v10 theme={null}
  await client.signRequests.createSignRequest({
    signers: [
      {
        email: signerEmail,
        suppressNotifications: true,
        declinedRedirectUrl: 'https://www.box.com',
        embedUrlExternalUserId: '123',
        isInPerson: false,
        loginRequired: false,
        password: 'password',
        role: 'signer' as SignRequestCreateSignerRoleField,
      } satisfies SignRequestCreateSigner,
    ],
    areRemindersEnabled: true,
    areTextSignaturesEnabled: true,
    daysValid: 30,
    declinedRedirectUrl: 'https://www.box.com',
    emailMessage: 'Please sign this document',
    emailSubject: 'Sign this document',
    externalId: '123',
    externalSystemName: 'BoxSignIntegration',
    isDocumentPreparationNeeded: false,
    name: 'Sign Request',
    parentFolder: new FolderMini({ id: destinationFolder.id }),
    redirectUrl: 'https://www.box.com',
    prefillTags: [
      {
        dateValue: dateFromString('2035-01-01'),
        documentTagId: '0',
      } satisfies SignRequestPrefillTag,
    ],
    sourceFiles: [new FileBase({ id: fileToSign.id })],
  } satisfies SignRequestCreateRequest);
  ```

  ```python Python v10 theme={null}
  client.sign_requests.create_sign_request(
      [
          SignRequestCreateSigner(
              email=signer_email,
              suppress_notifications=True,
              declined_redirect_url="https://www.box.com",
              embed_url_external_user_id="123",
              is_in_person=False,
              login_required=False,
              password="password",
              role=SignRequestCreateSignerRoleField.SIGNER,
          )
      ],
      source_files=[FileBase(id=file_to_sign.id)],
      parent_folder=FolderMini(id=destination_folder.id),
      is_document_preparation_needed=False,
      redirect_url="https://www.box.com",
      declined_redirect_url="https://www.box.com",
      are_text_signatures_enabled=True,
      email_subject="Sign this document",
      email_message="Please sign this document",
      are_reminders_enabled=True,
      name="Sign Request",
      prefill_tags=[
          SignRequestPrefillTag(
              date_value=date_from_string("2035-01-01"), document_tag_id="0"
          )
      ],
      days_valid=30,
      external_id="123",
      external_system_name="BoxSignIntegration",
  )
  ```

  ```cs .NET v10 theme={null}
  await client.SignRequests.CreateSignRequestAsync(requestBody: new SignRequestCreateRequest(signers: Array.AsReadOnly(new [] {new SignRequestCreateSigner() { Email = signerEmail, SuppressNotifications = true, DeclinedRedirectUrl = "https://www.box.com", EmbedUrlExternalUserId = "123", IsInPerson = false, LoginRequired = false, Password = "password", Role = SignRequestCreateSignerRoleField.Signer }}), areRemindersEnabled: true, areTextSignaturesEnabled: true, daysValid: 30, declinedRedirectUrl: "https://www.box.com", emailMessage: "Please sign this document", emailSubject: "Sign this document", externalId: "123", externalSystemName: "BoxSignIntegration", isDocumentPreparationNeeded: false, name: "Sign Request", parentFolder: new FolderMini(id: destinationFolder.Id), redirectUrl: "https://www.box.com", prefillTags: Array.AsReadOnly(new [] {new SignRequestPrefillTag() { DateValue = Utils.DateFromString(date: "2035-01-01"), DocumentTagId = "0" }}), sourceFiles: Array.AsReadOnly(new [] {new FileBase(id: fileToSign.Id)})));
  ```

  ```swift Swift v10 theme={null}
  try await client.signRequests.createSignRequest(requestBody: SignRequestCreateRequest(signers: [SignRequestCreateSigner(email: signerEmail, suppressNotifications: true, declinedRedirectUrl: "https://www.box.com", embedUrlExternalUserId: "123", isInPerson: false, loginRequired: false, password: "password", role: SignRequestCreateSignerRoleField.signer)], areRemindersEnabled: true, areTextSignaturesEnabled: true, daysValid: Int64(30), declinedRedirectUrl: "https://www.box.com", emailMessage: "Please sign this document", emailSubject: "Sign this document", externalId: "123", externalSystemName: "BoxSignIntegration", isDocumentPreparationNeeded: false, name: "Sign Request", parentFolder: FolderMini(id: destinationFolder.id), redirectUrl: "https://www.box.com", prefillTags: [SignRequestPrefillTag(dateValue: try Utils.Dates.dateFromString(date: "2035-01-01"), documentTagId: "0")], sourceFiles: [FileBase(id: fileToSign.id)]))
  ```

  ```java Java v10 theme={null}
  client.getSignRequests().createSignRequest(new SignRequestCreateRequest.Builder(Arrays.asList(new SignRequestCreateSigner.Builder().email(signerEmail).role(SignRequestCreateSignerRoleField.SIGNER).isInPerson(false).embedUrlExternalUserId("123").declinedRedirectUrl("https://www.box.com").loginRequired(false).password("password").suppressNotifications(true).build())).sourceFiles(Arrays.asList(new FileBase(fileToSign.getId()))).parentFolder(new FolderMini(destinationFolder.getId())).isDocumentPreparationNeeded(false).redirectUrl("https://www.box.com").declinedRedirectUrl("https://www.box.com").areTextSignaturesEnabled(true).emailSubject("Sign this document").emailMessage("Please sign this document").areRemindersEnabled(true).name("Sign Request").prefillTags(Arrays.asList(new SignRequestPrefillTag.Builder().documentTagId("0").dateValue(dateFromString("2035-01-01")).build())).daysValid(30L).externalId("123").externalSystemName("BoxSignIntegration").build())
  ```

  ```java Java v5 theme={null}
  List<BoxSignRequestFile> files = new ArrayList<BoxSignRequestFile>();
  BoxSignRequestFile file = new BoxSignRequestFile("12345");
  files.add(file);
          
  // you can also use specific version of the file
  BoxFile file = new BoxFile(api, "12345");
  List<BoxFileVersion> versions = file.getVersions();
  BoxFileVersion firstVersion = versions.get(0);
  BoxSignRequestFile file = new BoxSignRequestFile(firstVersion.getFileID(), firstVersion.getVersionID());

  List<BoxSignRequestSigner> signers = new ArrayList<BoxSignRequestSigner>();
  BoxSignRequestSigner newSigner = new BoxSignRequestSigner("signer@mail.com");
  signers.add(newSigner);

  String destinationParentFolderId = "55555";

  BoxSignRequest.Info signRequestInfo = BoxSignRequest.createSignRequest(api, files,
          signers, destinationParentFolderId);
  ```

  ```python Python v4 theme={null}
  source_file = {
      'id': '12345',
      'type': 'file'
  }
  files = [source_file]

  signer = {
      'name': 'John Doe',
      'email': 'signer@mail.com'
  }
  signers = [signer]
  parent_folder_id = '123456789'

  new_sign_request = client.create_sign_request_v2(signers, files=files, parent_folder_id=parent_folder_id)
  print(f'(Sign Request ID: {new_sign_request.id})')
  ```

  ```cs .NET v6 theme={null}
  var sourceFiles = new List<BoxSignRequestCreateSourceFile>
  {
      new BoxSignRequestCreateSourceFile()
      {
          Id = "12345"
      }
  };

  var signers = new List<BoxSignRequestSignerCreate>
  {
      new BoxSignRequestSignerCreate()
      {
          Email = "example@gmail.com"
      }
  };

  var parentFolder = new BoxRequestEntity()
  {
      Id = "12345",
      Type = BoxType.folder
  };

  var request = new BoxSignRequestCreateRequest
  {
      SourceFiles = sourceFiles,
      Signers = signers,
      ParentFolder = parentFolder
  };

  BoxSignRequest signRequest = await client.SignRequestsManager.CreateSignRequestAsync(request);
  ```

  ```javascript Node v4 theme={null}
  const signRequest = await client.signRequests.create({
  	signers: [
  		{
  			role: 'signer',
  			email: 'user@example.com',
  		},
  	],
  	source_files: [
  		{
  			type: 'file',
  			id: '12345',
  		},
  	],
  	parent_folder: {
  		type: 'folder',
  		id: '1234567',
  	},
  });
  console.log(`Created a new sign request id ${signRequest.id}`);
  ```
</CodeGroup>

<Note>
  `request_flow`を`cfr11`に設定すると、APIを介して21 CFR Part 11 (GxP) 署名リクエストを開始できます。詳細については、[21 CFR Part 11リクエスト](/sign/request-options/cfr-part-11)および[21 CFR Part 11コンプライアンスのサポート](https://docs.box.com/en/box-sign/sending-a-document-for-signature/21-cfr-part-11-compliance-support)を参照してください。
</Note>

## ドキュメントの準備

Box Signリクエストを送信する前にドキュメントを準備することで、開発者は署名者のために日付、テキスト、チェックボックス、署名のプレースホルダを追加できます。これを行うには、UIを使用するか、ドキュメント内で直接[タグ][tags]を使用します。準備を行わなかった場合、署名者には準備が完了していないドキュメントが送信されるため、署名者の判断で署名やフィールドを配置できます。ただし、開発者は、準備が完了していないドキュメントの機能をオンまたはオフにするためのコントロールをリクエスト内で利用できます。

`is_document_preparation_needed`を`true`に設定すると、レスポンスで`prepare_url`が返されます。ブラウザでこのリンクにアクセスすると、ドキュメントの準備を完了し、UI上でリクエストを送信できます。

ドキュメントのタグの詳細については、[サポート記事][tags]を参照してください。

<Warning>
  Boxウェブアプリを使用してテンプレートに作成された事前入力タグには、APIからアクセスできません。
</Warning>

<Frame border center shadow>
  <div className="w-full h-full bg-[#FFFFFF] p-2 rounded flex items-center justify-center">
    <img src="https://mintcdn.com/box/KBEcg4yicgc_HMRY/images/guides/box-sign/prepare.png?fit=max&auto=format&n=KBEcg4yicgc_HMRY&q=85&s=d51fe938122ee2109849799521a762f4" alt="準備のオプション" width="1579" height="1200" data-path="images/guides/box-sign/prepare.png" />
  </div>
</Frame>

## ファイル

Box Signの各リクエストは、署名が必要なファイルから始まります。そのファイルがまだBoxに存在しない場合は、リクエストを作成する前に、別のAPIコールでファイルを<Link href="/reference/post-files-content">アップロードする</Link>必要があります。1つのリクエストで複数のファイルに署名できます。リクエストに含まれる最初のファイルのファイルIDを`source_files`本文パラメータで指定します。

<Warning>
  リクエスト送信者は、Box内のファイルに対してダウンロード権限を持っている必要があります。この要件を満たしているかどうかを確認するには、[コラボレーションレベル][collab]を確認します。
</Warning>

サポートされているファイルタイプは以下のとおりです。

* すべての<Link href="/guides/representations/supported-file-types/#documents">ドキュメント</Link>
* すべての<Link href="/guides/representations/supported-file-types/#presentations">プレゼンテーション</Link>
* 画像: `png`、`jpg`、`jpeg`、`tiff`のみ
* テキストベースのファイル: `.csv`、`.txt`のみ

すべてのファイルタイプは、署名の処理のために`.pdf`に変換されます。この変換後のドキュメントは、リクエストの送信が成功した場合に`parent_folder`で見つかります。つまり、元のファイルタイプに関係なく、最終的な署名済みドキュメントは`.pdf`になります。各署名者がリクエストを完了すると、Box Signにより新しいファイルバージョンが自動的に追加されます。

ファイルサイズの上限は、アカウントの種類によって決まります。詳細については、<Link href="/guides/uploads/direct">アップロードガイド</Link>を参照してください。

## 親フォルダ

`parent_folder`本文パラメータで指定されたフォルダIDによって、最終的な署名済みドキュメントと[署名ログ][log]の保存先が決まります。このフォルダには、フォルダID `0`で表される \[すべてのファイル] やルートレベルを指定することができません。

## 署名者

各署名者には、[役割][role]として、`signer`、`approver`、または`final copy_reader`を割り当てる必要があります。

リクエスト送信者に役割が指定されていない場合は、`final_copy_reader`という役割の署名者が自動的に作成されます。つまり、最終的な署名済みドキュメントと[署名ログ][log]のコピーを受信するだけです。

署名者は、ドキュメントに署名するために、既存のBoxアカウントを持っている必要も、アカウントを作成する必要もありません。他のAPIエンドポイントとは異なり、署名者はBox `user_id`ではなくメールアドレスを使用して招待されます。

必要に応じて、署名者は、リクエストに署名する前にBoxにログインできます。その場合は、署名者の`login_required`パラメータを`true`に設定します。署名者が既存のアカウントを所有していない場合は、無料Boxアカウントを作成するオプションもあります。

また、SMSによる多要素認証、Boxアカウントへのログイン、またはCAC/PIVスマートカード認証を介して、署名に先立ち自身のIDを認証するよう署名者に求めることもできます。これらの方法のいずれかと併せてパスワードを追加することで、保護をさらに強化できます。詳細については、[セキュリティの強化](/sign/request-options/extra-security)を参照してください。

<Warning>
  Box Signは、リクエストで指定された署名者のメールアドレスに署名用メールを送信しようとするだけです。Boxユーザーの場合、指定しない限り、メールエイリアスは含まれません。指定された署名者のメールアドレスすべてが有効であることを再確認してください。
</Warning>

### 入力

`inputs`パラメータは、ユーザーが操作できるプレースホルダを表します。`document_tag_id`パラメータには、署名リクエストの作成時に渡すデータを設定できます。

## テンプレート

署名リクエストは、テンプレートを使用して作成できます。そのためには、`template_id`パラメータを指定する必要があります。署名リクエスト作成時のテンプレートの使用の詳細については、<Link href="/guides/box-sign/sign-templates">こちらのガイド</Link>を参照してください。

## リダイレクト

`redirect_url`および`declined_redirect_url`で指定したURLにより、署名するか署名リクエストを拒否した署名者をカスタムランディングページにリダイレクトすることができます。たとえば、アプリケーションをBox Signと統合した場合は、署名者をアプリケーションにリダイレクトすることもカスタムランディングページにリダイレクトすることもできます。リダイレクトURLは、すべての署名者を対象にグローバルに設定することも、特定の署名者のみを対象に設定することもできます。つまり、Box Signでは、選択した署名者に特定のURLを使用し、残りの署名者にグローバルな設定を使用します。リダイレクトURLを設定しなかった場合、Box Signでは署名者がデフォルトのページにリダイレクトされます。

<Warning>
  デフォルトのページには「すべての関係者がドキュメントでの作業を完了すると、期限が設定された最終版へのリンクがメールで届きます。また、Boxアカウントをお持ちの場合は、アカウントにコピーが保存されます。」と表示されます。署名者を別のページにリダイレクトする場合、この情報は署名者に表示されなくなります。
</Warning>

## 複数の署名者と署名の順序

署名の順序は、指定された`order`の数値を小さいものから大きいものへ順序付けすることで決まります。2つの数値が同じ場合、署名者には同時にリクエストが届きます。

最初は、割り当てられた`order`の数値が最も小さい署名者だけに、Box Signリクエストメールが送信されます。その署名者が署名すると、次のユーザーにメールが送信される、というように進んでいきます。Box Signでは、ユーザーが署名するたびに、ドキュメントの新しいバージョンが`parent_folder`に自動的に追加されます。

いずれかの署名者が拒否した場合、残りの署名者にBox Signリクエストメールが送信されません。リクエスト全体が拒否されます。

<Frame border center shadow>
  <div className="w-full h-full bg-[#FFFFFF] p-2 rounded flex items-center justify-center">
    <img src="https://mintcdn.com/box/KBEcg4yicgc_HMRY/images/guides/box-sign/multiple_signer_flow.png?fit=max&auto=format&n=KBEcg4yicgc_HMRY&q=85&s=2f354021a36958839187c4f4f1a23b91" alt="複数の署名者のフロー" width="2608" height="1200" data-path="images/guides/box-sign/multiple_signer_flow.png" />
  </div>
</Frame>

## リクエストのステータス

* `converting`: 署名リクエストが送信された後、ファイルが署名プロセスのために`.pdf`に変換されている。
* `error_converting`: ファイルを`.pdf`に変換している間に問題が発生した。
* `created`: `document_preparation_is_needed`が`true`に設定されているが、`prepare_url`がまだアクセスされていない。
* `sent`: リクエストが正常に送信されたが、どの署名者も対応していない。
* `error_sending`: リクエストを送信中に問題が発生した。
* `viewed`: 最初 (または唯一) の署名者が署名用メールの \[**ドキュメントをレビュー**] をクリックするか、署名用URLにアクセスした。
* `downloaded`: 署名者が署名用ドキュメントをダウンロードした。
* `signed`: すべての署名者がリクエストの処理を完了した。
* `signed and downloaded`: 署名者が署名用ドキュメントに署名してダウンロードした。
* `declined`: いずれかの署名者がリクエストを拒否した。
* `cancelled`: リクエストがUIまたはAPIを介してキャンセルされた。
* `expired`: 署名が未完了、不十分のまま、有効期限が過ぎた。
* `finalizing`: すべての署名者がリクエストに署名済みでも、署名された最終的なドキュメントと署名ログがまだ生成されていない。
* `error_finalizing`: `finalizing`フェーズが正常に完了しなかった。
* `error`: 一般的なエラーステータス。リクエストがこのステータスの場合、`error_code`フィールドに具体的な理由が記載されています。たとえば、`cfr11_validation_failed`のようになります。

エラーステータスになった場合、再試行するには、新しい署名リクエストを作成する必要があります。

<Frame border center shadow>
  <div className="w-full h-full bg-[#FFFFFF] p-2 rounded flex items-center justify-center">
    <img src="https://mintcdn.com/box/KBEcg4yicgc_HMRY/images/guides/box-sign/status.png?fit=max&auto=format&n=KBEcg4yicgc_HMRY&q=85&s=7068eecde3df188f18522f9acfea009c" alt="ステータスの図" width="1500" height="687" data-path="images/guides/box-sign/status.png" />
  </div>
</Frame>

[tags]: https://support.box.com/hc/ja/articles/4404085855251-タグを使用したテンプレートの作成

[log]: https://support.box.com/hc/ja/articles/4404095202579-署名ログの確認

[role]: https://support.box.com/hc/ja/articles/4404105660947-署名者の役割

[collab]: https://support.box.com/hc/ja/articles/360044196413-コラボレータの権限レベルについて

[embed]: /guides/embed/box-embed

[embedguide]: /guides/embed/box-embed#programmatically

[signrequest]: /reference/post-sign-requests

[externalid]: /reference/post-sign-requests#param-signers-embed_url_external_user_id

[cloudgame]: /guides/embed/box-embed#cloud-game

<RelatedLinks
  title="関連するAPI"
  items={[
{ label: translate("Create Box Sign request"), href: "/reference/post-sign-requests", badge: "POST" }
]}
/>

<RelatedLinks
  title="関連するガイド"
  items={[
{ label: translate("Resend Box Sign Request"), href: "/guides/box-sign/resend-sign-request", badge: "GUIDE" },
{ label: translate("Cancel Box Sign Request"), href: "/guides/box-sign/cancel-sign-request", badge: "GUIDE" },
{ label: translate("Create Sign Request with Sign Template"), href: "/guides/box-sign/sign-templates", badge: "GUIDE" },
{ label: translate("CFR Part 11 requests"), href: "/sign/request-options/cfr-part-11", badge: "GUIDE" }
]}
/>
