Record APIs - Creating And Modifying Data

The platform's Record APIs can be used to create and modify data in the form of individual records.

Creating a new record

The platform's record APIs can be used to create a record of a specific type (a "Record Type").

The pattern for the URL used to create a new record of a specific (preview) record type is:

POST https://{mydomain}.readinow.com/api/v1/preview/records/{record-type-name}

The pattern for the URL used to create a new record of a specific (published) record type is:

POST https://{mydomain}.readinow.com/api/v1/records/{record-type-name}/r{record-type-revision}

The request body must be JSON (Content-Type "application/json") in the following format:

{
    "data": {
        "field1": "Hello",
        "field2": "World",
        "field3": 12345,
        "relationship1": [
            { "id": "f0c5b86d-d021-4c87-9213-1b9c1b5e3ed2" },
            { "id": "963afbe3-1376-429d-9e1c-6ae0af787747" }
        ]
    }
}

Note that the exact request body format for a given Record Type can be viewed in the Sandbox (Swagger) interface for that Record Type.

Example

Using Postman, a new request was created and GET was selected from the method drop down.

Selected the Authorization tab and for the Type drop down, Bearer Token was selected.

The value of the Response Payload attribute called “access_token” generated using the token service was pasted into the Token field (Refer to Record APIs - Getting Started, under Requesting an Access Token for instructions on how to generate the Access Token).

The Params tab was selected and populated as shown in the screenshot below.  This example is how to create a new Person record.

The Person record is created, which results in the following response:

{
  "status": "Success",
  "message": "Created new 'Person' (R1) record with UID '6bb04efa-dfc5-41cc-86cd-c32c6db818a3'.",
  "correlationCode": "Z067214-081002",
  "type": {
    "id": 16017,
    "name": "Person",
    "slug": "person",
    "application": {
      "name": "ReadiNow Core"
    },
    "revision": 1
  },
  "data": {
    "uid": "6bb04efa-dfc5-41cc-86cd-c32c6db818a3",
    "lid": 62120,
    "firstName": "Jill",
    "lastName": "Admin",
    "businessEmail": "jill.admin@admin.com",
    "primaryPhone": "Business",
    "primaryEmail": "Business"
  }
}

Updating an existing record

The platform can be used to modify an existing record of a specific type (a "Record Type"). Each record has a unique identifier (UID) which is fixed for the lifetime  of that record.

The pattern for the URL used to modify an existing record of a specific (preview) record type is:

PATCH https://{mydomain}.readinow.com/api/v1/preview/records/{record-type-name}/by/uid/{record-uid}

The pattern for the URL used to modify an existing record of a specific (published) record type is:

PATCH https://{mydomain}.readinow.com/api/v1/records/{record-type-name}/r{record-type-revision}/by/uid/{record-uid}

The request body must be JSON (Content-Type "application/json") in the following format:

{
    "data": {
        "field1": "Hello",
        "field2": "World",
        "field3": 12345,
        "relationship1": [
            { "id": "f0c5b86d-d021-4c87-9213-1b9c1b5e3ed2" },
            { "id": "963afbe3-1376-429d-9e1c-6ae0af787747" }
        ]
    }
}

When updating a record, you only supply values for fields or relationships that you want to modify.

Note that the exact request body format for a given Record Type can be viewed in the Sandbox (Swagger) interface for that Record Type.

Example

The following example uses Postman to modify the Person record with UID "6bb04efa-dfc5-41cc-86cd-c32c6db818a3".

Which returns the following response:

{
  "status": "Success",
  "message": "Updated 'Person' (R1) record with UID '6bb04efa-dfc5-41cc-86cd-c32c6db818a3'.",
  "correlationCode": "Z829511-081026",
  "type": {
    "id": 16017,
    "name": "Person",
    "slug": "person",
    "application": {
      "name": "ReadiNow Core"
    },
    "revision": 1
  },
  "data": {
    "uid": "6bb04efa-dfc5-41cc-86cd-c32c6db818a3",
    "lid": 62120,
    "firstName": "Jillian",
    "lastName": "Administrator",
    "businessEmail": "jill.admin@admin.com",
    "primaryPhone": "Business",
    "primaryEmail": "Business"
  }
}