> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# GetClientIntakeForm

# Package: contentCollector

# Namespace: IntakeForms

# Method link: https://dev.wix.com/docs/api-reference/account-level/partners/content-collector/intake-form-v1/get-client-intake-form.md

## Introduction

Retrieves an intake form on behalf of the client who is filling it out.

Returns the client-facing projection (`ClientIntakeForm`), which omits
partner-only data such as `clientEmails`, `teamMemberIds`, and
`sourceMaterials`.

Access is client-based, not account-based: the logged-in caller's email
address must match one of the form's `clientEmails`. A form that hasn't been
shared (empty `clientEmails`) authorizes no client. The call fails with
`PERMISSION_DENIED` if the caller's email isn't listed, and with
`FAILED_PRECONDITION` if the caller's identity has no email address.

`context` is returned only when `CONTEXT` is included in `fields`.

---

## REST API

### Schema

```
 Method: getClientIntakeForm
 Description: Retrieves an intake form on behalf of the client who is filling it out.  Returns the client-facing projection (`ClientIntakeForm`), which omits partner-only data such as `clientEmails`, `teamMemberIds`, and `sourceMaterials`.  Access is client-based, not account-based: the logged-in caller's email address must match one of the form's `clientEmails`. A form that hasn't been shared (empty `clientEmails`) authorizes no client. The call fails with `PERMISSION_DENIED` if the caller's email isn't listed, and with `FAILED_PRECONDITION` if the caller's identity has no email address.  `context` is returned only when `CONTEXT` is included in `fields`.
 URL: https://www.wixapis.com/partners/content-collector/v1/intake-forms/{intakeFormId}/client
 Method: GET
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  intakeFormId
 Method parameters: 
   query param name: fields | type: array<fields> | description: Fields to include in the response.  | validation: maxItems 5
                 - enum: CONTEXT, SOURCE_MATERIALS
   param name: intakeFormId | type:   none | required: true 
 Return type: GetClientIntakeFormResponse
  - name: intakeForm | type: ClientIntakeForm | description: The requested IntakeForm.  
     - name: id | type: string | description: Intake form GUID.  | validation: format GUID
     - name: submission | type: Submission | description: Submission state of the form.  
        - name: submittedDate | type: string | description: Date and time the client submitted the form.  | validation: format date-time
        - name: lastEditDate | type: string | description: Date and time the client last edited the form.  | validation: format date-time
     - name: userId | type: string | description: User GUID of the form owner.  | validation: format GUID
     - name: accountId | type: string | description: Account GUID.  | validation: format GUID
     - name: clientName | type: string | description: Client name.  | validation: maxLength 42
     - name: publishDate | type: string | description: Date and time the form was first shared with clients.  | validation: format date-time
     - name: context | type: string | description: AI-generated background context for the intake form, used to tailor the questionnaire. Returned only when `CONTEXT` is included in the request's `fields`.  | validation: maxLength 2147483647

 Possible Errors:
   HTTP Code: 403 | Status Code: PERMISSION_DENIED | Application Code: unauthorized_client | Description: The caller's email address isn't listed in the form's `clientEmails`, so the caller isn't authorized to access the form as a client. A form that hasn't been shared with any client authorizes no one.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: missing_identity_email | Description: The caller's identity has no email address to match against the form's `clientEmails`.


```

### Examples

### Get Client Intake Form
Retrieves the client-facing view of an intake form (caller must be a listed client)

```curl
curl -X GET \
  'https://www.wixapis.com/intake-forms/v1/intake-forms/8046df3c-7575-4098-a5ab-c91ad8f33c47/client?fields=CONTEXT' \
  -H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.contentCollectorIntakeForms.contentCollectorIntakeForms.getClientIntakeForm(intakeFormId, options)
 Description: Retrieves an intake form on behalf of the client who is filling it out.  Returns the client-facing projection (`ClientIntakeForm`), which omits partner-only data such as `clientEmails`, `teamMemberIds`, and `sourceMaterials`.  Access is client-based, not account-based: the logged-in caller's email address must match one of the form's `clientEmails`. A form that hasn't been shared (empty `clientEmails`) authorizes no client. The call fails with `PERMISSION_DENIED` if the caller's email isn't listed, and with `FAILED_PRECONDITION` if the caller's identity has no email address.  `context` is returned only when `CONTEXT` is included in `fields`.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  intakeFormId
 Method parameters: 
   param name: intakeFormId | type: string | description: GUID of the IntakeForm to retrieve. | required: true | validation: format GUID
   param name: options | type: GetClientIntakeFormOptions  none  
        - name: fields | type: array<RequestedFields> | description: Fields to include in the response.  | validation: maxItems 5
             - enum: CONTEXT, SOURCE_MATERIALS
 Return type: PROMISE<GetClientIntakeFormResponse>
  - name: intakeForm | type: ClientIntakeForm | description: The requested IntakeForm.  
     - name: _id | type: string | description: Intake form GUID.  | validation: format GUID
     - name: submission | type: Submission | description: Submission state of the form.  
        - name: submittedDate | type: Date | description: Date and time the client submitted the form.  
        - name: lastEditDate | type: Date | description: Date and time the client last edited the form.  
     - name: userId | type: string | description: User GUID of the form owner.  | validation: format GUID
     - name: accountId | type: string | description: Account GUID.  | validation: format GUID
     - name: clientName | type: string | description: Client name.  | validation: maxLength 42
     - name: publishDate | type: Date | description: Date and time the form was first shared with clients.  
     - name: context | type: string | description: AI-generated background context for the intake form, used to tailor the questionnaire. Returned only when `CONTEXT` is included in the request's `fields`.  | validation: maxLength 2147483647

 Possible Errors:
   HTTP Code: 403 | Status Code: PERMISSION_DENIED | Application Code: unauthorized_client | Description: The caller's email address isn't listed in the form's `clientEmails`, so the caller isn't authorized to access the form as a client. A form that hasn't been shared with any client authorizes no one.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: missing_identity_email | Description: The caller's identity has no email address to match against the form's `clientEmails`.


```

### Examples

### Get a client intake form
Retrieves the client-facing view of an intake form (caller must be a listed client)

```javascript
import { contentCollectorIntakeForms } from "@wix/content-collector-intake-forms";

const intakeFormId = "8046df3c-7575-4098-a5ab-c91ad8f33c47";

const options = {
  fields: [contentCollectorIntakeForms.RequestedFields.CONTEXT],
};

async function getClientIntakeForm() {
  const response = await contentCollectorIntakeForms.getClientIntakeForm(
    intakeFormId,
    options
  );
}

/* Promise resolves to:
 * {
 *   "intakeForm": {
 *     "_id": "8046df3c-7575-4098-a5ab-c91ad8f33c47",
 *     "clientName": "Jane Cohen",
 *     "context": "Bloom Bakery is a family-run business focused on artisan sourdough...",
 *     "userId": "f1a2b3c4-d5e6-4789-9abc-1234567890ab",
 *     "accountId": "a9b8c7d6-e5f4-4321-8765-0fedcba98765",
 *     "publishDate": "2024-03-19T09:14:02.118Z",
 *     "submission": {
 *       "submittedDate": "2024-03-20T11:05:44.000Z",
 *       "lastEditDate": "2024-03-20T11:05:44.000Z"
 *     }
 *   }
 * }
 */

```

### getClientIntakeForm (self-hosted)
Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { contentCollectorIntakeForms } from '@wix/content-collector-intake-forms';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { contentCollectorIntakeForms },
  // Include the auth strategy and host as relevant
});


async function getClientIntakeForm(intakeFormId,options) {
  const response = await myWixClient.contentCollectorIntakeForms.getClientIntakeForm(intakeFormId,options);
};
```

---