Chilkat Online Tools

SQL Server / Salesforce Platform APIs / Get a Batch of Records

Back to Collection Items

-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls.
--
CREATE PROCEDURE ChilkatSample
AS
BEGIN
    DECLARE @hr int
    -- Important: Do not use nvarchar(max).  See the warning about using nvarchar(max).
    DECLARE @sTmp0 nvarchar(4000)
    -- This example assumes the Chilkat API to have been previously unlocked.
    -- See Global Unlock Sample for sample code.

    DECLARE @http int
    EXEC @hr = sp_OACreate 'Chilkat_9_5_0.Http', @http OUT
    IF @hr <> 0
    BEGIN
        PRINT 'Failed to create ActiveX component'
        RETURN
    END

    DECLARE @success int

    -- Adds the "Authorization: Bearer <access_token>" header.
    EXEC sp_OASetProperty @http, 'AuthToken', '<access_token>'

    DECLARE @sbResponseBody int
    EXEC @hr = sp_OACreate 'Chilkat_9_5_0.StringBuilder', @sbResponseBody OUT

    EXEC sp_OAMethod @http, 'QuickGetSb', @success OUT, 'https://domain.com/services/data/v{{version}}/ui-api/records/batch/:RECORD_IDS', @sbResponseBody
    IF @success = 0
      BEGIN
        EXEC sp_OAGetProperty @http, 'LastErrorText', @sTmp0 OUT
        PRINT @sTmp0
        EXEC @hr = sp_OADestroy @http
        EXEC @hr = sp_OADestroy @sbResponseBody
        RETURN
      END

    DECLARE @jResp int
    EXEC @hr = sp_OACreate 'Chilkat_9_5_0.JsonObject', @jResp OUT

    EXEC sp_OAMethod @jResp, 'LoadSb', @success OUT, @sbResponseBody
    EXEC sp_OASetProperty @jResp, 'EmitCompact', 0


    PRINT 'Response Body:'
    EXEC sp_OAMethod @jResp, 'Emit', @sTmp0 OUT
    PRINT @sTmp0

    DECLARE @respStatusCode int
    EXEC sp_OAGetProperty @http, 'LastStatus', @respStatusCode OUT

    PRINT 'Response Status Code = ' + @respStatusCode
    IF @respStatusCode >= 400
      BEGIN

        PRINT 'Response Header:'
        EXEC sp_OAGetProperty @http, 'LastHeader', @sTmp0 OUT
        PRINT @sTmp0

        PRINT 'Failed.'
        EXEC @hr = sp_OADestroy @http
        EXEC @hr = sp_OADestroy @sbResponseBody
        EXEC @hr = sp_OADestroy @jResp
        RETURN
      END

    -- Sample JSON response:
    -- (Sample code for parsing the JSON response is shown below)

    -- {
    --   "hasErrors": false,
    --   "results": [
    --     {
    --       "result": {
    --         "apiName": "Account",
    --         "childRelationships": {},
    --         "eTag": "8aae3f4fbe3055e68df1d4c8a989a671",
    --         "fields": {
    --           "AnnualRevenue": {
    --             "displayValue": "$350,000,000",
    --             "value": 350000000
    --           },
    --           "BillingCity": {
    --             "displayValue": null,
    --             "value": "Burlington"
    --           },
    --           "BillingCountry": {
    --             "displayValue": null,
    --             "value": "USA"
    --           },
    --           "BillingPostalCode": {
    --             "displayValue": null,
    --             "value": "27215"
    --           },
    --           "BillingState": {
    --             "displayValue": null,
    --             "value": "NC"
    --           },
    --           "BillingStreet": {
    --             "displayValue": null,
    --             "value": "525 S. Lexington Ave"
    --           },
    --           "Industry": {
    --             "displayValue": "Apparel",
    --             "value": "Apparel"
    --           },
    --           "Name": {
    --             "displayValue": null,
    --             "value": "Burlington Textiles Corp of America"
    --           },
    --           "Owner": {
    --             "displayValue": "Philippe Ozil",
    --             "value": {
    --               "apiName": "User",
    --               "childRelationships": {},
    --               "eTag": "cc07f7ef1b08ddbd75074c69512dd388",
    --               "fields": {
    --                 "Id": {
    --                   "displayValue": null,
    --                   "value": "005B0000003TOI6IAO"
    --                 },
    --                 "Name": {
    --                   "displayValue": null,
    --                   "value": "Philippe Ozil"
    --                 }
    --               },
    --               "id": "005B0000003TOI6IAO",
    --               "lastModifiedById": "005B0000003TOI6IAO",
    --               "lastModifiedDate": "2023-02-02T10:32:12.000Z",
    --               "recordTypeId": null,
    --               "recordTypeInfo": null,
    --               "systemModstamp": "2023-09-27T15:47:51.000Z",
    --               "weakEtag": 1695829671000
    --             }
    --           },
    --           "OwnerId": {
    --             "displayValue": null,
    --             "value": "005B0000003TOI6IAO"
    --           },
    --           "Parent": {
    --             "displayValue": null,
    --             "value": null
    --           },
    --           "ParentId": {
    --             "displayValue": null,
    --             "value": null
    --           },
    --           "Phone": {
    --             "displayValue": null,
    --             "value": "(336) 222-7000"
    --           },
    --           "PhotoUrl": {
    --             "displayValue": null,
    --             "value": "/services/images/photo/001B000000UnQ2wIAF"
    --           },
    --           "Site": {
    --             "displayValue": null,
    --             "value": null
    --           },
    --           "Type": {
    --             "displayValue": "Customer - Direct",
    --             "value": "Customer - Direct"
    --           },
    --           "Website": {
    --             "displayValue": null,
    --             "value": "www.burlington.com"
    --           }
    --         },
    --         "id": "001B000000UnQ2wIAF",
    --         "lastModifiedById": "005B0000003TOI6IAO",
    --         "lastModifiedDate": "2017-08-18T14:46:22.000Z",
    --         "recordTypeId": "012000000000000AAA",
    --         "recordTypeInfo": null,
    --         "systemModstamp": "2017-08-18T14:46:22.000Z",
    --         "weakEtag": 1503067582000
    --       },
    --       "statusCode": 200
    --     },
    --     {
    --       "result": {
    --         "apiName": "Account",
    --         "childRelationships": {},
    --         "eTag": "a825a67a87fa16446d82b4948e5643c7",
    --         "fields": {
    --           "AnnualRevenue": {
    --             "displayValue": "$50,000,000",
    --             "value": 50000000
    --           },
    --           "BillingCity": {
    --             "displayValue": null,
    --             "value": "Lawrence"
    --           },
    --           "BillingCountry": {
    --             "displayValue": null,
    --             "value": "USA"
    --           },
    --           "BillingPostalCode": {
    --             "displayValue": null,
    --             "value": "66045"
    --           },
    --           "BillingState": {
    --             "displayValue": null,
    --             "value": "KS"
    --           },
    --           "BillingStreet": {
    --             "displayValue": null,
    --             "value": "1301 Hoch Drive"
    --           },
    --           "Industry": {
    --             "displayValue": "Consulting",
    --             "value": "Consulting"
    --           },
    --           "Name": {
    --             "displayValue": null,
    --             "value": "Dickenson plc"
    --           },
    --           "Owner": {
    --             "displayValue": "Philippe Ozil",
    --             "value": {
    --               "apiName": "User",
    --               "childRelationships": {},
    --               "eTag": "cc07f7ef1b08ddbd75074c69512dd388",
    --               "fields": {
    --                 "Id": {
    --                   "displayValue": null,
    --                   "value": "005B0000003TOI6IAO"
    --                 },
    --                 "Name": {
    --                   "displayValue": null,
    --                   "value": "Philippe Ozil"
    --                 }
    --               },
    --               "id": "005B0000003TOI6IAO",
    --               "lastModifiedById": "005B0000003TOI6IAO",
    --               "lastModifiedDate": "2023-02-02T10:32:12.000Z",
    --               "recordTypeId": null,
    --               "recordTypeInfo": null,
    --               "systemModstamp": "2023-09-27T15:47:51.000Z",
    --               "weakEtag": 1695829671000
    --             }
    --           },
    --           "OwnerId": {
    --             "displayValue": null,
    --             "value": "005B0000003TOI6IAO"
    --           },
    --           "Parent": {
    --             "displayValue": null,
    --             "value": null
    --           },
    --           "ParentId": {
    --             "displayValue": null,
    --             "value": null
    --           },
    --           "Phone": {
    --             "displayValue": null,
    --             "value": "(785) 241-6200"
    --           },
    --           "PhotoUrl": {
    --             "displayValue": null,
    --             "value": "/services/images/photo/001B000000UnQ2yIAF"
    --           },
    --           "Site": {
    --             "displayValue": null,
    --             "value": null
    --           },
    --           "Type": {
    --             "displayValue": "Customer - Channel",
    --             "value": "Customer - Channel"
    --           },
    --           "Website": {
    --             "displayValue": null,
    --             "value": "dickenson-consulting.com"
    --           }
    --         },
    --         "id": "001B000000UnQ2yIAF",
    --         "lastModifiedById": "005B0000003TOI6IAO",
    --         "lastModifiedDate": "2017-08-18T14:46:22.000Z",
    --         "recordTypeId": "012000000000000AAA",
    --         "recordTypeInfo": null,
    --         "systemModstamp": "2017-08-18T14:46:22.000Z",
    --         "weakEtag": 1503067582000
    --       },
    --       "statusCode": 200
    --     }
    --   ]
    -- }

    -- Sample code for parsing the JSON response...
    -- Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code

    DECLARE @ApiName nvarchar(4000)

    DECLARE @ETag nvarchar(4000)

    DECLARE @DisplayValue nvarchar(4000)

    DECLARE @Value int

    DECLARE @BillingCityDisplayValue nvarchar(4000)

    DECLARE @BillingCityValue nvarchar(4000)

    DECLARE @BillingCountryDisplayValue nvarchar(4000)

    DECLARE @BillingCountryValue nvarchar(4000)

    DECLARE @BillingPostalCodeDisplayValue nvarchar(4000)

    DECLARE @BillingPostalCodeValue nvarchar(4000)

    DECLARE @BillingStateDisplayValue nvarchar(4000)

    DECLARE @BillingStateValue nvarchar(4000)

    DECLARE @BillingStreetDisplayValue nvarchar(4000)

    DECLARE @BillingStreetValue nvarchar(4000)

    DECLARE @IndustryDisplayValue nvarchar(4000)

    DECLARE @IndustryValue nvarchar(4000)

    DECLARE @NameDisplayValue nvarchar(4000)

    DECLARE @NameValue nvarchar(4000)

    DECLARE @OwnerDisplayValue nvarchar(4000)

    DECLARE @ValueApiName nvarchar(4000)

    DECLARE @ValueETag nvarchar(4000)

    DECLARE @IdDisplayValue nvarchar(4000)

    DECLARE @IdValue nvarchar(4000)

    DECLARE @Id nvarchar(4000)

    DECLARE @LastModifiedById nvarchar(4000)

    DECLARE @LastModifiedDate nvarchar(4000)

    DECLARE @RecordTypeId nvarchar(4000)

    DECLARE @RecordTypeInfo nvarchar(4000)

    DECLARE @SystemModstamp nvarchar(4000)

    DECLARE @WeakEtag int

    DECLARE @OwnerIdDisplayValue nvarchar(4000)

    DECLARE @OwnerIdValue nvarchar(4000)

    DECLARE @ParentDisplayValue nvarchar(4000)

    DECLARE @ParentValue nvarchar(4000)

    DECLARE @ParentIdDisplayValue nvarchar(4000)

    DECLARE @ParentIdValue nvarchar(4000)

    DECLARE @PhoneDisplayValue nvarchar(4000)

    DECLARE @PhoneValue nvarchar(4000)

    DECLARE @PhotoUrlDisplayValue nvarchar(4000)

    DECLARE @PhotoUrlValue nvarchar(4000)

    DECLARE @SiteDisplayValue nvarchar(4000)

    DECLARE @SiteValue nvarchar(4000)

    DECLARE @TypeDisplayValue nvarchar(4000)

    DECLARE @TypeValue nvarchar(4000)

    DECLARE @WebsiteDisplayValue nvarchar(4000)

    DECLARE @WebsiteValue nvarchar(4000)

    DECLARE @resultId nvarchar(4000)

    DECLARE @resultLastModifiedById nvarchar(4000)

    DECLARE @resultLastModifiedDate nvarchar(4000)

    DECLARE @resultRecordTypeId nvarchar(4000)

    DECLARE @resultRecordTypeInfo nvarchar(4000)

    DECLARE @resultSystemModstamp nvarchar(4000)

    DECLARE @resultWeakEtag int

    DECLARE @statusCode int

    DECLARE @hasErrors int
    EXEC sp_OAMethod @jResp, 'BoolOf', @hasErrors OUT, 'hasErrors'
    DECLARE @i int
    SELECT @i = 0
    DECLARE @count_i int
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'results'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        EXEC sp_OAMethod @jResp, 'StringOf', @ApiName OUT, 'results[i].result.apiName'
        EXEC sp_OAMethod @jResp, 'StringOf', @ETag OUT, 'results[i].result.eTag'
        EXEC sp_OAMethod @jResp, 'StringOf', @DisplayValue OUT, 'results[i].result.fields.AnnualRevenue.displayValue'
        EXEC sp_OAMethod @jResp, 'IntOf', @Value OUT, 'results[i].result.fields.AnnualRevenue.value'
        EXEC sp_OAMethod @jResp, 'StringOf', @BillingCityDisplayValue OUT, 'results[i].result.fields.BillingCity.displayValue'
        EXEC sp_OAMethod @jResp, 'StringOf', @BillingCityValue OUT, 'results[i].result.fields.BillingCity.value'
        EXEC sp_OAMethod @jResp, 'StringOf', @BillingCountryDisplayValue OUT, 'results[i].result.fields.BillingCountry.displayValue'
        EXEC sp_OAMethod @jResp, 'StringOf', @BillingCountryValue OUT, 'results[i].result.fields.BillingCountry.value'
        EXEC sp_OAMethod @jResp, 'StringOf', @BillingPostalCodeDisplayValue OUT, 'results[i].result.fields.BillingPostalCode.displayValue'
        EXEC sp_OAMethod @jResp, 'StringOf', @BillingPostalCodeValue OUT, 'results[i].result.fields.BillingPostalCode.value'
        EXEC sp_OAMethod @jResp, 'StringOf', @BillingStateDisplayValue OUT, 'results[i].result.fields.BillingState.displayValue'
        EXEC sp_OAMethod @jResp, 'StringOf', @BillingStateValue OUT, 'results[i].result.fields.BillingState.value'
        EXEC sp_OAMethod @jResp, 'StringOf', @BillingStreetDisplayValue OUT, 'results[i].result.fields.BillingStreet.displayValue'
        EXEC sp_OAMethod @jResp, 'StringOf', @BillingStreetValue OUT, 'results[i].result.fields.BillingStreet.value'
        EXEC sp_OAMethod @jResp, 'StringOf', @IndustryDisplayValue OUT, 'results[i].result.fields.Industry.displayValue'
        EXEC sp_OAMethod @jResp, 'StringOf', @IndustryValue OUT, 'results[i].result.fields.Industry.value'
        EXEC sp_OAMethod @jResp, 'StringOf', @NameDisplayValue OUT, 'results[i].result.fields.Name.displayValue'
        EXEC sp_OAMethod @jResp, 'StringOf', @NameValue OUT, 'results[i].result.fields.Name.value'
        EXEC sp_OAMethod @jResp, 'StringOf', @OwnerDisplayValue OUT, 'results[i].result.fields.Owner.displayValue'
        EXEC sp_OAMethod @jResp, 'StringOf', @ValueApiName OUT, 'results[i].result.fields.Owner.value.apiName'
        EXEC sp_OAMethod @jResp, 'StringOf', @ValueETag OUT, 'results[i].result.fields.Owner.value.eTag'
        EXEC sp_OAMethod @jResp, 'StringOf', @IdDisplayValue OUT, 'results[i].result.fields.Owner.value.fields.Id.displayValue'
        EXEC sp_OAMethod @jResp, 'StringOf', @IdValue OUT, 'results[i].result.fields.Owner.value.fields.Id.value'
        EXEC sp_OAMethod @jResp, 'StringOf', @NameDisplayValue OUT, 'results[i].result.fields.Owner.value.fields.Name.displayValue'
        EXEC sp_OAMethod @jResp, 'StringOf', @NameValue OUT, 'results[i].result.fields.Owner.value.fields.Name.value'
        EXEC sp_OAMethod @jResp, 'StringOf', @Id OUT, 'results[i].result.fields.Owner.value.id'
        EXEC sp_OAMethod @jResp, 'StringOf', @LastModifiedById OUT, 'results[i].result.fields.Owner.value.lastModifiedById'
        EXEC sp_OAMethod @jResp, 'StringOf', @LastModifiedDate OUT, 'results[i].result.fields.Owner.value.lastModifiedDate'
        EXEC sp_OAMethod @jResp, 'StringOf', @RecordTypeId OUT, 'results[i].result.fields.Owner.value.recordTypeId'
        EXEC sp_OAMethod @jResp, 'StringOf', @RecordTypeInfo OUT, 'results[i].result.fields.Owner.value.recordTypeInfo'
        EXEC sp_OAMethod @jResp, 'StringOf', @SystemModstamp OUT, 'results[i].result.fields.Owner.value.systemModstamp'
        EXEC sp_OAMethod @jResp, 'IntOf', @WeakEtag OUT, 'results[i].result.fields.Owner.value.weakEtag'
        EXEC sp_OAMethod @jResp, 'StringOf', @OwnerIdDisplayValue OUT, 'results[i].result.fields.OwnerId.displayValue'
        EXEC sp_OAMethod @jResp, 'StringOf', @OwnerIdValue OUT, 'results[i].result.fields.OwnerId.value'
        EXEC sp_OAMethod @jResp, 'StringOf', @ParentDisplayValue OUT, 'results[i].result.fields.Parent.displayValue'
        EXEC sp_OAMethod @jResp, 'StringOf', @ParentValue OUT, 'results[i].result.fields.Parent.value'
        EXEC sp_OAMethod @jResp, 'StringOf', @ParentIdDisplayValue OUT, 'results[i].result.fields.ParentId.displayValue'
        EXEC sp_OAMethod @jResp, 'StringOf', @ParentIdValue OUT, 'results[i].result.fields.ParentId.value'
        EXEC sp_OAMethod @jResp, 'StringOf', @PhoneDisplayValue OUT, 'results[i].result.fields.Phone.displayValue'
        EXEC sp_OAMethod @jResp, 'StringOf', @PhoneValue OUT, 'results[i].result.fields.Phone.value'
        EXEC sp_OAMethod @jResp, 'StringOf', @PhotoUrlDisplayValue OUT, 'results[i].result.fields.PhotoUrl.displayValue'
        EXEC sp_OAMethod @jResp, 'StringOf', @PhotoUrlValue OUT, 'results[i].result.fields.PhotoUrl.value'
        EXEC sp_OAMethod @jResp, 'StringOf', @SiteDisplayValue OUT, 'results[i].result.fields.Site.displayValue'
        EXEC sp_OAMethod @jResp, 'StringOf', @SiteValue OUT, 'results[i].result.fields.Site.value'
        EXEC sp_OAMethod @jResp, 'StringOf', @TypeDisplayValue OUT, 'results[i].result.fields.Type.displayValue'
        EXEC sp_OAMethod @jResp, 'StringOf', @TypeValue OUT, 'results[i].result.fields.Type.value'
        EXEC sp_OAMethod @jResp, 'StringOf', @WebsiteDisplayValue OUT, 'results[i].result.fields.Website.displayValue'
        EXEC sp_OAMethod @jResp, 'StringOf', @WebsiteValue OUT, 'results[i].result.fields.Website.value'
        EXEC sp_OAMethod @jResp, 'StringOf', @resultId OUT, 'results[i].result.id'
        EXEC sp_OAMethod @jResp, 'StringOf', @resultLastModifiedById OUT, 'results[i].result.lastModifiedById'
        EXEC sp_OAMethod @jResp, 'StringOf', @resultLastModifiedDate OUT, 'results[i].result.lastModifiedDate'
        EXEC sp_OAMethod @jResp, 'StringOf', @resultRecordTypeId OUT, 'results[i].result.recordTypeId'
        EXEC sp_OAMethod @jResp, 'StringOf', @resultRecordTypeInfo OUT, 'results[i].result.recordTypeInfo'
        EXEC sp_OAMethod @jResp, 'StringOf', @resultSystemModstamp OUT, 'results[i].result.systemModstamp'
        EXEC sp_OAMethod @jResp, 'IntOf', @resultWeakEtag OUT, 'results[i].result.weakEtag'
        EXEC sp_OAMethod @jResp, 'IntOf', @statusCode OUT, 'results[i].statusCode'
        SELECT @i = @i + 1
      END

    EXEC @hr = sp_OADestroy @http
    EXEC @hr = sp_OADestroy @sbResponseBody
    EXEC @hr = sp_OADestroy @jResp


END
GO

Curl Command

curl -X GET
	-H "Authorization: Bearer <access_token>"
https://domain.com/services/data/v{{version}}/ui-api/records/batch/:RECORD_IDS

Postman Collection Item JSON

{
  "name": "Get a Batch of Records",
  "request": {
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{_endpoint}}/services/data/v{{version}}/ui-api/records/batch/:RECORD_IDS",
      "host": [
        "{{_endpoint}}"
      ],
      "path": [
        "services",
        "data",
        "v{{version}}",
        "ui-api",
        "records",
        "batch",
        ":RECORD_IDS"
      ],
      "query": [
        {
          "key": "childRelationships",
          "value": "",
          "description": "A collection of child relationship names. The records with those child relationship names are included in the response. Specify names in the format ObjectApiName.ChildRelationshipName or ObjectApiName.ChildRelationshipName.FieldApiName. For example, to specify the Contacts relationship on an Account, use Account.Contacts. You can get child relationships one level deep.\nTo get a relationship name, look in the Object Info response body.",
          "disabled": true
        },
        {
          "key": "fields",
          "value": "",
          "description": "Specifies the fields to return. If this property is specified, the response is a union of fields and optionalFields.\nIf the context user doesn’t have access to a field, an error is returned.\n\nIf you’re not sure whether the context user has access to a field and you don’t want the request to fail if they don’t, use the optionalFields parameter.\n\nSpecify names in the format ObjectApiName.FieldName. You can get any field that has a named relationship to this record. There is no limit to the number of fields you can specify.",
          "disabled": true
        },
        {
          "key": "layoutTypes",
          "value": "",
          "description": "Specifies the fields to return. If this property is specified, the response is a union of layoutTypes, modes, and optionalFields.\nA collection containing any of these values:\nCompact—Use this value to get a layout that contains a record’s key fields.\nFull—(Default) Use this value to get a full layout.",
          "disabled": true
        },
        {
          "key": "modes",
          "value": "",
          "description": "The access mode for the record. This value determines which fields to get from a layout. Layouts have different fields for create, edit, and view modes. For example, formula fields are rendered in view mode, but not in create mode because they’re calculated at run time, like formulas in a spreadsheet. A collection containing any of these values:\nCreate—Use this mode if you intend to build UI that lets a user create a record. This mode is used by the /ui-api/record-defaults/create/<SOBJECT_API_NAME> resource.\nEdit—Use this mode if you intend to build UI that lets a user edit a record. This mode is used by the /ui-api/record-defaults/clone/<RECORD_ID> resource.\nView—(Default) Use this mode if you intend to build UI that displays a record.",
          "disabled": true
        },
        {
          "key": "optionalFields",
          "value": "",
          "description": "A collection of optional field names. If a field is accessible to the context user, it’s included in the response. If a field isn’t accessible to the context user, it isn’t included in the response, but it doesn’t cause an error.\nSpecify names in the format ObjectApiName.FieldName. You can get any field that has a named relationship to this record. There is no limit to the number of fields you can specify.",
          "disabled": true
        },
        {
          "key": "pageSize",
          "value": "",
          "description": "The maximum number of child records to return on a page. The default value is 5.",
          "disabled": true
        },
        {
          "key": "updateMru",
          "value": "",
          "description": "To add to the most recently used (MRU) list view, set to true. The default value is false.",
          "disabled": true
        }
      ],
      "variable": [
        {
          "key": "RECORD_IDS",
          "value": "",
          "description": "Comma-separated list of record IDs"
        }
      ]
    },
    "description": "Get data for a batch of records."
  },
  "response": [
    {
      "name": "Get a Batch of Records",
      "originalRequest": {
        "method": "GET",
        "header": [
        ],
        "url": {
          "raw": "{{_endpoint}}/services/data/v{{version}}/ui-api/records/batch/:RECORD_IDS?layoutTypes=Compact",
          "host": [
            "{{_endpoint}}"
          ],
          "path": [
            "services",
            "data",
            "v{{version}}",
            "ui-api",
            "records",
            "batch",
            ":RECORD_IDS"
          ],
          "query": [
            {
              "key": "childRelationships",
              "value": "",
              "description": "A collection of child relationship names. The records with those child relationship names are included in the response. Specify names in the format ObjectApiName.ChildRelationshipName or ObjectApiName.ChildRelationshipName.FieldApiName. For example, to specify the Contacts relationship on an Account, use Account.Contacts. You can get child relationships one level deep.\nTo get a relationship name, look in the Object Info response body.",
              "disabled": true
            },
            {
              "key": "fields",
              "value": "",
              "description": "Specifies the fields to return. If this property is specified, the response is a union of fields and optionalFields.\nIf the context user doesn’t have access to a field, an error is returned.\n\nIf you’re not sure whether the context user has access to a field and you don’t want the request to fail if they don’t, use the optionalFields parameter.\n\nSpecify names in the format ObjectApiName.FieldName. You can get any field that has a named relationship to this record. There is no limit to the number of fields you can specify.",
              "disabled": true
            },
            {
              "key": "layoutTypes",
              "value": "Compact",
              "description": "Specifies the fields to return. If this property is specified, the response is a union of layoutTypes, modes, and optionalFields.\nA collection containing any of these values:\nCompact—Use this value to get a layout that contains a record’s key fields.\nFull—(Default) Use this value to get a full layout."
            },
            {
              "key": "modes",
              "value": "",
              "description": "The access mode for the record. This value determines which fields to get from a layout. Layouts have different fields for create, edit, and view modes. For example, formula fields are rendered in view mode, but not in create mode because they’re calculated at run time, like formulas in a spreadsheet. A collection containing any of these values:\nCreate—Use this mode if you intend to build UI that lets a user create a record. This mode is used by the /ui-api/record-defaults/create/<SOBJECT_API_NAME> resource.\nEdit—Use this mode if you intend to build UI that lets a user edit a record. This mode is used by the /ui-api/record-defaults/clone/<RECORD_ID> resource.\nView—(Default) Use this mode if you intend to build UI that displays a record.",
              "disabled": true
            },
            {
              "key": "optionalFields",
              "value": "",
              "description": "A collection of optional field names. If a field is accessible to the context user, it’s included in the response. If a field isn’t accessible to the context user, it isn’t included in the response, but it doesn’t cause an error.\nSpecify names in the format ObjectApiName.FieldName. You can get any field that has a named relationship to this record. There is no limit to the number of fields you can specify.",
              "disabled": true
            },
            {
              "key": "pageSize",
              "value": "",
              "description": "The maximum number of child records to return on a page. The default value is 5.",
              "disabled": true
            },
            {
              "key": "updateMru",
              "value": "",
              "description": "To add to the most recently used (MRU) list view, set to true. The default value is false.",
              "disabled": true
            }
          ],
          "variable": [
            {
              "key": "RECORD_IDS",
              "value": "001B000000UnQ2wIAF,001B000000UnQ2yIAF",
              "description": "Comma-separated list of record IDs"
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Date",
          "value": "Wed, 27 Sep 2023 16:00:23 GMT"
        },
        {
          "key": "Strict-Transport-Security",
          "value": "max-age=63072000; includeSubDomains"
        },
        {
          "key": "X-Content-Type-Options",
          "value": "nosniff"
        },
        {
          "key": "X-XSS-Protection",
          "value": "1; mode=block"
        },
        {
          "key": "X-Robots-Tag",
          "value": "none"
        },
        {
          "key": "Cache-Control",
          "value": "no-cache,must-revalidate,max-age=0,no-store,private"
        },
        {
          "key": "Content-Type",
          "value": "application/json;charset=UTF-8"
        },
        {
          "key": "Vary",
          "value": "Accept-Encoding"
        },
        {
          "key": "Content-Encoding",
          "value": "gzip"
        },
        {
          "key": "Transfer-Encoding",
          "value": "chunked"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"hasErrors\": false,\n    \"results\": [\n        {\n            \"result\": {\n                \"apiName\": \"Account\",\n                \"childRelationships\": {},\n                \"eTag\": \"8aae3f4fbe3055e68df1d4c8a989a671\",\n                \"fields\": {\n                    \"AnnualRevenue\": {\n                        \"displayValue\": \"$350,000,000\",\n                        \"value\": 350000000\n                    },\n                    \"BillingCity\": {\n                        \"displayValue\": null,\n                        \"value\": \"Burlington\"\n                    },\n                    \"BillingCountry\": {\n                        \"displayValue\": null,\n                        \"value\": \"USA\"\n                    },\n                    \"BillingPostalCode\": {\n                        \"displayValue\": null,\n                        \"value\": \"27215\"\n                    },\n                    \"BillingState\": {\n                        \"displayValue\": null,\n                        \"value\": \"NC\"\n                    },\n                    \"BillingStreet\": {\n                        \"displayValue\": null,\n                        \"value\": \"525 S. Lexington Ave\"\n                    },\n                    \"Industry\": {\n                        \"displayValue\": \"Apparel\",\n                        \"value\": \"Apparel\"\n                    },\n                    \"Name\": {\n                        \"displayValue\": null,\n                        \"value\": \"Burlington Textiles Corp of America\"\n                    },\n                    \"Owner\": {\n                        \"displayValue\": \"Philippe Ozil\",\n                        \"value\": {\n                            \"apiName\": \"User\",\n                            \"childRelationships\": {},\n                            \"eTag\": \"cc07f7ef1b08ddbd75074c69512dd388\",\n                            \"fields\": {\n                                \"Id\": {\n                                    \"displayValue\": null,\n                                    \"value\": \"005B0000003TOI6IAO\"\n                                },\n                                \"Name\": {\n                                    \"displayValue\": null,\n                                    \"value\": \"Philippe Ozil\"\n                                }\n                            },\n                            \"id\": \"005B0000003TOI6IAO\",\n                            \"lastModifiedById\": \"005B0000003TOI6IAO\",\n                            \"lastModifiedDate\": \"2023-02-02T10:32:12.000Z\",\n                            \"recordTypeId\": null,\n                            \"recordTypeInfo\": null,\n                            \"systemModstamp\": \"2023-09-27T15:47:51.000Z\",\n                            \"weakEtag\": 1695829671000\n                        }\n                    },\n                    \"OwnerId\": {\n                        \"displayValue\": null,\n                        \"value\": \"005B0000003TOI6IAO\"\n                    },\n                    \"Parent\": {\n                        \"displayValue\": null,\n                        \"value\": null\n                    },\n                    \"ParentId\": {\n                        \"displayValue\": null,\n                        \"value\": null\n                    },\n                    \"Phone\": {\n                        \"displayValue\": null,\n                        \"value\": \"(336) 222-7000\"\n                    },\n                    \"PhotoUrl\": {\n                        \"displayValue\": null,\n                        \"value\": \"/services/images/photo/001B000000UnQ2wIAF\"\n                    },\n                    \"Site\": {\n                        \"displayValue\": null,\n                        \"value\": null\n                    },\n                    \"Type\": {\n                        \"displayValue\": \"Customer - Direct\",\n                        \"value\": \"Customer - Direct\"\n                    },\n                    \"Website\": {\n                        \"displayValue\": null,\n                        \"value\": \"www.burlington.com\"\n                    }\n                },\n                \"id\": \"001B000000UnQ2wIAF\",\n                \"lastModifiedById\": \"005B0000003TOI6IAO\",\n                \"lastModifiedDate\": \"2017-08-18T14:46:22.000Z\",\n                \"recordTypeId\": \"012000000000000AAA\",\n                \"recordTypeInfo\": null,\n                \"systemModstamp\": \"2017-08-18T14:46:22.000Z\",\n                \"weakEtag\": 1503067582000\n            },\n            \"statusCode\": 200\n        },\n        {\n            \"result\": {\n                \"apiName\": \"Account\",\n                \"childRelationships\": {},\n                \"eTag\": \"a825a67a87fa16446d82b4948e5643c7\",\n                \"fields\": {\n                    \"AnnualRevenue\": {\n                        \"displayValue\": \"$50,000,000\",\n                        \"value\": 50000000\n                    },\n                    \"BillingCity\": {\n                        \"displayValue\": null,\n                        \"value\": \"Lawrence\"\n                    },\n                    \"BillingCountry\": {\n                        \"displayValue\": null,\n                        \"value\": \"USA\"\n                    },\n                    \"BillingPostalCode\": {\n                        \"displayValue\": null,\n                        \"value\": \"66045\"\n                    },\n                    \"BillingState\": {\n                        \"displayValue\": null,\n                        \"value\": \"KS\"\n                    },\n                    \"BillingStreet\": {\n                        \"displayValue\": null,\n                        \"value\": \"1301 Hoch Drive\"\n                    },\n                    \"Industry\": {\n                        \"displayValue\": \"Consulting\",\n                        \"value\": \"Consulting\"\n                    },\n                    \"Name\": {\n                        \"displayValue\": null,\n                        \"value\": \"Dickenson plc\"\n                    },\n                    \"Owner\": {\n                        \"displayValue\": \"Philippe Ozil\",\n                        \"value\": {\n                            \"apiName\": \"User\",\n                            \"childRelationships\": {},\n                            \"eTag\": \"cc07f7ef1b08ddbd75074c69512dd388\",\n                            \"fields\": {\n                                \"Id\": {\n                                    \"displayValue\": null,\n                                    \"value\": \"005B0000003TOI6IAO\"\n                                },\n                                \"Name\": {\n                                    \"displayValue\": null,\n                                    \"value\": \"Philippe Ozil\"\n                                }\n                            },\n                            \"id\": \"005B0000003TOI6IAO\",\n                            \"lastModifiedById\": \"005B0000003TOI6IAO\",\n                            \"lastModifiedDate\": \"2023-02-02T10:32:12.000Z\",\n                            \"recordTypeId\": null,\n                            \"recordTypeInfo\": null,\n                            \"systemModstamp\": \"2023-09-27T15:47:51.000Z\",\n                            \"weakEtag\": 1695829671000\n                        }\n                    },\n                    \"OwnerId\": {\n                        \"displayValue\": null,\n                        \"value\": \"005B0000003TOI6IAO\"\n                    },\n                    \"Parent\": {\n                        \"displayValue\": null,\n                        \"value\": null\n                    },\n                    \"ParentId\": {\n                        \"displayValue\": null,\n                        \"value\": null\n                    },\n                    \"Phone\": {\n                        \"displayValue\": null,\n                        \"value\": \"(785) 241-6200\"\n                    },\n                    \"PhotoUrl\": {\n                        \"displayValue\": null,\n                        \"value\": \"/services/images/photo/001B000000UnQ2yIAF\"\n                    },\n                    \"Site\": {\n                        \"displayValue\": null,\n                        \"value\": null\n                    },\n                    \"Type\": {\n                        \"displayValue\": \"Customer - Channel\",\n                        \"value\": \"Customer - Channel\"\n                    },\n                    \"Website\": {\n                        \"displayValue\": null,\n                        \"value\": \"dickenson-consulting.com\"\n                    }\n                },\n                \"id\": \"001B000000UnQ2yIAF\",\n                \"lastModifiedById\": \"005B0000003TOI6IAO\",\n                \"lastModifiedDate\": \"2017-08-18T14:46:22.000Z\",\n                \"recordTypeId\": \"012000000000000AAA\",\n                \"recordTypeInfo\": null,\n                \"systemModstamp\": \"2017-08-18T14:46:22.000Z\",\n                \"weakEtag\": 1503067582000\n            },\n            \"statusCode\": 200\n        }\n    ]\n}"
    }
  ]
}