Bulk Create Binder Templates
Create from 1-500 new binder templates in your Vault.
POST
/api/{version}/objects/binders/templatesHeaders
Section link for Headers| Name | Description |
|---|---|
Content-Type | application/json or text/csv |
Accept | application/json (default) or application/xml |
Body Parameters
Section link for Body ParametersWhen creating binder templates, the following fields are required in all Vaults:
| Name | Description |
|---|---|
name__voptional | The name of the new binder templates. If not included, Vault will use the specified label__v value to generate a value for the name__v field. |
label__vrequired | The label of the new binder templates. This is the name users will see among the available binder templates in the UI. |
type__vrequired | The name of the document type to which the templates will be associated. |
subtype__voptional | The name of the document subtype to which the templates will be associated. This is only required if associating the templates with document subtypes. |
classification__voptional | The name of the document classification to which the templates will be associated. This is only required if associating the templates with document classifications. |
active__vrequired | Set to true or false to indicate whether or not the new binder templates should be set to active, i.e., available for selection when creating a binder. |
Example CSV Input
Section link for Example CSV Inputname__v | label__v | type__v | subtype__v | classification__v | active__v |
|---|---|---|---|---|---|
| binder_template_1__c | First Binder Template | site_master_file__v | true | ||
| Binder Template 2 | trial_master_file__v | true | |||
| Binder Template 3 | central_trial_documents__vs | trial_documents__vs | protocol__vs | true | |
| Binder Template 4 | central_trial_documents__vs | reports__vs | clinical_study_report__vs | false |
In this example input, we're creating four new binder templates in our Vault:
- We've only specified the
name__vvalue for the first template and given it a differentlabel__vvalue. The other templates will inherit theirname__vvalues from thelabel__vvalues. - We've specified the document type, subtype, and classification to which each binder template will be associated.
In this example:
- The input file format is set to CSV.
- The response format is not set and will default to JSON.
- The path/name of the CSV input file in our local directory is specified.
Request
Section link for Requestcurl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: text/csv" \
--data-binary @"C:\Vault\Templates\add_binder_templates.csv" \
https://myvault.veevavault.com/api/v25.1/objects/documents/templatesResponse
Section link for Response{
"responseStatus":"SUCCESS",
"data":[
{
"responseStatus":"SUCCESS",
"name":"binder_template_1__c"
},
{
"responseStatus":"SUCCESS",
"name":"binder_template_2__c"
},
{
"responseStatus":"SUCCESS",
"name":"binder_template_3__c"
},
{
"responseStatus":"FAILURE",
"errors":[
{
"type":"INVALID_DATA",
"message":"Error message describing why this template was not created."
}
]
}
]
}Response Details
Section link for Response DetailsOn SUCCESS, Vault returns the names of the new binder templates.