### Example Response for Retrieve All Document Workflows Source: https://general.veevavault.dev/clinical/vault-api/api-reference/26.2/document-lifecycle-workflows/document-workflows/retrieve-all-document-workflows Example response on SUCCESS, listing available document workflows. Each workflow includes name, label, type, and cardinality. Users without the Workflow: Start permission receive an INSUFFICIENT_ACCESS error instead. ```json { "responseStatus": "SUCCESS", "data": [ { "name": "Objectworkflow.clinical_study_report_approval__c", "label": "Clinical Study Report Approval", "type": "multidocworkflow", "cardinality": "OneOrMany" }, { "name": "Objectworkflow.medical_docs_review_and_approval__c", "label": "Medical Docs Review and Approval", "type": "multidocworkflow", "cardinality": "OneOrMany" } ] } ``` -------------------------------- ### Start a Workflow with Vault Java SDK Source: https://general.veevavault.dev/clinical/vault-sdk/services/workflow-services Complete example of starting a workflow: retrieves available workflows, gets start step metadata, and starts the workflow with participant and input parameters. Uses WorkflowMetadataService and WorkflowInstanceService. ```java // Records to start Workflow with String objectName = "object__c"; String record1 = "V5K000000001001"; String record2 = "V5K000000001002"; List records = VaultCollections.asList(record1, record2); // can also be list of documents if it's a document workflow WorkflowMetadataService workflowMetadataService = ServiceLocator.locate(WorkflowMetadataService.class); // 1) Get available workflows for given records AvailableWorkflowMetadataCollectionRequest availableWorkflowsRequest = workflowMetadataService.newAvailableWorkflowMetadataCollectionRequestBuilder() .withRecords(objectName, records) .build(); AvailableWorkflowMetadataCollectionResponse response = workflowMetadataService.getAvailableWorkflows(availableWorkflowsRequest); // Get list of available workflow for the given content listing List availableWorkflows = response.getWorkflows(); // Can loop over list of AvailableWorkflowMetadata to find/show all available workflows // 2) Get Start step details to begin workflow WorkflowStartMetadataRequest startMetadataRequest = workflowMetadataService.newWorkflowStartMetadataRequestBuilder() .withWorkflowName(workflowName) .withRecords(objectName, records) .build(); WorkflowStartMetadataResponse startMetadataResponse = workflowMetadataService.getWorkflowStartMetadata(startMetadataRequest); // List of control sections in the start step List startStepMetadata = startMetadataResponse.getStartStepMetadataList(); for (WorkflowStartStepMetadata metadata : startStepMetadata){ WorkflowStartStepType metaDataType = metadata.getType(); // Type of Start control (Participant, date, etc.) List parameters = metadata.getParameters(); // Parameters needed to start the workflow for (WorkflowParameterMetadata param : parameters) { String paramName = param.getName(); // used in input parameter key WorkflowInputValueType valueType = param.getDataType(); // used to set the value of the control } } } // 3) Start workflow with these start inputs String participantName = "viewer__c"; Long userId = 100l; Long groupId = 500l; List userIds = VaultCollections.asList(userId.toString()); List groupIds = VaultCollections.asList(groupId.toString()); String numberInput = "number__c"; int number = 123; WorkflowInstanceService workflowInstanceService = ServiceLocator.locate(WorkflowInstanceService.class); // Set workflow participants input WorkflowParticipantInputParameter workflowParticipantInputParameter = workflowInstanceService.newWorkflowParticipantInputParameterBuilder() .withUserIds(userIds) .withGroupIds(groupIds) .build(); // Create Start instance request with the builder WorkflowStartInstanceRequest startRequest = workflowInstanceService.newWorkflowStartRequestBuilder() .withWorkflowName(workflowName) .withRecords(objectName, records) .withInputParameters(numberInput, number) .withInputParameters(participantName, workflowParticipantInputParameter) .build(); ``` -------------------------------- ### Create project directory (Windows and Mac) Source: https://general.veevavault.dev/custom-pages/getting-started/client-quickstart Create a directory for the client code and the Hello World sample, then navigate into it. The Windows variant uses backslashes; the Mac variant uses the -p flag and forward slashes. ```bash mkdir client\hello-world && cd client\hello-world ``` ```bash mkdir -p client/hello-world && cd client/hello-world ``` -------------------------------- ### Query: Show Document Fields Starting with 'a' Source: https://general.veevavault.dev/commercial/vql/clauses/show Example query that returns document fields with a field name starting with 'a' using the LIKE operator. ```vql SHOW FIELDS FROM documents LIKE 'a%' ``` -------------------------------- ### POST /api/{version}/services/jobs/start_now/{job_id} Source: https://general.veevavault.dev/clinical/vault-api/api-reference/26.2/jobs/start-job API documentation for starting a scheduled job immediately. ```APIDOC ## [POST] /api/{version}/services/jobs/start_now/{job_id} ### Description Moves up a `scheduled` job instance to start immediately. Each time a user calls this API, Vault cancels the scheduled instance of the specified job for the current interval. This is analogous to the _Start Now_ option in the Vault UI. ### Method POST ### Endpoint /api/{version}/services/jobs/start_now/{job_id} ### Parameters #### Path Parameters - **{job_id}** (string) - Required - The ID of the scheduled job instance to start. #### Headers - **Accept** (string) - Optional - `application/json` (default) or `application/xml` ### Request Example ``` curl -X GET -H "Authorization: {AUTH_VALUE}" \ https://myvault.veevavault.com/api/v26.2/start_now/72505 ``` ### Response #### Success Response (200) - **responseStatus** (string) - Status of the response, e.g., "SUCCESS". - **url** (string) - URL to the job resource. - **job_id** (integer) - The ID of the job that was started. #### Response Example ``` { "responseStatus": "SUCCESS", "url": "/api/v26.2/services/jobs/72505", "job_id": 72505 } ``` ``` -------------------------------- ### Create distribution-manifest.json file Source: https://general.veevavault.dev/clinical/custom-pages/getting-started/client-quickstart Create an empty distribution-manifest.json file in the client/hello-world directory. The Windows command uses echo. >, while the Mac command uses touch. ```bat echo. > distribution-manifest.json ``` ```bash touch distribution-manifest.json ``` -------------------------------- ### Start Job API Response (JSON) Source: https://general.veevavault.dev/clinical/vault-api/api-reference/26.2/jobs/start-job Example JSON response from the Start Job API. It includes responseStatus, url, and job_id fields. ```json { "responseStatus": "SUCCESS", "url": "/api/v26.2/services/jobs/72505", "job_id": 72505 } ``` -------------------------------- ### GET /api/{version}/metadata/objects/groups Source: https://general.veevavault.dev/quality/vault-api/api-reference/26.2/groups/retrieve-group-metadata This snippet documents the GET endpoint for retrieving Group object metadata, including headers, request example, and response structure. ```APIDOC ## GET /api/{version}/metadata/objects/groups ### Description Retrieves metadata for the Group object, including field properties such as name, type, length, and editability. ### Method GET ### Endpoint /api/{version}/metadata/objects/groups ### Headers - **Accept** (string) - Optional - Specifies the response format: `application/json` (default) or `application/xml`. ### Request Example ``` curl -X GET -H "Authorization: {AUTH_VALUE}" \ https://myvault.veevavault.com/api/v26.2/metadata/objects/groups ``` ### Response #### Success Response (200) - **responseStatus** (string) - Status of the response, e.g., "SUCCESS". - **properties** (array) - List of field metadata objects. - **name** (string) - Field name. - **type** (string) - Data type of the field. - **length** (integer) - Maximum length of the field. - **editable** (boolean) - Whether the field is editable. - **queryable** (boolean) - Whether the field is queryable. - **required** (boolean) - Whether the field is required. - **multivalue** (boolean) - Whether the field supports multiple values. - **onCreateEditable** (boolean) - Whether the field is editable on create. #### Response Example ``` { "responseStatus": "SUCCESS", "properties": [ { "name": "id", "type": "id", "length": 20, "editable": false, "queryable": true, "required": true, "multivalue": false, "onCreateEditable": false }, { "name": "label__v", "type": "String", "length": 255, "editable": true, "queryable": true, "required": true, "multivalue": false, "onCreateEditable": true }, { "name": "allow_delegation_among_members__v", "type": "Boolean", "length": 1, "editable": true, "queryable": true, "required": false, "multivalue": false, "onCreateEditable": true }, { "name": "group_description__v", "type": "String", "length": 200, "editable": true, "queryable": true, "required": false, "multivalue": false, "onCreateEditable": true } ] } ``` ``` -------------------------------- ### Initialize agent with :onboard Source: https://general.veevavault.dev/clinical/vault-toolbox/toolbox-designer Initializes the AI agent and syncs it with the project's standards. ```bash :onboard ``` -------------------------------- ### GET /api/{version}/metadata/objects/securitypolicies Source: https://general.veevavault.dev/medical/vault-api/api-reference/26.2/security-policies/retrieve-security-policy-metadata This snippet documents the GET endpoint for retrieving security policy metadata, including headers, request example, and response structure. ```APIDOC ## GET /api/{version}/metadata/objects/securitypolicies ### Description Retrieve the metadata associated with the security policy object. ### Method GET ### Endpoint /api/{version}/metadata/objects/securitypolicies ### Headers - **Accept** (string) - Required - `application/json` (default) or `application/xml` ### Request Example ``` curl -X GET -H "Authorization: {AUTH_VALUE}" \ https://myvault.veevavault.com/api/v26.2/metadata/objects/securitypolicies ``` ### Response #### Success Response (200) - **responseStatus** (string) - Status of the response. - **responseMessage** (string) - Message describing the response. - **metadata** (object) - Metadata of the security policy object. - **name** (string) - Name of the object. - **description** (string) - Description of the object. - **properties** (array) - List of properties. - **name** (string) - Property name. - **type** (array) - Property type. - **description** (string) - Property description. - **objectTypeReferenced** (array) - Referenced object types. - **objects** (array) - List of related objects. - **name** (string) - Object name. - **description** (string) - Object description. - **properties** (array) - List of properties. - **name** (string) - Property name. - **type** (array) - Property type. - **description** (string) - Property description. - **required** (boolean) - Whether the property is required. - **maxValue** (integer) - Maximum value. - **minValue** (integer) - Minimum value. - **editable** (boolean) - Whether the property is editable. - **onCreateEditable** (boolean) - Whether the property is editable on create. #### Response Example ``` { "responseStatus": "SUCCESS", "responseMessage": "Success", "metadata": { "name": "security_policy", "description": "Security Policy", "properties": [ { "name": "policy_details__v", "type": [ "CompleteObject" ], "description": "Details", "objectTypeReferenced": [ { "type": "policy_details" } ] }, { "name": "policy_security_settings__v", "type": [ "CompleteObject" ], "description": "Security Settings", "objectTypeReferenced": [ { "type": "policy_security_settings" } ] } ], "objects": [ { "name": "policy_details", "description": "Details", "properties": [ { "name": "name__v", "type": [ "string" ], "description": "Public Key" }, { "name": "label__v", "type": [ "string" ], "description": "Policy Name", "required": true, "maxValue": 60, "minValue": 1, "editable": true, "onCreateEditable": true } ] }, { "name": "policy_security_settings", "description": "Security Policy", "properties": [ { "name": "authentication_type__v", "type": [ "SummaryObject" ], "description": "Authentication Type", "required": true, "editable": true, "onCreateEditable": true }, { "name": "passwords_require_number__v", "type": [ "boolean" ], "description": "Passwords require a number", "required": true, "editable": true, "onCreateEditable": true }, { "name": "passwords_require_uppercase_letter__v", "type": [ "boolean" ], "description": "Passwords require an upper-case letter", "required": true, "editable": true, "onCreateEditable": true } ] } ] } } ``` ``` -------------------------------- ### Create src/hello-world.jsx (Windows and Mac) Source: https://general.veevavault.dev/custom-pages/getting-started/client-quickstart Creates the src directory and an empty hello-world.jsx file. Use the Windows command on Windows and the Mac command on macOS. ```bash mkdir src && echo. > src\hello-world.jsx ``` ```bash mkdir src && touch src/hello-world.jsx ``` -------------------------------- ### Audit Types Response Example Source: https://general.veevavault.dev/clinical/vault-api/api-reference/26.2/logs/audit/retrieve-audit-types Example response for the GET /api/{version}/metadata/audittrail request. Contains a list of audit types with their name, label, and URL to retrieve metadata. ```json { "responseStatus": "SUCCESS", "audittrails": [ { "name": "document_audit_trail", "label": "Document Audit Trail", "url": "/api/v26.2/metadata/audittrail/document_audit_trail" }, { "name": "object_audit_trail", "label": "Object Audit Trail", "url": "/api/v26.2/metadata/audittrail/object_audit_trail" }, { "name": "system_audit_trail", "label": "System Audit Trail", "url": "/api/v26.2/metadata/audittrail/system_audit_trail" }, { "name": "domain_audit_trail", "label": "Domain Audit Trail", "url": "/api/v26.2/metadata/audittrail/domain_audit_trail" }, { "name": "login_audit_trail", "label": "Login Audit Trail", "url": "/api/v26.2/metadata/audittrail/login_audit_trail" } ] } ``` -------------------------------- ### GET /api/{version}/scim/v2/ResourceTypes/{type} Source: https://general.veevavault.dev/medical/vault-api/api-reference/26.2/scim/discovery-endpoints/retrieve-single-scim-resource-type This snippet documents the GET endpoint for retrieving a single SCIM resource type, including its parameters, request example, and response structure. ```APIDOC ## GET /api/{version}/scim/v2/ResourceTypes/{type} ### Description Retrieves a single SCIM resource type. Defines the endpoints, the core schema URI which defines this resource, and any supported schema extensions. ### Method GET ### Endpoint /api/{version}/scim/v2/ResourceTypes/{type} ### Parameters #### Path Parameters - **type** (string) - Required - A specific resource type. You can retrieve all available types from the Retrieve All SCIM Resource Types endpoint, where the value for this parameter is the `id` value. #### Headers - **Accept** (string) - Optional - `application/json` (default) or `application/scim+json` ### Request Example ``` curl -X GET -H "Authorization: {AUTH_VALUE}" \ https://veepharm.com/api/v26.2/scim/v2/ResourceTypes/SecurityProfile ``` ### Response #### Success Response (200) - **schemas** (array) - The SCIM schema URIs for the resource type. - **id** (string) - The resource type identifier. - **name** (string) - The resource type name. - **description** (string) - A description of the resource type. - **endpoint** (string) - The endpoint path for the resource type. - **schema** (string) - The core schema URI for the resource type. - **meta** (object) - Metadata about the resource type, including `resourceType` and `location`. #### Response Example ``` { "schemas": [ "urn:ietf:params:scim:schemas:core:2.0:ResourceType" ], "id": "SecurityProfile", "name": "SecurityProfile", "description": "Security Profile", "endpoint": "/SecurityProfiles", "schema": "urn:ietf:params:scim:schemas:extension:veevavault:2.0:SecurityProfile", "meta": { "resourceType": "Resource Type", "location": "https://promomats-template.vaultdev.com/api/v26.2/scim/v2/ResourceTypes/SecurityProfile" } } ``` ``` -------------------------------- ### JobService#run Example Source: https://general.veevavault.dev/regulatory/vault-sdk/services/job-service Example of using JobService to initiate a job with custom parameters and a scheduled run time. ```APIDOC ## JobService#run Example ### Description Example of using JobService to initiate a job with custom parameters and a scheduled run time. ### Code Example ```java public void updateRecordsAsynchronously(List recordChanges) { JobService jobService = ServiceLocator.locate(JobService.class); List recordIds = VaultCollections.newList(); recordChanges.forEach(recordChange -> recordIds.add(recordChange.getNew().getValue("id", ValueType.STRING))); if (!recordIds.isEmpty()) { JobParameters jobParameters = jobService.newJobParameters("custom_sdk_job__c"); CustomSdkJobParameters customSdkJobParameters = new CustomSdkJobParameters(); customSdkJobParameters.setRecordIds(recordIds); jobParameters.setValue("custom_parameters", customSdkJobParameters); jobParameters.setJobRunTime(ZonedDateTime.now().plusMinutes(2)); jobService.run(jobParameters); } } ``` ``` -------------------------------- ### GET /api/{version}/objects/groups Source: https://general.veevavault.dev/clinical/vault-api/api-reference/26.2/groups/retrieve-all-groups This code snippet documents the GET /api/{version}/objects/groups endpoint, including its headers, query parameters, request example, and response structure. ```APIDOC ## GET /api/{version}/objects/groups ### Description Retrieves all groups except Auto Managed groups. Auto Managed groups can be retrieved using the Retrieve Auto Managed Groups endpoint. ### Method GET ### Endpoint /api/{version}/objects/groups ### Headers - **Accept** (string) - Optional - Specifies the response format: `application/json` (default) or `application/xml`. ### Query Parameters - **includeImplied** (boolean) - Optional - When `true`, the response includes the `implied_members__v` field. These users are automatically added to the group when their `security_profiles__v` are added to the group. If omitted, the response includes only the `members__v` field. These users are individually added to a group by an Admin. ### Request Example ``` curl -X GET -H "Authorization: {AUTH_VALUE}" \ https://myvault.veevavault.com/api/v26.2/objects/groups ``` ### Response #### Success Response (200) - **responseStatus** (string) - Status of the response, e.g., "SUCCESS". - **groups** (array) - List of group objects. Each group contains fields such as `members__v`, `active__v`, `security_profiles__v`, `name__v`, `modified_by__v`, `editable__v`, `allow_delegation_among_members__v`, `modified_date__v`, `group_description__v`, `system_group__v`, `label__v`, `created_date__v`, `type__v`, `id`, `created_by__v`. #### Response Example ``` { "responseStatus": "SUCCESS", "groups": [ { "group": { "members__v": [ 25496, 25513, 25514, 25515, 25519, 25524, 25525, 25526, 25527, 25528, 25532 ], "active__v": true, "security_profiles__v": [ "document_user__v", "business_admin__v", "system_admin__v", "vault_owner__v" ], "name__v": "all_internal_users__v", "modified_by__v": 25524, "editable__v": true, "allow_delegation_among_members__v": true, "modified_date__v": "2016-03-08T21:13:49.000Z", "group_description__v": "All Internal Vault Users (System Provided Group)", "system_group__v": true, "label__v": "All Internal Users", "created_date__v": "2014-02-17T10:09:03.000Z", "type__v": "System Provided Group", "id": 1, "created_by__v": 1 } } ] } ``` ``` -------------------------------- ### onLogin() example with and without AgentStatus Source: https://general.veevavault.dev/medical/omnichannel/api-reference/26.1/methods/onlogin Shows how to call onLogin() to authenticate a user. Without an argument, the default AgentStatus.OFFLINE is used. Passing AgentStatus.AVAILABLE sets the status to available. ```javascript import { omniconnectEvent, AgentStatus} from "./vault-medical-omniconnect-25.1.2-release12649.js"; // Authenticate user with OFFLINE agent status function userAuthenticatedWithOfflineStatus() { omniconnectEvent.onLogin() } // Authenticate user with AVAILABLE agent status function userAuthenticatedWithAvailableStatus() { omniconnectEvent.onLogin(AgentStatus.AVAILABLE) } ``` -------------------------------- ### GET /api/{version}/scim/v2/ResourceTypes Source: https://general.veevavault.dev/qualityone/vault-api/api-reference/26.2/scim/discovery-endpoints/retrieve-all-scim-resource-types This code snippet documents the GET endpoint for retrieving all SCIM resource types. It includes the endpoint path, headers, request example, and response structure. ```APIDOC ## GET /api/{version}/scim/v2/ResourceTypes ### Description Retrieve the types of SCIM resources available. Each resource type defines the endpoints, the core schema URI that defines the resource, and any supported schema extensions. ### Method GET ### Endpoint /api/{version}/scim/v2/ResourceTypes ### Headers - **Accept** (string) - Optional - `application/json` (default) or `application/scim+json` ### Request Example ``` curl -X GET -H "Authorization: {AUTH_VALUE}" \ https://veepharm.com/api/v26.2/scim/v2/ResourceTypes ``` ### Response #### Success Response (200) - **schemas** (array) - List of schema URIs for the response. - **totalResults** (integer) - Total number of resource types returned. - **Resources** (array) - List of resource type objects. - **schemas** (array) - Schema URIs for the resource type. - **id** (string) - Resource type identifier. - **name** (string) - Resource type name. - **description** (string) - Description of the resource type. - **endpoint** (string) - Endpoint path for the resource type. - **schema** (string) - Core schema URI for the resource type. - **schemaExtensions** (array) - List of schema extensions. - **schema** (string) - Schema URI for the extension. - **required** (boolean) - Whether the extension is required. - **meta** (object) - Metadata about the resource type. - **resourceType** (string) - Resource type of the metadata. - **location** (string) - URL location of the resource type. #### Response Example ``` { "schemas": [ "urn:ietf:params:scim:api:messages:2.0:ListResponse" ], "totalResults": 4, "Resources": [ { "schemas": [ "urn:ietf:params:scim:schemas:core:2.0:ResourceType" ], "id": "User", "name": "User", "description": "User Account", "endpoint": "/Users", "schema": "urn:ietf:params:scim:schemas:core:2.0:User", "schemaExtensions": [ { "schema": "urn:ietf:params:scim:schemas:extension:veevavault:2.0:User", "required": true }, { "schema": "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User", "required": false } ], "meta": { "resourceType": "Resource Type", "location": "https://promomats-template.vaultdev.com/api/v26.2/scim/v2/ResourceTypes/User" } }, { "schemas": [ "urn:ietf:params:scim:schemas:core:2.0:ResourceType" ], "id": "SecurityProfile", "name": "SecurityProfile", "description": "Security Profile", "endpoint": "/SecurityProfiles", "schema": "urn:ietf:params:scim:schemas:extension:veevavault:2.0:SecurityProfile", "meta": { "resourceType": "Resource Type", "location": "https://promomats-template.vaultdev.com/api/v26.2/scim/v2/ResourceTypes/SecurityProfile" } } ] } ``` ``` -------------------------------- ### CREATE Command Syntax Source: https://general.veevavault.dev/clinical/mdl/documentation/mdl-commands/create The general syntax for the CREATE command, showing how to specify a component type, name, attributes, and optional subcomponents. ```APIDOC ## CREATE Command ### Description Creates an MDL component in Vault. The component name must be unique; the command fails if another record in that component already exists with the same name. If the component type allows subcomponents, they can be created in the same command. ### Syntax ``` CREATE Componenttypename component_type_name( attribute_name(attribute_value), attribute_name(attribute_value), Subcomponenttypename subcomponent_type_name( attribute_name(attribute_value), attribute_name(attribute_value) ), Subcomponenttypename subcomponent_type_name( attribute_name(attribute_value), attribute_name(attribute_value) ) ); ``` ### Parameters - **component_type_name** (string) - Required - The name of the component type (e.g., Picklist). - **attribute_name** (string) - Required - The name of an attribute to set on the component. - **attribute_value** (any) - Required - The value for the attribute. - **subcomponent_type_name** (string) - Optional - The name of a subcomponent type (e.g., Picklistentry). - **subcomponent attribute_name** (string) - Optional - The name of an attribute to set on the subcomponent. - **subcomponent attribute_value** (any) - Optional - The value for the subcomponent attribute. ### Example ``` CREATE Picklist color__c( label('Color'), active(true), can_add_values(true), can_reorder_values(true), Picklistentry red__c( value('Red'), active(true), order(1) ), Picklistentry blue__c( value('Blue'), active(true), order(2) ) ); ``` ### Notes - The command fails if a record with the same name already exists in the component. - Subcomponents are optional and only allowed if the component type supports them. ``` -------------------------------- ### GET /api/{version}/objects/picklists/{picklist_name} Source: https://general.veevavault.dev/quality/vault-api/api-reference/26.2/picklists/retrieve-picklist-values This snippet documents the GET endpoint for retrieving picklist values, including request parameters, response structure, and examples for both standard and system-managed picklists. ```APIDOC ## GET /api/{version}/objects/picklists/{picklist_name} ### Description Retrieves all active values configured on a picklist. If the picklist is system-managed and has dependencies, the response also includes the controlling picklist name and dependency mappings. ### Method GET ### Endpoint /api/{version}/objects/picklists/{picklist_name} ### Parameters #### Path Parameters - **{picklist_name}** (string) - Required - The picklist `name` field value (e.g., `license_type__v`, `product_family__c`, `region__c`). #### Query Parameters - **loc** (boolean) - Optional - When localized (translated) strings or Label Sets are available, retrieve them by setting `loc` to `true`. ### Headers - **Accept** - `application/json` (default) or `application/xml` ### Request Example ``` curl -X GET -H "Authorization: {AUTH_VALUE}" \ https://myvault.veevavault.com/api/v26.2/objects/picklists/license_type__v ``` ### Response #### Success Response (200) - **responseStatus** (string) - Status of the response, e.g., `SUCCESS`. - **responseMessage** (string) - Message describing the response, e.g., `Success`. - **picklistValues** (array) - List of active picklist values in ascending order by their `order` attribute. - **name** (string) - The picklist value name, used only in the API and displayed in the Admin UI. - **label** (string) - The picklist value label, used in the API and UI. Users see the label when selecting picklist values. - **controllingPicklistName** (string) - Present only for system-managed picklists with dependencies. The name of the controlling picklist. - **picklistDependencies** (object) - Present only for system-managed picklists with dependencies. Maps controlling picklist values to arrays of dependent picklist value names. #### Response Example ``` { "responseStatus": "SUCCESS", "responseMessage": "Success", "picklistValues": [ { "name": "full__v", "label": "Full User" }, { "name": "read_only__v", "label": "Read-only User" }, { "name": "external__v", "label": "External User" }, { "name": "view_based__v", "label": "View-Based User" } ] } ``` #### Response Example: System-Managed Dependencies ``` { "responseStatus": "SUCCESS", "responseMessage": "Success", "picklistValues": [ { "name": "ad-02__v", "label": "Canillo" }, { "name": "ad-03__v", "label": "Encamp" }, { "name": "ad-04__v", "label": "La Massana" } ], "controllingPicklistName": "country_cda__v", "picklistDependencies": { "ad__v": [ "ad-02__v", "ad-03__v", "ad-04__v", "ad-05__v", "ad-06__v", "ad-07__v" ], "ae__v": [ "ae-aj__v", "ae-az__v", "ae-du__v", "ae-fu__v", "ae-rk__v", "ae-sh__v", "ae-uq__v" ] } } ``` ``` -------------------------------- ### Create a feature with the :feature command Source: https://general.veevavault.dev/medical/vault-toolbox/toolbox-designer Starts building a new feature after onboarding. The example prompt describes a Document Text Viewer that lists documents in the user's Vault and shows extracted text via the Vault API. ```bash :feature Document Text is Document Text Viewer that allows a user to see a list of documents in their Vault. The user can then select a document and view the extracted text using Vault API. List of documents is retrieved using Vault API. ``` -------------------------------- ### GET /api/{version}/objects/picklists Source: https://general.veevavault.dev/vault-api/api-reference/26.2/picklists/retrieve-all-picklists This snippet documents the GET /api/{version}/objects/picklists endpoint, including its headers, query parameters, request example, and response structure with detailed metadata fields. ```APIDOC ## GET /api/{version}/objects/picklists ### Description Retrieves all picklists in the authenticated Vault which the authenticated user has access to view. ### Method GET ### Endpoint /api/{version}/objects/picklists ### Parameters #### Headers - **Accept** (string) - Optional - Specifies the response format: `application/json` (default) or `application/xml`. #### Query Parameters - **loc** (boolean) - Optional - When localized (translated) strings or Label Sets are available, retrieve them by setting `loc` to `true`. ### Request Example ``` curl -X GET -H "Authorization: {AUTH_VALUE}" \ https://myvault.veevavault.com/api/v26.2/objects/picklists ``` ### Response #### Success Response (200) - **responseStatus** (string) - Status of the response, e.g., "SUCCESS". - **responseMessage** (string) - Response message, e.g., "Success". - **errorCodes** (null) - Error codes, if any. - **picklists** (array) - List of picklists. - **name** (string) - Picklist name. Used only in the API and displayed in the Admin UI. - **label** (string) - Picklist label. Used in the API and UI. Users see the label on document and object picklist fields. - **kind** (string) - Kind of picklist: `global` (applies to documents and objects) or `user` (applies to Vault users). - **system** (boolean) - If `true`, the picklist values cannot be added, edited, or removed. This attribute may not appear for all picklists. - **systemManaged** (boolean) - Indicates if the picklist is system-managed. If `true`, picklist values cannot be added, picklist names cannot be modified, and picklist value names cannot be edited. - **usedIn** (array) - The document type or object in which the picklist is defined. - **documentTypeName** (string) - For document picklists, the document type name in which the picklist is defined. - **objectName** (string) - For object picklists, the object name in which the picklist is defined. - **propertyName** (string) - For document picklists, the document field name using the picklist. For object picklists, the object field name using the picklist. - **errorType** (null) - Error type, if any. #### Response Example ``` { "responseStatus": "SUCCESS", "responseMessage": "Success", "errorCodes": null, "picklists": [ { "name": "issue_source__v", "label": "Source", "kind": "global", "systemManaged": false, "usedIn": [ { "objectName": "issue_escalation__v", "propertyName": "issue_source__v" } ] }, { "name": "third_party_service__v", "label": "Third Party Service?", "kind": "global", "systemManaged": false, "usedIn": [ { "objectName": "adverse_event_report__v", "propertyName": "third_party_service__v" } ] }, { "name": "exception_item_error_status__sys", "label": "User Exception Item Error Status", "kind": "global", "systemManaged": false, "usedIn": [ { "objectName": "exception_item__sys", "propertyName": "error_status__sys" } ] }, { "name": "audit_program_sig_type__sys", "label": "Audit Program Signature Type", "kind": "global", "systemManaged": false, "usedIn": [ { "objectName": "audit_program_sig__sys", "propertyName": "signature_type__sys" } ] }, { "name": "country_cda__v", "label": "Country", "kind": "global", "systemManaged": true, "usedIn": [ { "objectName": "country__v", "propertyName": "country_cda__v" } ] }, { "name": "email_template_type__v", "label": "Email Template Type", "kind": "global", "system": true, "usedIn": [ { "documentTypeName": "email_template__v", "propertyName": "emailTemplateType_b" } ] }, { "name": "license_type__v", "label": "License Type", "kind": "user", "system": true } ], "errorType": null } ``` ``` -------------------------------- ### Create src directory (Windows) Source: https://general.veevavault.dev/qualityone/custom-pages/getting-started/client-quickstart Creates the src directory and an empty hello-world.jsx file. Use this on Windows. ```bash mkdir src && echo. > src\hello-world.jsx ``` -------------------------------- ### Example Response for License Usage Source: https://general.veevavault.dev/medical/vault-api/api-reference/26.2/users/retrieve-application-license-usage Example response from the license usage endpoint. Shows doc_count for view-based licenses and per-application user_licensing details with licensed, used, and shared fields. ```json { "responseStatus": "SUCCESS", "doc_count": { "licensed": 4000, "used": 2380 }, "applications": [ { "application_name": "pm_promomats__v", "user_licensing": { "full__v": { "licensed": 500, "used": 491, "shared": false }, "external__v": { "licensed": 100, "used": 67, "shared": false }, "read_only__v": { "licensed": 100, "used": 28, "shared": false } } }, { "application_name": "pm_multichannel__v", "user_licensing": { "full__v": { "licensed": 500, "used": 441, "shared": false }, "external__v": { "licensed": 0, "used": 0, "shared": false }, "read_only__v": { "licensed": 0, "used": 0, "shared": false } } } ] } ``` -------------------------------- ### GET /api/{version}/objects/users Source: https://general.veevavault.dev/clinical/vault-api/api-reference/26.2/users/retrieve-all-users This snippet documents the GET /api/{version}/objects/users endpoint for retrieving all users at the domain level, including query parameters, request examples, and response structure. ```APIDOC ## GET /api/{version}/objects/users ### Description Retrieves all user records at the domain level. This endpoint retrieves legacy user records; for v18.1 and later, use VQL or Direct Data API to retrieve `user__sys` records. ### Method GET ### Endpoint `/api/{version}/objects/users` ### Headers - **Accept** (string) - Required - `application/json` (default) or `application/xml` ### Query Parameters - **vaults** (string) - Optional - Controls which Vaults' users are returned. Values: `all` (all Vaults in domain), `-1` (all Vaults except the one making the request), or a comma-separated list of Vault IDs (e.g., `3003,4004,5005`). If omitted, only users assigned to the Vault in which the request is made are returned. - **exclude_vault_membership** (boolean) - Optional - Set to `false` to include `vault_membership` fields. If `true` or omitted, `vault_membership` fields are not included. - **exclude_app_licensing** (boolean) - Optional - Set to `false` to include `app_licensing` fields. If `true` or omitted, `app_licensing` fields are not included. - **limit** (integer) - Optional - The size of the result set in the page. Default is 200. - **start** (integer) - Optional - The starting record number. Default is 0. - **sort** (string) - Optional - The sort order for the result set (`asc` - ascending, `desc` - descending). Default is `id asc`. Example: `user_name__v asc`. ### Request Example ``` curl -X GET -H "Authorization: {AUTH_VALUE}" \ https://myvault.veevavault.com/api/v26.2/objects/users ``` ### Response #### Success Response (200) - **responseStatus** (string) - Status of the response, e.g., `SUCCESS`. - **size** (integer) - Number of records returned. - **start** (integer) - Starting record number. - **limit** (integer) - Page limit. - **sort** (string) - Sort order used. - **users** (array) - List of user objects. Each user object contains: - **user** (object) - User details with fields: - **id** (integer) - User ID. - **user_name__v** (string) - User's email/username. - **user_first_name__v** (string) - User's first name. - **user_last_name__v** (string) - User's last name. #### Response Example ``` { "responseStatus": "SUCCESS", "size": 200, "start": 0, "limit": 200, "sort": "id asc", "users": [ { "user": { "id": 25501, "user_name__v": "ewoodhouse@veepharm.com", "user_first_name__v": "Elaine", "user_last_name__v": "Woodhouse" } }, { "user": { "id": 25502, "user_name__v": "bashton@veepharm.com", "user_first_name__v": "Bruce", "user_last_name__v": "Ashton" } }, { "user": { "id": 25503, "user_name__v": "tchung@veepharm.com", "user_first_name__v": "Thomas", "user_last_name__v": "Chung" } } ] } ``` ``` -------------------------------- ### Query Example with Response Source: https://general.veevavault.dev/clinical/vql/functions-options/attachment-field-functions Example query that searches the file name of an Attachment field on the Product object and returns the file handle, file name, file size, MIME type, and MD5 checksum. The response shows the returned data for a file named 'Cholecap-Logo 2.PNG'. ```vql SELECT file__c, FILENAME(file__c) as FileName, FILESIZE(file__c) as FileSize, MIMETYPE(file__c) as MIMEType, MD5CHECKSUM(file__c) as MD5Checksum FROM product__v FIND ('Cholecap' SCOPE FileName) ``` ```json { "responseStatus": "SUCCESS", "responseDetails": { "find": "('Cholecap' SCOPE FILENAME(file__c))", "pagesize": 1000, "pageoffset": 0, "size": 1, "total": 1 }, "data": [ { "file__c": "ATF-3265e4c4-bbd3-454c-a417-55d4bcbf7085", "FileName": "Cholecap-Logo 2.PNG", "FileSize": 45176, "MIMEType": "image/png", "MD5Checksum": "4bf1311688786e4eaae8174d11c82a81" } ] } ``` -------------------------------- ### Create esbuild.mjs file Source: https://general.veevavault.dev/clinical/custom-pages/getting-started/client-quickstart Create an empty esbuild.mjs file in the client/hello-world directory. The Windows command uses echo. >, while the Mac command uses touch. ```bat echo. > esbuild.mjs ``` ```bash touch esbuild.mjs ```