Updating a Single Record with Multiple Attachments

You can update a single account to add multiple attachments using either of the two methods described below.

Updating a Single Record with Multiple Attachments: Specifying the ID in the Request

This example uses single object operations syntax to perform the update, whereby the ID is specified in the URI.

This example describes how to insert multiple attachments to a single record. In this example, an account is updated with three additional files. The request body is an array, and each array element contains attachment details, such as the file name. The attachment contents are provided in the Accnt Attachment Id field as a Base64 encoded value. The response body contains the attachment contents, attachment IDs, and a link to download the new attachments.

  • URI: https://ServerName:port/siebel/v1.0/data/Account/Account/1-5GZO/Account%20Attachment/

  • HTTP Method: PUT

  • Content-Type: application/json

  • Transfer encoding: Chunked

  • Authorization: Basic

  • Request body:

    {
        "Account Attachment": [
            {
                "AccntFileName": "multi_atta_File_acc_1",
                "AccntFileExt": "txt",
                "Accnt Attachment Id": "RmlsZSBmb3IgYWNjb3VudCBhdHRhY2htZW50IGZvciBmYWNjb3VudCBudW1iZXIgMw=="
            },
            {
                "AccntFileName": "multi_atta_File_acc_2",
                "AccntFileExt": "txt",
                "Accnt Attachment Id": "RmlsZSBmb3IgYWNjb3VudCBhdHRhY2htZW50IGZvciBmYWNjb3VudCBudW1iZXIgMw=="
            },
            {
                "AccntFileName": "multi_atta_File_acc_3",
                "AccntFileExt": "txt",
                "Accnt Attachment Id": "RmlsZSBmb3IgYWNjb3VudCBhdHRhY2htZW50IGZvciBmYWNjb3VudCBudW1iZXIgMw=="
            }
        ]
    }
  • Response body:

    {
        "items": {
            "Id": "1-5GZO",
            "Account Attachment": [
                {
                    "Id": "88-1X5M6B",
                    "Accnt Attachment Id": "https://ServerName:port/siebel/v1.0/data/Account/Account/1-5GZO/Account Attachment/88-1X5M6B?fields=Accnt Attachment Id",
                    "Link": {
                        "rel": "self",
                        "href": "https://ServerName:port/siebel/v1.0/data/Account/Account/1-5GZO/Account Attachment/88-1X5M6B",
                        "name": "Account Attachment"
                    }
                },
                {
                    "Id": "88-1X62NN",
                    "Accnt Attachment Id": "https://ServerName:port/siebel/v1.0/data/Account/Account/1-5GZO/Account Attachment/88-1X62NN?fields=Accnt Attachment Id",
                    "Link": {
                        "rel": "self",
                        "href": "https://ServerName:port/siebel/v1.0/data/Account/Account/1-5GZO/Account Attachment/88-1X62NN",
                        "name": "Account Attachment"
                    }
                },
                {
                    "Id": "88-1X62NO",
                    "Accnt Attachment Id": "https://ServerName:port/siebel/v1.0/data/Account/Account/1-5GZO/Account Attachment/88-1X62NO?fields=Accnt Attachment Id",
                    "Link": {
                        "rel": "self",
                        "href": "https://ServerName:port/siebel/v1.0/data/Account/Account/1-5GZO/Account Attachment/88-1X62NO",
                        "name": "Account Attachment"
                    }
                }
            ],
            "Link": {
                "rel": "self",
                "href": "https://ServerName:port/siebel/v1.0/data/Account/Account/1-5GZO",
                "name": "Account"
            }
        }
    }

Updating a Record with Multiple Attachments: Specifying the ID in an Array

This example uses multi-object object operations syntax to perform the update, whereby the ID is contained in the array body.

This example describes how to update an account by adding several attachments. The request body has an array with one account, and the child attachment, Account Attachment, is an array of attachment objects. The attachment contents are provided in the Accnt Attachment Id field as a Base64 encoded value. The response body contains the attachment contents, attachment IDs, and a link to download the new attachments.

  • URL: https://ServerName:port/siebel/v1.0/data/Account/Account/

  • HTTP Method: PUT

  • Accept: application/json

  • Content-Type: multipart/form-data

  • Transfer encoding: Chunked

  • Authorization: Basic

  • Request body:
    [
        {
            "Name": "SingleAccountMultiAttachments",
            "Location": "HQ-Distribution",
            "Primary Organization Id": "1-1DG",
            "Primary Organization": "Millennium Institutional Finance Services IF ENU",
            "Description": "Updated AccountData 1 new ",
            "Account Attachment": [
                {
                    "AccntFileName": "SingleAccountMultiAttachments_file_1",
                    "AccntFileExt": "txt",
                    "Accnt Attachment Id": "RmlsZSBmb3IgYWNjb3VudCBhdHRhY2htZW50IGZvciBmYWNjb3VudCBudW1iZXIgMw=="
                },
                {
                    "AccntFileName": "SingleAccountMultiAttachments_file_2",
                    "AccntFileExt": "txt",
                    "Accnt Attachment Id": "RmlsZSBmb3IgYWNjb3VudCBhdHRhY2htZW50IGZvciBmYWNjb3VudCBudW1iZXIgMw=="
                },
                {
                    "AccntFileName": "SingleAccountMultiAttachments_file_3",
                    "AccntFileExt": "txt",
                    "Accnt Attachment Id": "RmlsZSBmb3IgYWNjb3VudCBhdHRhY2htZW50IGZvciBmYWNjb3VudCBudW1iZXIgMw=="
                }
            ]
        }
    ]
  • Response body:
    {
      "items": [
        {
          "Name": "SingleAccountMultiAttachments",
          "Id": "88-1X5MBT",
          "Location": "HQ-Distribution",
          "Primary Organization Id": "1-1DG",
          "Primary Organization": "Millennium Institutional Finance Services IF ENU",
          "Description": "Updated AccountData 1 new ",
          "Account Attachment": [
            {
              "Id": "88-1X5MBW",
              "Accnt Attachment Id": "https://ServerName:port/siebel/v1.0/data/Account/Account/88-1X5MBT/Account Attachment/88-1X5MBW?fields=Accnt Attachment Id",
              "Link": {
                "rel": "self",
                "href": "https://ServerName:port/siebel/v1.0/data/Account/Account/88-1X5MBT/Account Attachment/88-1X5MBW",
                "name": "Account Attachment"
              }
            },
            {
              "Id": "88-1X5MBX",
              "Accnt Attachment Id": "https://ServerName:port/siebel/v1.0/data/Account/Account/88-1X5MBT/Account Attachment/88-1X5MBX?fields=Accnt Attachment Id",
              "Link": {
                "rel": "self",
                "href": "https://ServerName:port/siebel/v1.0/data/Account/Account/88-1X5MBT/Account Attachment/88-1X5MBX",
                "name": "Account Attachment"
              }
            },
            {
              "Id": "88-1X5MBY",
              "Accnt Attachment Id": "https://ServerName:port/siebel/v1.0/data/Account/Account/88-1X5MBT/Account Attachment/88-1X5MBY?fields=Accnt Attachment Id",
              "Link": {
                "rel": "self",
                "href": "https://ServerName:port/siebel/v1.0/data/Account/Account/88-1X5MBT/Account Attachment/88-1X5MBY",
                "name": "Account Attachment"
              }
            }
          ],
          "Link": {
            "rel": "self",
            "href": "https://ServerName:port/siebel/v1.0/data/Account/Account/88-1X5MBT",
            "name": "Account"
          }
        }
      ]
    }