Create BP Record with Attachment
POST /ws/rest/service/v2/bp/record/file
Purpose
Creates a record with attachments for the following types of BPs:
- Shell-level BPs based on project_number
- Company-level BPs if project/shell number is not provided
This REST service uses the Step form (Creation form) to create a BP record. All the required fields and validation rules run against the Creation form used in the workflow details.
Notes:
- Only one record with attachments is supported in this call.
- For Document-type BPs, new attachments can be added to existing line items only in the Custom Detail Form. If the attachment already exists for a record, it will be ignored and will not get revised.
Prerequisites
Ensure the following:
- Auto Creation settings are mandatory in the shell or company Setup for the Business Process (Admin mode).
- For all BPs, select the Adding Attachment check box in the Upper Form or Detail Form.
- To add attachments to line item records in Document-type BPs, select the Allow Attachments to Line Items check box only in the Custom Detail Form in uDesigner.
Request Format
All parameters must be URL encoded. Both input & output in JSON format in the body. The input JSON provides various options to fetch the data.
Notes:
- If "adding attachment" is disabled in Upper Form or Detail Form, and you try to attach file to the corresponding form, the record creation will fail.
- Only one record creation with attachments is supported in this call.
- If the creation form has the "add attachment" disabled, the files will not get attached.
- If the "_attachment" (outside data list) for zip file is not provided, the record will be created without attachment.
- Field properties such as Read-only in step form (Creation Form) will be retained. The Field mandatory in step form must be present in Integration Form with direction set as "both" or "input".
- Field direction provided in Integration form will be retained.
- In input JSON options, the "project_number" specifies the shell in which the records exist; if the "project_number" is not provided, the records are from Company Level.
- If a "record_no" is not provided, an auto-generated record_no is assigned to the record. If a unique "record_no" is provided, the record is created with the specified "record_no". If you use a "record_no" that is not unique, an error occurs.
- The "bpname" is mandatory and is part of options form parameter.
- If the "workflow_details" is not specified, the auto-creation settings, defined on the BP setup, will be used.
- If the "workflow_details" are specified, the three params "user_name," "workflow_name," and "action_name" are mandatory.
- If data elements are set to auto-populate from Base Commit as well as auto-populate from SOV in the payment business process standard line items, then the values from Base commit takes precedence for auto-population. Also, the auto-populate from Base Commit or Change commit takes precedence in payment line items if 0 or no value is provided via integration.
If files from the Document Manager (DM) need to be attached, the field "_attachment_from_dm" must be used. Within that field, a string of comma separated file IDs for the relevant DM files must be provided to the "dm_file_ids" field. Up to 50 files can be attached from the DM at the record and each line item level. Text Type BPs are not currently supported. Validations performed for attaching files from the DM using file IDs include:
- If the integration user has DM permissions.
- If the string provided to field "dm_file_ids" is a string of comma separated file IDs.
- If the file IDs provided are valid file IDs.
- Record and line item each have up to 50 files attached from the DM.
- Example input field: "_attachment_from_dm":{"dm_file_ids":"123,345"}
Behavior of the Due Date (due_date) Field
When you create workflow BP records through a REST service, the system currently sets the Due Date automatically based on the Workflow Settings; the Due Date provided in the input request is ignored.
When you update workflow BP records through a REST service, you cannot change the Due Date.
Response Format
A JSON object is returned in the following format.
{
"data": [],
"message": [],
"status": <REST status code value>
}
A successful response displays a status code 200.
A failed response displays a message with a status code.
Sample Request
{
"options": {
"project_number" : "P-0002",
"bpname": "Vendors",
"workflow_details":
{
"workflow_name": "workflow_name",
"user_name" : "first_name last_name",
"action_name" : "action_name"
}
},
"data": [
{
"uuu_user_id": "a@abc.com",
"uuu_record_last_update_date": "04-12-2018",
"uveFaxTB16": null,
"uveCertificateNoTB64": null,
"uvePrimaryContactTB64": "a",
"title": "v-00101",
"uveLicenseNoTB16": null,
"uuu_contact_company": "v-00101",
"uveCOIAmoutCA": 0,
"_bp_lineitems": [
{
"uirCntctFstNmTB": "a",
"uuu_user_workphone": null,
"uuu_tab_id": "List of Contacts",
"title": "t",
"ugenAddress1TXT120": null,
"ugenAddress2TXT120": null,
"ugenCountryPD": null,
"ugenCityTXT50": null,
"short_desc": "Vendor Contact",
"uriCntctLstNmTB": "b",
"ugenStatePD": null,
"ugenZipCodeTXT16": null,
"uveEmailTB120": "hello@abc.com",
"ugenAddress3TXT120": null,
"_attachment":[
{
"file_name":"new 1.txt",
"title":"file_title",
"issue_date":"05/06/2018",
"revision_no":"100"
}
],
"_attachment_from_dm":{
"dm_file_ids":"456,789"
}
}
],
"uvePolicyNoTB32": null,
"uveVendorTypePD": "Architect",
"ugenCityTXT50": null,
"uveCoiExpDOP": null,
"uuu_dm_publish_path": "v_path",
"uuu_contact_last_name": "b",
"ugenZipCodeTXT16": null,
"uveEmailTB120": "a@abc.com",
"ugenAddress3TXT120": null,
"uveReferenceIdTB16": null,
"uuu_creation_date": "04-12-2018",
"ugenRemarksTB4000": null,
"uvePhoneTB64": null,
"uveTaxIDTB16": null,
"uveMinorityBusCB": 0,
"uveInsuranceCoTB32": null,
"ugenExpirationDateDOP": null,
"uveWomanOwnedCB": 0,
"uveVendorNameTB50": "v-00101",
"ugenAddress1TXT120": null,
"uveDisadvantagedBusCB": 0,
"ugenDiscipline": null,
"creator_id": "Company Administrator",
"ugenAddress2TXT120": null,
"ugenCountryPD": null,
"uveVendorIDTB16": "v-00101",
"ugenStatePD": null,
"uuu_contact_first_name": "a",
"status": "Active",
"_attachment":[
{
"file_name":"new 1.txt",
"title":"file_title1",
"issue_date":"05/06/2018",
"revision_no":"300"
},
{
"file_name":"exp1.txt",
"title":"file_title2",
"issue_date":"05/06/2018",
"revision_no":"200"
}
],
"_attachment_from_dm":{
"dm_file_ids":"123,345"
}
}
]
,
"_attachment": {
"zipped_file_name" : "create.zip",
"zipped_file_size": "746089",
"zipped_file_content" :"<base64_encoded string of create.zip file>"
}
}
Sample Success Response
{
"data": [],
"message": [
{
"uuu_user_id": "a@abc.com",
"uuu_record_last_update_date": "04-12-2018",
"uveFaxTB16": null,
"uveCertificateNoTB64": null,
"uvePrimaryContactTB64": "a",
"title": "v-00101",
"uveLicenseNoTB16": null,
"uuu_contact_company": "v-00101",
"_record_status": "success",
"uveCOIAmoutCA": 0,
"_bp_lineitems": [
{
"uirCntctFstNmTB": "a",
"uuu_user_workphone": null,
"uuu_tab_id": "List of Contacts",
"title": "t",
"ugenAddress1TXT120": null,
"_attachment_from_dm":{
"dm_file_ids":"456,789"
},
"_attachment": [
{
"issue_date": "05/06/2018",
"revision_no": "100",
"file_name": "new 1.txt",
"title": "file_title"
}
],
"ugenAddress2TXT120": null,
"ugenCountryPD": null,
"ugenCityTXT50": null,
"short_desc": "Vendor Contact",
"uriCntctLstNmTB": "b",
"ugenStatePD": null,
"ugenZipCodeTXT16": null,
"uveEmailTB120": "hello@abc.com",
"ugenAddress3TXT120": null
}
],
"uvePolicyNoTB32": null,
"_attachment_from_dm":{
"dm_file_ids":"123,345"
}
"_attachment": [
{
"issue_date": "05/06/2018",
"revision_no": "300",
"file_name": "new 1.txt",
"title": "file_title1"
},
{
"issue_date": "05/06/2018",
"revision_no": "200",
"file_name": "exp1.txt",
"title": "file_title2"
}
],
"record_no": "VEN-0086",
"uveVendorTypePD": "Architect",
"ugenCityTXT50": null,
"uveCoiExpDOP": null,
"uuu_dm_publish_path": "v_path",
"uuu_contact_last_name": "b",
"ugenZipCodeTXT16": null,
"uveEmailTB120": "a@abc.com",
"ugenAddress3TXT120": null,
"uveReferenceIdTB16": null,
"uuu_creation_date": "04-12-2018",
"ugenRemarksTB4000": null,
"uvePhoneTB64": null,
"uveTaxIDTB16": null,
"uveMinorityBusCB": 0,
"uveInsuranceCoTB32": null,
"ugenExpirationDateDOP": null,
"uveWomanOwnedCB": 0,
"uveVendorNameTB50": "v-00101",
"ugenAddress1TXT120": null,
"uveDisadvantagedBusCB": 0,
"ugenDiscipline": null,
"creator_id": "Company Administrator",
"ugenAddress2TXT120": null,
"ugenCountryPD": null,
"uveVendorIDTB16": "v-00101",
"ugenStatePD": null,
"uuu_contact_first_name": "a",
"status": "Active"
}
],
"status": 200
}
Sample Failed Response
{
"data": [],
"message": [
{
"_record_status": "Error Business Process record_no hello already exists. ",
"record": {
"uuu_user_id": "a@abc.com",
"uuu_record_last_update_date": "04-12-2018",
"uveFaxTB16": null,
"uveCertificateNoTB64": null,
"uvePrimaryContactTB64": "a",
"title": "v-00101",
"uveLicenseNoTB16": null,
"uuu_contact_company": "v-00101",
"uveCOIAmoutCA": 0,
"_bp_lineitems": [
{
"uirCntctFstNmTB": "a",
"uuu_user_workphone": null,
"uuu_tab_id": "List of Contacts",
"title": "t",
"ugenAddress1TXT120": null,
"ugenAddress2TXT120": null,
"ugenCountryPD": null,
"ugenCityTXT50": null,
"short_desc": "Vendor Contact",
"uriCntctLstNmTB": "b",
"ugenStatePD": null,
"ugenZipCodeTXT16": null,
"uveEmailTB120": "hello@abc.com",
"ugenAddress3TXT120": null
}
],
"uvePolicyNoTB32": null,
"record_no": "hello",
"_attachment_from_dm": {
"dm_file_ids": "115"
}
"_attachment": [
{
"file_name": "new 1.txt"
}
],
"uveVendorTypePD": "Architect",
"ugenCityTXT50": null,
"uveCoiExpDOP": null,
"uuu_dm_publish_path": "v_path",
"uuu_contact_last_name": "b",
"ugenZipCodeTXT16": null,
"uveEmailTB120": "a@abc.com",
"ugenAddress3TXT120": null,
"uveReferenceIdTB16": null,
"uuu_creation_date": "04-12-2018",
"ugenRemarksTB4000": null,
"uvePhoneTB64": null,
"uveTaxIDTB16": null,
"uveMinorityBusCB": 0,
"uveInsuranceCoTB32": null,
"ugenExpirationDateDOP": null,
"uveWomanOwnedCB": 0,
"uveVendorNameTB50": "v-00101",
"ugenAddress1TXT120": null,
"uveDisadvantagedBusCB": 0,
"ugenDiscipline": null,
"creator_id": "Company Administrator",
"ugenAddress2TXT120": null,
"ugenCountryPD": null,
"uveVendorIDTB16": "v-00101",
"ugenStatePD": null,
"uuu_contact_first_name": "a",
"status": "Active"
}
}
],
"status": 3000
}
or if zip_file_size of uploaded zip file is not correct:
{
"data": [],
"message": [
"Uploaded Zip file is invalid"
],
"status": 3003
}
Validations
The following validations are performed:
- If the user is a valid active user in the project.
- The workflow name is valid and active.
- User is an assignee (user/group) on the creation step of the workflow.
- Action name is valid outgoing link from the creation step.
- BP records will be created successfully:
- If a single user with a specific First Name and Last Name exists in a project with a status of Active/On-hold.
- If multiple users exist with identical First Name and Last Name, but only one user's status is Active/On-hold while all other users have an Inactive status.
- BP records will not be created if multiple users exist with identical First Name and Last Name, with a status of Active/On-hold/Inactive.
Error Messages
The following error messages may display:
- Enter a valid or an active user. (Missing key or invalid user name)
- The workflow name is not valid. (Missing key or invalid/inactive workflow name)
- The user does not have an active workflow template. (User is not an assignee on the creation step)
- The workflow action name is not valid. (Missing key or invalid outgoing action name from creation step)
- If the "_attachment" (outside data list) for zip file is not provided, the record will be created without attachment.
Related Topics
Update BP Record with Attachment
Payment Application with Auto-populate from SOV and Commits
Add Assignees to Workflow BP Records
Task Reassignment of Workflow Records
Bulk Reverse Auto-populate Records
Get Schedule of Values (SOVs) For Base Commit Type BPs
Terminate Workflow and Non-Workflow BP Records
Last Published Wednesday, April 9, 2025