POST public-api/attachments/uplodBatchAttachmentsForForms

Upload the batch of Attachments For Forms works for attaching the list of attachments to an item according to the form type for several items as a batch. This Api will cover any form in the application which could have attachment. Requires the Edit permission of the form you are attempting to Edit, Role Site and Asset Type permissions are enforced when relevant Accepts a maximum of 500 records at a time



Request Information

URI Parameters

None.

Body Parameters

Collection of AttachmentsUploadAssociatedModel
NameDescriptionTypeAdditional information
AttachmentsList

Collection of AttachmentUploadAttributes

None.

AttachmentFormType

WtFormId.Contract- WtFormId.AssetFunding- WtFormId.Customer- WtFormId.Employee- WtFormId.AssetType- WtFormId.Asset WtFormId.InventoryItem - WtFormId.NonInventoryItem - WtFormId.KitItem - WtFormId.AssemblyItem - WtFormId.ServiceItem

WtFormId

None.

AssociatedObjectList

A list of objects to associate the attachments with. For example, a list of Asset Tags or Customer Numbers User must have permission to the form and Role Site and Asset Type restrictions are enforced where necessary

Collection of string

None.

Request Formats

application/json

Sample:
[
  {
    "AttachmentsList": [
      {
        "AttachmentFileByteArray": "QEA=",
        "AttachmentType": 0,
        "AttachmentFileName": "sample string 1",
        "IsDefaultAttachment": true
      },
      {
        "AttachmentFileByteArray": "QEA=",
        "AttachmentType": 0,
        "AttachmentFileName": "sample string 1",
        "IsDefaultAttachment": true
      }
    ],
    "AttachmentFormType": 0,
    "AssociatedObjectList": [
      "sample string 1",
      "sample string 2"
    ]
  },
  {
    "AttachmentsList": [
      {
        "AttachmentFileByteArray": "QEA=",
        "AttachmentType": 0,
        "AttachmentFileName": "sample string 1",
        "IsDefaultAttachment": true
      },
      {
        "AttachmentFileByteArray": "QEA=",
        "AttachmentType": 0,
        "AttachmentFileName": "sample string 1",
        "IsDefaultAttachment": true
      }
    ],
    "AttachmentFormType": 0,
    "AssociatedObjectList": [
      "sample string 1",
      "sample string 2"
    ]
  }
]



Response Information

Resource Description

WaspResultOfListOfWaspResultOfListOfAttachmentModel
NameDescriptionTypeAdditional information
Data

Type specific result that always depends on the function called.

Collection of WaspResultOfListOfAttachmentModel

None.

Messages

List of Messages. All APIs should return messages. If an API function returns an error you can find more information about the error or errors in this collection of messages.

Collection of WtResult

None.

BatchNumber

This is a global batch number generated by a mass group of transaction records to be returned to the consumer on each call to rolling transaction rules. This requests that each group of Move/Add/Remove transaction batches is tied together. In prior products (such as Mobile Asset Cloud), all are set to null and the only time when the batch number is generated is for multiple check-out transactions but the old is to generate for each responsible party.

integer

None.

HasError

True if an API function result has an error message in the results. If this is false, the function succeeded but other informative messages may be available.

boolean

None.

HasHttpError

True if an API function call could not be fully posted to the server or the results could not be fully returned.

boolean

None.

HasMessage

True if any message is available.

boolean

None.

HasSuccessWithMoreDataRemaining

True if the server sent part of the data and there is more data available. Use with paging APIs to fetch data one page at a time.

boolean

None.

TotalRecordsLongCount

This is the total number of records available in the database based on the query and filer conditions provided. It is possible that the value can change from call to call as users add and delete records so this should not be used to page through multiple recordsets of data. This is used, for example, to set relative scroll bar sizes. When paging through data using functions like the assetadvancedinfosearch, calculating TotalRecordsLongCount for every page full of data is an time-consuming operation. To avoid that extra calculation, and help prevent throttling, assign TotalRecordsLongCount to TotalCountFromPriorFetch in the AdvancedSearchParameters to skip recalculating this total page count and to page thru the records faster.

integer

None.

Response Formats

application/json

Sample:
{
  "Data": [
    {
      "Data": [
        {
          "AttachmentId": 1,
          "FormId": 2,
          "AssociationId": 3,
          "AttachmentFileName": "sample string 4",
          "AttachmentDataType": "sample string 5",
          "AttachmentGuid": "sample string 6",
          "AttachmentData": "QEA=",
          "AttachmentDataSize": 1,
          "AttachmentUploadedDate": "2024-04-27T18:17:19.390259+00:00",
          "AttachmentUploadedBy": "77484518-4d12-46e0-b58f-4cd1b5aad9a3",
          "UserName": "sample string 7",
          "AttachmentUriPath": "sample string 8",
          "AttachmentIsDefault": true,
          "AttachmentIsReadOnly": true,
          "HasAttachment": true,
          "AttachmentMobileDownload": true,
          "ApplicationId": 12
        },
        {
          "AttachmentId": 1,
          "FormId": 2,
          "AssociationId": 3,
          "AttachmentFileName": "sample string 4",
          "AttachmentDataType": "sample string 5",
          "AttachmentGuid": "sample string 6",
          "AttachmentData": "QEA=",
          "AttachmentDataSize": 1,
          "AttachmentUploadedDate": "2024-04-27T18:17:19.390259+00:00",
          "AttachmentUploadedBy": "77484518-4d12-46e0-b58f-4cd1b5aad9a3",
          "UserName": "sample string 7",
          "AttachmentUriPath": "sample string 8",
          "AttachmentIsDefault": true,
          "AttachmentIsReadOnly": true,
          "HasAttachment": true,
          "AttachmentMobileDownload": true,
          "ApplicationId": 12
        }
      ],
      "Messages": [
        {
          "ResultCode": 0,
          "Message": "sample string 1",
          "HttpStatusCode": 200,
          "FieldName": "sample string 2"
        },
        {
          "ResultCode": 0,
          "Message": "sample string 1",
          "HttpStatusCode": 200,
          "FieldName": "sample string 2"
        }
      ],
      "BatchNumber": 1,
      "HasError": false,
      "HasHttpError": false,
      "HasMessage": true,
      "HasSuccessWithMoreDataRemaining": false,
      "TotalRecordsLongCount": 1
    },
    {
      "Data": [
        {
          "AttachmentId": 1,
          "FormId": 2,
          "AssociationId": 3,
          "AttachmentFileName": "sample string 4",
          "AttachmentDataType": "sample string 5",
          "AttachmentGuid": "sample string 6",
          "AttachmentData": "QEA=",
          "AttachmentDataSize": 1,
          "AttachmentUploadedDate": "2024-04-27T18:17:19.390259+00:00",
          "AttachmentUploadedBy": "77484518-4d12-46e0-b58f-4cd1b5aad9a3",
          "UserName": "sample string 7",
          "AttachmentUriPath": "sample string 8",
          "AttachmentIsDefault": true,
          "AttachmentIsReadOnly": true,
          "HasAttachment": true,
          "AttachmentMobileDownload": true,
          "ApplicationId": 12
        },
        {
          "AttachmentId": 1,
          "FormId": 2,
          "AssociationId": 3,
          "AttachmentFileName": "sample string 4",
          "AttachmentDataType": "sample string 5",
          "AttachmentGuid": "sample string 6",
          "AttachmentData": "QEA=",
          "AttachmentDataSize": 1,
          "AttachmentUploadedDate": "2024-04-27T18:17:19.390259+00:00",
          "AttachmentUploadedBy": "77484518-4d12-46e0-b58f-4cd1b5aad9a3",
          "UserName": "sample string 7",
          "AttachmentUriPath": "sample string 8",
          "AttachmentIsDefault": true,
          "AttachmentIsReadOnly": true,
          "HasAttachment": true,
          "AttachmentMobileDownload": true,
          "ApplicationId": 12
        }
      ],
      "Messages": [
        {
          "ResultCode": 0,
          "Message": "sample string 1",
          "HttpStatusCode": 200,
          "FieldName": "sample string 2"
        },
        {
          "ResultCode": 0,
          "Message": "sample string 1",
          "HttpStatusCode": 200,
          "FieldName": "sample string 2"
        }
      ],
      "BatchNumber": 1,
      "HasError": false,
      "HasHttpError": false,
      "HasMessage": true,
      "HasSuccessWithMoreDataRemaining": false,
      "TotalRecordsLongCount": 1
    }
  ],
  "Messages": [
    {
      "ResultCode": 0,
      "Message": "sample string 1",
      "HttpStatusCode": 200,
      "FieldName": "sample string 2"
    },
    {
      "ResultCode": 0,
      "Message": "sample string 1",
      "HttpStatusCode": 200,
      "FieldName": "sample string 2"
    }
  ],
  "BatchNumber": 1,
  "HasError": false,
  "HasHttpError": false,
  "HasMessage": true,
  "HasSuccessWithMoreDataRemaining": false,
  "TotalRecordsLongCount": 1
}