/entityType.create

Create a new entityType with the specified set of attributes.

Refer to the Registration Error Codes section for details on error codes.

This endpoint includes the following methods:

  • POST


POST

Description

This creates a new entityType schema with the required default attributes such as id, uuid, as well as the two new attributes, name and description.

Base URL

The base URL for this endpoint is your Janrain Capture domain; for example:

https://educationcenter.us-dev.janraincapture.com

Your Capture domains (also known as Registration domains) can be found in the Janrain Console on the Manage Application page:

Examples

Example Request

Create an entityType called user_test with attributes name and description The Name attribute is a non-case-sensitive string The Descriptionattributes is a non-case-sensitive string of max length 1000.


curl -X POST \
    -H "Authorization: Basic aW1fYV...NfbXk="\
    --data-urlencode type_name=user_test \
    --data-urlencode attr_defs='[{"name":"name","type":"string",
      "case-sensitive":false},{"name":"description","type":"string","length":
      1000,"case-sensitive":false}]'\
    https://my-app.janraincapture.com/entityType.create
       

Running Code Samples Using Postman

The Janrain REST API code samples are written using Curl, but they can easily be run from within Postman. To use one of our code samples in Postman:

  1. Click the Copy to Clipboard button located directly beneath the code sample
  2. In Postman, click Import to display the Import dialog box.
  3. In the Import dialog box, click Paste Raw Text, and then paste in the copied code. The Import dialog box should look similar to this:

  4. Click Import, and the Curl command will be converted to a format that can be run from within Postman. All you need to do now is configure the command to work with your Janrain implementation.

Example 1 Response


{
  "schema": {
    "attr_defs": [
      {
        "name": "id",
        "description": "simple identifier for this entity",
        "type": "id"
      },
      {
        "name": "uuid",
        "description": "globally unique identifier for this entity",
        "type": "uuid"
      },
      {
        "name": "created",
        "description": "when this entity was created",
        "type": "dateTime"
      },
      {
        "name": "lastUpdated",
        "description": "when this entity was last updated",
        "type": "dateTime"
      },
      {
        "length": 1000,
        "name": "description",
        "type": "string",
        "case-sensitive": false
      },
      {
        "length": null,
        "name": "name",
        "type": "string",
        "case-sensitive": false
      }
    ],
    "name": "user_test"
  },
  "stat": "ok"
}
       

Create an entityType called user2 with a plural, an object and attributes. The plural testPlural contains two strings, testPOne and testPTwo The object testObject contains two strings, testOne and testTwo The name attribute is a non-case-sensitive string The description attributes is a non-case-sensitive string of max length 1000.


curl -X POST \
    -H "Authorization: Basic aW1fYV...NfbXk="\
    --data-urlencode type_name=user2 \
    --data-urlencode attr_defs='[{"name":"testPlural","type":"plural",
      "attr_defs":'[{"name":"testPOne","type":"string","length":256},
      {"name":"testPTwo","type":"string"}]},{"name":"testObject",
      "type":"object","attr_defs":[{"name":"testOne","type":"string","length":256},
      {"name":"testTwo","type":"string"}]},
      {"name":"name","type":"string","case-sensitive":false},
      {"name":"description","type":"string","length":1000,"case-sensitive":false}]' \
    https://my-app.janraincapture.com/entityType.create
       

Running Code Samples Using Postman

The Janrain REST API code samples are written using Curl, but they can easily be run from within Postman. To use one of our code samples in Postman:

  1. Click the Copy to Clipboard button located directly beneath the code sample
  2. In Postman, click Import to display the Import dialog box.
  3. In the Import dialog box, click Paste Raw Text, and then paste in the copied code. The Import dialog box should look similar to this:

  4. Click Import, and the Curl command will be converted to a format that can be run from within Postman. All you need to do now is configure the command to work with your Janrain implementation.

Example 2 Response


{
  "schema": {
    "attr_defs": [
      {
        "name": "id",
        "description": "simple identifier for this entity",
        "type": "id"
      },
      {
        "name": "uuid",
        "description": "globally unique identifier for this entity",
        "type": "uuid"
      },
      {
        "name": "created",
        "description": "when this entity was created",
        "type": "dateTime"
      },
      {
        "name": "lastUpdated",
        "description": "when this entity was last updated",
        "type": "dateTime"
      },
      {
        "length": 1000,
        "name": "Description",
        "type": "string",
        "case-sensitive": false
      },
      {
        "length": null,
        "name": "Name",
        "type": "string",
        "case-sensitive": false
      },
      {
        "attr_defs": [
          {
            "length": 256,
            "name": "testOne",
            "type": "string",
            "case-sensitive": true
          },
          {
            "length": null,
            "name": "testTwo",
            "type": "string",
            "case-sensitive": true
          }
        ],
        "name": "testObject",
        "type": "object"
      },
      {
        "attr_defs": [
          {
            "name": "id",
            "description": "simple identifier for this sub-entity",
            "type": "id"
          },
          {
            "length": 256,
            "name": "testPOne",
            "type": "string",
            "case-sensitive": true
          },
          {
            "length": null,
            "name": "testPTwo",
            "type": "string",
            "case-sensitive": true
          }
        ],
        "name": "testPlural",
        "type": "plural"
      }
    ],
    "name": "user_test1"
  },
  "stat": "ok"
}
       

Authorized Clients

  • owner

Security

  •  janrain-signed
  •  basic-auth

Query Parameters

Parameter Type Required Description
attr_defs string Yes Initial set of attributes (formatted as a JSON object) to be added to the entityType. 

The JSON must be formatted similar to this:
 
[{"name":"Name","type":"string","case-sensitive":false}, {"name":"Description","type":"string","length":1000,"case-sensitive":false}].
type_name string Yes Name of the entityType.