Synchronous Record Validation

The Streaming Ingestion API uses a fire and forget pattern in order to land the data as fast as possible. Since the data is processed asynchronously, a successful upload can take up to an hour.

All fields must be provided in the request payload as defined in the schema regardless of whether Value Required is true or not. The Value Required is applicable to the value of the fields only. We recommend entering a blank value for fields not set as required.

Note

This method provides synchronous validation of object payloads in order to give immediate feedback about the API integration. The feature is intended to be used during the development phase only. For requests that fail validation, the API response provides the necessary details to fix the request payload. For requests that pass validation, payloads aren’t persisted downstream.

Syntax

URI
/api/v1/ingest/sources/{name}/{object-name}/actions/test
Available since release
Salesforce CDP v1.0, Salesforce v51.0
Formats
JSON
HTTP methods
POST
Authentication
Authorization: Bearer access_token
Request body
1curl --location --request POST 'https://{instance_url}/api/v1/sources/ntotest/exercises/actions/test' \
2--header 'Authorization: Bearer {access_token}' \
3--header 'Content-Type: application/json' \
4--data-raw '{
5"data": [
6{"id": "f19cae7e-5cdb-41ce-92ba-539afea04f9d","contact_name": "Joe Smith","created_date": "2021-07-22T08:57:08.118Z","tax_exempt": false,"ship_address": "9818 Main","total": 77506,"tax_rate": 84,"modified_date": "2021-07-05T09:31:44.457Z"},{"id": "48c8b6a6-8179-4a15-ba19-ec5c8206ce28","contact_name": "Tina Smith","created_date":"2021-07-08T22:57:02.008Z","tax_exempt": false,"ship_address": "245 Main","total": 16986,"tax_rate": 61,"modified_date": "2021-07-03T06:20:52.886Z"}
7
8]
9}
10'
Request parameters
Parameter Description
Content-Type application/json
name Name of the Ingest API data connector.
object-name Name of the resource type to send to Salesforce CDP.
Response body
1{
2       "timestamp": "2021-08-20T16:34:26.047666Z",
3       "error": "Bad Request",
4       "message": "Bad Request: JSON is properly formatted but has a mismatch with Schema.",
5       "path": "uri=/api/v1/ingest/sources/ecomm/Orders/actions/test",
6       "tenantId": "{tenantId}",
7       "internalErrorCode": "COMMON_ERROR_GENERIC",
8       "details": {
9              "validationReport": [{
10                     "record": "{\"contact_name\":\"Joe Smith\",\"total\":77506,\"tax_exempt\":false,\"id\":\"f19cae7e-5cdb-41ce-92ba-539afea04f9d\",\"created_date\":\"2021-07-22T08:57:08.118Z\",\"ship_address\":\"9818 Main\",\"modified_date\":\"2021-07-05T09:31:44.457Z\",\"tax_rate\":84}",
11                     "causingExceptions": ["#/id: expected type: Number, found: String"]
12              }, {
13                     "record": "{\"contact_name\":\"Tina Smith\",\"total\":16986,\"tax_exempt\":false,\"id\":\"48c8b6a6-8179-4a15-ba19-ec5c8206ce28\",\"created_date\":\"2021-07-08T22:57:02.008Z\",\"ship_address\":\"245 Main\",\"modified_date\":\"2021-07-03T06:20:52.886Z\",\"tax_rate\":61}",
14                     "causingExceptions": ["#/id: expected type: Number, found: String"]
15              }]
16       }
17}

If the request body fails validation, examine the validationReport in the response body to figure out which records failed and what the reasons were for the failure.