Janrain Entity API Documentation

Entity Endpoints Overview

Entity and EntityType Endpoints

An entity is a record in your Registration application. Use the /Entity.* calls to view, add, edit, or delete entities from your records. Use the entityType.* calls when working with the schema. These calls manipulate record information for a single record or a group of records. See the Security section for details on making calls with the proper authentication. See individual endpoints for call examples and different use cases.

Security Schemes

x-janrain-hmac-authorization janrain-signed

Our Registration API supports a custom HTTP scheme based on a keyed-HMAC (Hash Message Authentication Code) for authentication. Using this helps to protect against replay attacks, and ensures that client secrets are well protected.

APID Authorization Headers

Example Request

  GET /entity.find?type_name=user&filter=lastUpdated >= '2016-01-01' HTTP/1.1
  Host: training-pse.janraincapture.com
  Date: 2016-02-26 19:08:44
  Authorization:Signature apkrahlfumwse2e9nvrrotv6vchuptzw:rRSudiGtMM5hEHYcwP49kt18jNk=

Signature

To generate the signature you will need the following:

  • The root-anchored API endpoint (for example /entity.find).
  • The parameters of the API call as key=value pairs, sorted alphabetically and separated by newlines (\n).
  • The date as specified in the Date header in your request.
  • Your client_secret.
  • Your client_id.

To generate the signature:

  1. Concatenate the endpoint, datetime, and sorted parameters with newline characters ('\n'). This creates the string that we will sign.
  2. Use the client_secret to sign the string using SHA-1, then base64 encode the result.
  3. Prepend your client_id to this signature with a colon (:).

The resulting string is a signature that uniquely identifies a single request.

Below we have included a python implementation of the signed header request for further clarity and convenience:

import hmac
from base64 import b64encode
from hashlib import sha1


def make_signed_auth_header(endpoint, params, datetime, client_id, secret):
    kv_params = ['{}={}'.format(k, v) for k, v in params.items()]
    kv_params.sort()
    kv_string = '\n'.join(kv_params)
    str_to_sign = '{}\n{}\n{}\n'.format(endpoint, datetime, kv_string)
    hashed_str = b64encode(hmac.new(secret, str_to_sign, sha1).digest())
    return {'Authorization': 'Signature {}:{}'.format(client_id, hashed_str)}

For code examples in other languages, take a look at our sample code repo.

Authorization string

Used to send the authorization signature.

Example: Authorization: Signature apkrahlfumwse2e9nvrrotv6vchuptzw:Pm0y2b8b/tH4HrEqKqSm7zQk1s8=

Responses

Basic Authentication basic

Our Registration API supports basic HTTP authentication using your application owner credentials. To create the authorization code, combine your client ID and secret like this client_id + ":" + secret, then base64 encode the result. Most RESTful frameworks support basic authentication natively.

Authorization string

Used to send the authorization code.

Example: Authorization: Basic aW1fYV9saXR0bGVfdGVhX3BvdF9zaG9ydF9hbmRfc3Q6b3V0X2hlcmVfaXNfbXlfaGFuZGxlX2hlcmVfaXNfbXk=

Responses

x-janrain-oauth janrain-oauth

Some of our Registration API endpoints support a custom variant of OAuth using access tokens. The following endpoints accept OAuth acccess token authentication:

For more information for this method of authentication, refer to the Use OAuth Authentication topic.

Authorization string

Used to send the access token.

Example: Authorization: OAuth SlAV32hkKG

Responses

Endpoints

https://{app}.janraincapture.com

URI Parameters

app string required

The name of the app domain.

Example: your-app-domain

/entity

Description

Retrieve a single entity (and any nested objects).

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

get

Description

Example: Retrieve user data for a specific ID and created date

Get the user data for a user with ID 999 created on November 15, 2014 at 01:58:01.862312 a.m., with a UTC time zone offset of -0000.

curl -H "Authorization: Basic aW1fYV...NfbXk=" \
    --data-urlencode client_id=12345abcde12345abcde \
    --data-urlencode client_secret=edcba54321edcba5432 \
    --data-urlencode type_name=user \
    --data-urlencode id=999 \
    --data-urlencode created='2014-11-15 01:58:01.862312 +0000' \
    https://my-app.janraincapture.com/entity
Example Response
{
  "result": {
    "birthday": null,
    "familyName": "Doe",
    "profiles": [],
    "id": 1,
    "middleName": null,
    "emailVerified": "2015-11-15 01:58:01 +0000",
    "primaryAddress": {
      "company": null,
      "address2": "",
      "stateAbbreviation": "NM",
      "zipPlus4": null,
      "city": "",
      "address1": "",
      "phone": "5551234567",
      "zip": "",
      "mobile": null,
      "country": "United States"
    },
    "gender": "male",
    "lastUpdated": "2016-03-13 19:39:17.856608 +0000",
    "password": null,
    "photos": [],
    "email": "johndoe@example.com",
    "givenName": "John",
    "currentLocation": null,
    "deactivateAccount": null,
    "lastLogin": "2016-03-13 19:39:17 +0000",
    "created": "2015-11-15 01:58:01.862312 +0000",
    "displayName": "John Doe",
    "uuid": "12345abc-1234-abcd-1234-12345abcde12",
    "aboutMe": null,
    "display": null,
    "statuses": []
  },
  "stat": "ok"
}

Example: Retrieve certain attributes for a specific user ID

Retrieve email, givenName, familyName and created date for user record 999.

curl -H "Authorization: Basic aW1fYV...NfbXk=" \
    --data-urlencode type_name=user \
    --data-urlencode id=999 \
    --data-urlencode attributes='["email", "familyName", "givenName", "created"]' \
    https://my-app.janraincapture.com/entity
Example Response
{
  "result": {
    "familyName": "Parker",
    "email":"parkerm@example.com",
    "givenName":"Matthew",
    "created":"2015-12-31 18:54:59.900339 +0000"
  },
    "stat":"ok"
  }

Example: Retrieve data for a user with specific email address

Retrieve the created date for a user record with a specific email address.

curl -H "Authorization: Basic aW1fYV...NfbXk=" \
    --data-urlencode type_name=user \
    --data-urlencode key_attribute=email \
    --data-urlencode key_value='"parkerm@example.com"'
    --data-urlencode attributes='["created"]' \
    https://my-app.janraincapture.com/entity
Example Response
{
  "result":{
    "created":"2015-10-05 21:37:13.031989 +0000"
  },
  "stat":"ok"
}

Example: Validate a User's Password

The entity call may use two optional parameters to validate a password attribute in a user record. When used in this way, the API call makes a hash internally according to the password type specified in the schema and then compares the hashes. password_attribute is the name of the schema attribute to use and password_value is a plain-text value used to validate against the password stored in the record. If unsuccessful, the call returns a 350 (invalid_password_value) error response.

curl -X POST -H "Authorization: Basic aW1fYV...NfbXk=" \
    --data-urlencode type_name=user \
    --data-urlencode id=999 \
    --data-urlencode password_attribute=password \
    --data-urlencode password_value=Test123 \
    --data-urlencode attributes='["created"]' \
    https://my-app.janraincapture.com/entity
Example Response
{
  "result":{
    "created":"2015-10-05 21:37:13.031989 +0000"
  },
  "stat":"ok"
}

Authorized Clients

owner direct_access direct_read_access

Security

Query Parameters

attribute_name string

This is a schema path to an individual attribute. Will return only the attribute value, instead of the entire record.

attributes string

This is a JSON array of attributes. This works the same as attribute_name, only returning the specified attributes instead of the entire record.

created string

Timestamps are generated when an entity is created. This value may be used to help identify the entity in this parameter. If a value is present in this parameter, and is incorrect, the call will fail.

To format this parameter, see the Timestamp Format section in Data Types.

id string required

Required when not using key_attribute or uuid parameters. The primary key of the parent object.

key_attribute string required

Required when not using id or uuid. This value is any attribute in the schema with a unique constraint.

key_value string required

Required when using key_attribute. This is the value of the unique attribute.

Note: String values need to be enclosed in quotes.

last_updated string

Timestamps are generated when an entity is updated. This value may be used to help identify the entity in this parameter. If a value is present in this parameter, and is incorrect, the call will fail.

To format this parameter, see the Timestamp Format section in Data Types.

password_attribute string required

Entity can be used to validate user passwords. The value is the path to an attribute with a password constraint in the schema.

Note: Use the optional password_attribute and password_value parameters together. Use password_attribute to specify the attribute to authenticate against, and password_value to specify the authenticating password.

password_value string required

A plaintext value that is matched against the password attribute specified in the password_attribute parameter. If successful, the entity is returned. If unsuccessful, an error code is returned.

type_name string required

The entityType of the entity.

uuid string required

Required when not using the id or key_attribute parameters. The unique identifier given the user entity.

/entity.bulkCreate

Description

Create multiple new data records of a specific entityType in a single API call. If the request is structurally valid and properly authorized, it is added independently. The result contains a list of uuid_results and ID results from each record addition or a failure message for each record.

post

Description

Example request

Create three new users with some statuses plural entries.

curl -X POST \
    -H "Authorization: Basic aW1fYV...NfbXk=" \
    --data-urlencode type_name=user \
    --data-urlencode all_attributes='[{"familyName":"Jones","givenName":"Abe",
      "email":"jonesa@example.com","statuses":[{"status":"active",
      "statusCreated":"2015-12-15T07:36:25Z"}]},{"givenName":"Jackson",
      "familyName":"Gordon","email":"gjack@test.com","statuses":[{"status":
      "inactive","statusCreated":"2015-10-12T04:00:00Z"}]},{"givenName":"Sally",
      "familyName": "Smith","email":"ssmith@myorg.org"}]' \
    https://my-app.janraincapture.com/entity.bulkCreate

Example Results

{
  "uuid_results": [
   "efd7fe4e-c0a2-4b80-876e-1d06df393579",
   "3314d744-09a9-4264-a17f-402d3e4824e7",
   "639dbbbc-6cac-4054-83be-92e08ced155f"
 ],
  "results": [
    11393,
    11395,
    11397
  ],
  "stat": "ok"
}

Authorized Clients

owner direct_access

Security

Query Parameters

type_name string required

The entityType of the entity.

all_attributes string required

The attribute names and values (as JSON) for the entity. This is a JSON array of objects as would be accepted by the attributes parameter of entity.create. This argument is parsed as one entity. Should any part of this argument fail to parse, the entire request will be rejected.

/entity.count

Description

Count the number of records in an entityType that match a query contained in the filter parameter.

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

get

Description

Example request

Count the number of records that have a value in the birthday field.

curl -H "Authorization: Basic aW1fYV...NfbXk=" \
    --data-urlencode type_name=user \
    --data-urlencode filter='birthday is not null' \
    https://my-app.janraincapture.com/entity.count

Example Response

{
  "total_count": 15,
  "stat": "ok"
}

Example Error Response

{
  "argument_name": "filter",
  "request_id": "r6fsc52quz348mmh",
  "code": 200,
  "error_description": "filter was not valid for the following reason: Unknown attribute (null)",
  "error": "invalid_argument",
  "stat": "error"
}

Authorized Clients

owner direct_access direct_read_access

Security

Query Parameters

filter string

A query against record fields. If this parameter is not included, all records in the entity are counted. For more information on constructing queries, see entity.find.

type_name string required

The entityType of the entity.

/entity.create

Description

Create a new data record for an entityType. Once created, the new id and uuid values are returned.

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

post

Description

Example Request

Create a new instance of entityType named user with the attributes givenName, familyName, email and a plural statuses. The attributes id, uuid, created and lastUpdated are system generated.

curl -X POST \
    -H "Authorization: Basic aW1fYV...NfbXk=" \
    --data-urlencode type_name=user \
    --data-urlencode attributes='{"givenName":"Matt","familyName":"Parker",
      "email":"parkerm@example.com","statuses":[{"status":"active",
      "statusCreated":"2015-12-15T07:36:25Z"}]}' \
    https://my-app.janraincapture.com/entity.create

Example Response

{
  "id": 11649,
  "uuid": "02b0c68d-7d7a-49d8-a88d-022585b0f877",
  "stat": "ok"
}

Example Error Response

{
  "argument_name": "attributes",
  "request_id": "geup8cd3gvcvjjnc",
  "code": 200,
  "error_description": "attributes was not valid for the following
    reason: the JSON is not syntactically valid",
  "error": "invalid_argument",
  "stat": "error"
}

Authorized Clients

owner direct_access

Security

Query Parameters

attributes string required

The attribute names and values (as JSON) for the entity. You do not need to include all attribute values. A new data record will be created with the data included.

include_record string

Values are true or false. When true, a result field is added to the response containing the data of the newly-created entity record.

type_name string

The entityType of the entity. Required when authenticating with client settings.

/entity.delete

Description

Delete a single entity (and any nested objects) from an application, or delete an element of a plural.

Warning: Data removed with this API call are permanently deleted.

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

post

Description

This call must be a POST request, and due to validation cannot be passed as URL parameters. The POST needs to be formatted using body parameters instead.

Example: Delete a user record

Delete a user record with a uuid value of abcde12345abcde12345abcde12345abcde1.

curl -X POST \
    -H "Authorization: Basic aW1fYV...NfbXk=" \
    --data-urlencode type_name=user \
    --data-urlencode uuid=abcde12345abcde12345abcde12345abcde1 \
    https://my-app.janraincapture.com/entity.delete
Example Response
{
  "stat": "ok"
}
Example Error Response
{
  "argument_name": "uuid",
  "request_id": "9mq5bv72q47ehg7g",
  "code": 200,
  "error_description": "uuid was not valid for the following reason: invalid uuid",
  "error": "invalid_argument",
  "stat": "error"
}

Example: Delete a plural within a user record

Delete a plural within a user record with a uuid value of abcde12345abcde12345abcde12345abcde1. The attribute_name is formatted with the name of the plural and the id of the entry to be removed is statuses#11778.

Warning: Mistyping the attribute_name will ignore the plural and delete the entire user record.

curl -X POST \
    -H "Authorization: Basic aW1fYV...NfbXk=" \
    --data-urlencode type_name=user \
    --data-urlencode uuid=abcde12345abcde12345abcde12345abcde1 \
    --data-urlencode attribute_name="statuses#11778" \
    https://my-app.janraincapture.com/entity.delete
Example Response
{
  "stat": "ok"
}

Authorized Clients

owner direct_access

Security

Query Parameters

attribute_name string

The attribute path to a plural element to delete. The default value is the root path /, which means "delete the entire record". Any non-root path must end with the id of a specific element in a plural.

created string

Timestamps are generated when an entity is created. This value may be used to help identify the entity in this parameter. If a value is present in this parameter, and is incorrect, the call will fail.

id string required

Required when not using the uuid or key_attribute and key_value parameters. The primary key of the parent object.

key_attribute string required

Required when not using the uuid or id parameters. Use this parameter with the key_value parameter. This value is any attribute in the schema with a unique constraint.

key_value string required

Required when using the key_attribute parameter. This is the value of the unique attribute. Note: String values must be enclosed in quotes.

lastUpdated string

Timestamps are generated when an entity is updated. This value may be used to help identify the entity in this parameter. If a value is present in this parameter, and is incorrect, the call will fail.

type_name string required

The entityType of the entity.

uuid string required

Required when not using id or the key_attribute and key_value parameters. The unique identifier given to the user entity.

/entity.deleteAccess

Description

This API call removes all existing access grants associated with the selected entity from the Registration service. This permanently removes all access tokens, all refresh tokens, and all refresh secrets associated with the entity.

The intention is to invalidate sessions that are associated with the selected entity, and force the user to sign in again at the point the client attempts to use any of the access grants for that entity. Any access token stored in a browser or mobile application, any refresh token stored on a server or refresh secret generated in a mobile application is invalidated and cannot be used again.

Note that this endpoint does not remove access grants that may be managed by other services, such as Single Sign-On.

This endpoint requires a client with the owner, direct_access, access_issuer, or login_client feature.

get

Description

Deleting access grants for a record

The following example removes all access grants associated with an entity given by UUID.

curl -X POST \
    -H "Authorization: Basic aW1fYV...NfbXk=" \
    --data-urlencode type_name=user \
    --data-urlencode uuid=uuid=2efede78-fdf7-4e38-9785-4a82de768b9f \
    https://my-app.janraincapture.com/entity.deleteAccess
Example Response
{
  "stat": "ok"
}

Authorized Clients

owner login_client direct_access access_issuer

Security

Query Parameters

id string required

Required when not using key_attribute or uuid parameters. The primary key of the parent object.

key_attribute string required

Required when not using id or uuid. This value is any attribute in the schema with a unique constraint.

key_value string required

Required when using key_attribute. This is the value of the unique attribute.

Note: String values need to be enclosed in quotes.

type_name string required

The entityType of the entity.

uuid string required

Required when not using the id or key_attribute parameters. The unique identifier given the user entity.

/entity.find

Description

Retrieve user information from an application. These data entities are returned in JSON format. This information may be filtered using the optional parameters provided.

The following operators are supported in the filter parameter, from highest to lowest precedence.

  • is null, is not null (postfix)
  • not, ! (prefix)
  • >, >=, <, <= (infix)
  • =, != (infix)
  • and (infix)
  • or (infix)

Note: Previous releases of this call included the contains operator. This operator has been removed because its behavior was counterintuitive. If you use this operator now, you will get a 485 error.

Note: For the filter parameter, String values specified by operators must be surrounded by single quotes. Integer values work either with or without single quotes. If used with email, only a full email address can be used (for example, fsmith@example.com). You cannot filter on a domain (for example, example.com).

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

get

Description

Example: Sort to see the most recently-updated data first

sort_on=["-lastUpdated"]

Example: Find users with a birthday

filter='birthday is not null'

Example: Find users who identify as "male"

filter='gender = "male"'

Example: Adding more than one condition to a filter

filter='gender="male" and birthday > "2012-06-13 18:02:56.012122 +0000"'

Example: Retrieve data for specific attributes

Here is an example of returning data from Capture using entity.find, selectively returning only data for the displayName and email attributes.

curl -H "Authorization: Basic aW1fYV...NfbXk=" \
    --data-urlencode type_name=user \
    --data-urlencode attributes='["displayName", "email"]' \
    https://my-app.janraincapture.com/entity.find
Example Response
{
  "result_count": 6,
  "stat": "ok",
  "results": [
    {
      "displayName": "ian",
      "email": "ian@example.com"
    },
    {
      "displayName": "Rex",
      "email": "rex@example.com"
    },
    {
      "displayName": "sam",
      "email": "smann@example.com"
    },
    {
      "displayName": "alex",
      "email": "alex@example.com"
    },
    {
      "displayName": "john.j",
      "email": "jj@example.com"
    },
    {
      "displayName": "daniel",
      "email": "daniel@example.com"
    }
  ]
}

More Comprehensive Examples List

If you’d like to see a broader set of examples of API calls to the entity.find endpoint, please see the Example /entity.find Calls page in the Reference section.

Authorized Clients

owner direct_access direct_read_access

Security

Query Parameters

type_name string required

The entityType of the entity.

filter string

The expression used to filter the results. The default is to match all records.

max_results string

The maximum number of results to be returned. The default value is 100. Note: The highest value you can enter for max_results is 10000. You will get an error if you exceed 10000.

first_result string

Changes the first result displayed by the list to the next number specified. For example: changing this value to 3 will display the 4th user record. The default value is 1.

Using this parameter with max_results is a useful way to view the data one chunk at a time.

Note: Because this requires the call to scan for the ID number, this may cause timeout errors for databases with more than one million entities.

show_total_count string

Values: true or false. This includes a total_count in the result that shows the total number of records that matched the filter. The default value is false.

Warning: This parameter is resource intensive, and may significantly slow down results when used in conjunction with the filter parameter, and is not recommended for on-page load situations.

sort_on string

A JSON arry of attributes by which to sort. The default behavior is to sort in ascending order. To sort in descending order, include a minus sign (-) directly before the attribute name.

attributes string

A JSON array of attributes to return in the result set. The default is all attributes.

/entity.purge

Description

Use entity.purge to both permanently delete all entities in the specified entityType and their histories.

Warning: This call deletes all data and the data cannot be recovered.

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

post

Description

Example Request

curl -X POST \
    -H "Authorization: Basic aW1fYV...NfbXk=" \
    --data-urlencode type_name=user \
    --data-urlencode commit=true \
    https://my-app.janraincapture.com/entity.purge

Example Response

{
  "result": "The entities were deleted",
  "stat": "ok"
}

Authorized Clients

owner direct_access

Security

Query Parameters

commit string required

Either true or false. The default value is false. Must be set to true to purge the data.

type_name string required

The entityType of the entity.

/entity.replace

Description

Replace part of an entity with a value. The entity.replace call can be destructive. Any object attributes that you do not specify are replaced with null values. Plural values are replaced, and all new elements are automatically assigned ids. For an additive operation, use entity.update.

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

post

Description

Example: Replace an entity by UUID

This example shows how to request the replacement of an entityType of 'user' by UUID with a new set of attributes.

curl -X POST \
    -H "Authorization: Basic aW1fYV...NfbXk=" \
    --data-urlencode type_name=user \
    --data-urlencode uuid=0987098709870987 \
    --data-urlencode attributes='{"givenName":"Bob","familyName":"Smith"}' \
    https://my-app.janraincapture.com/entity.replace
Example Response
{
  "stat":"ok"
}

Example: Replace an entity by email

This example shows how to request the replacement of an entityType of 'user' by email with a new set of attributes.

curl -X POST \
    -H "Authorization: Basic aW1fYV...NfbXk=" \
    --data-urlencode type_name=user \
    --data-urlencode key_attribute=email \
    --data-urlencode key_value='"parkerm@example.com"' \
    --data-urlencode attributes='{"givenName":"Mathew","familyName":"Parkerson",
    "email":"parkerm@example.com"}' \
    https://my-app.janraincapture.com/entity.replace
Example Response
{
  "stat":"ok"
}

Authorized Clients

owner direct_access

Security

Query Parameters

id string required

Required when not using the uuid or key_attribute and key_value parameters. The primary key of the parent object. See the note in the overview.

uuid string required

Required when not using id or the key_attribute and key_value paramaters. The unique identifier given the user entity.

key_attribute string required

Required when not using id or uuid.Use with the key_value parameter. This value is any attribute in the schema with a ‘unique’ constraint.

key_value string required

Required when not using id or uuid.Use with the key_attribute parameter. This is the value of the unique attribute.

type_name string required

The entityType of the entity.

value string required

The JSON value to assign by attribute_name. For backwards compatibility, this parameter may also be called attributes.

attribute_name string

The attribute path see User Data to update. This value path contains ids for each plural element. The default is the root path, which means update the entire record.

created string

Timestamps are generated when an entity is created. This value may be used to help identify the entity in this parameter. If a value is present in this parameter, and is incorrect, the call will fail.

To format this parameter, see the Timestamp section in the Attribute Data Types topic.

lastUpdated string

Timestamps are generated when an entity is updated. This value may be used to help identify the entity in this parameter. If a value is present in this parameter, and is incorrect, the call will fail.

To format this parameter, see the Timestamp section in the Attribute Data Types topic.

include_record string

Values are true or false. When true, a result field is added to the response, containing the data of the newly updated entity record.

Note: If the attribute_name is pointed to root, the entire record is returned. If it points to a subset of the record, only that data will be returned.

/entity.update

Description

Updates part of an existing entity by appending attributes with data. This data is provided in a JSON object that specifies the path to the attribute, and the value to use.

Any object attributes not in the JSON provided are left alone. Plural values are appended, unless an ID is provided, in which case the plural data is replaced.

For more information on entity.update, see the Update an Entity topic.

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

post

Description

Example: Update specific attributes for a user record

This example shows how to update an instance of entityType 'user' by uuid, with new attributes for givenName and familyName.

curl -X POST \
    -H "Authorization: Basic aW1fYV...NfbXk=" \
    --data-urlencode type_name=user \
    --data-urlencode uuid=0987098709870987 \
    --data-urlencode attributes='{"givenName":"Matt","familyName":"Parker"}' \
    https://my-app.janraincapture.com/entity.update
Example Response
{
  "stat":"ok"
}

Example: Update a plural entry for a user record

This example shows how to update an instance of entityType 'user' by id, with new values for status in a plural entry for statuses.

curl -X POST \
    -H "Authorization: Basic aW1fYV...NfbXk=" \
    --data-urlencode type_name=user \
    --data-urlencode id=11777 \
    --data-urlencode attribute_name='/statuses#11905' \
    --data-urlencode value='{"status":"active"}' \
    https://my-app.janraincapture.com/entity.update
Example Response
{
  "stat":"ok"
}

Example: Update a user record by key_attribute and key_value

This example shows how to update an instance of entityType 'user' by key_attribute and key_value, with a a new value for displayName.

curl -X POST \
    -H "Authorization: Basic aW1fYV...NfbXk=" \
    --data-urlencode type_name=user \
    --data-urlencode key_attribute=email \
    --data-urlencode key_value='"parkerm@example.com"' \
    --data-urlencode value='{"displayName":"parkerm"}' \
    https://my-app.janraincapture.com/entity.update
Example Response
{
  "stat":"ok"
}

Authorized Clients

owner direct_access

Security

Query Parameters

uuid string required

Required when not using id or the key_attribute and key_value paramaters. The unique identifier given the user entity.

id string required

Required when not using the uuid or, key_attribute and key_value parameters. The primary key of the parent object.

key_attribute string required

Required when not using the uuid or id parameters. Use this parameter with the key_value parameter. This value is any attribute in the schema with a unique constraint.

key_value string required

Required when using the key_attribute parameter. This is the value of the unique attribute. Note: String values need to be enclosed in quotes.

type_name string required

The entityType of the entity.

value string required

The JSON value to assign a attribute_name. For backwards compatibility, this parameter may also be called attributes. This may refer to a single value to add to the attribute_name (for example “Fred”), or contain JSON pairs of attribute and name to update (for example: {"Name":"Bob","Description":"Smith"})

attribute_name string

Optionally, the attribute_name parameter may be defined to target a subset of the entity. If a attribute pathis supplied, entity_update with change only attributes from this point foreword in the schema. The default is root, meaning the entire entity will be updated.

created string

Timestamps are generated when an entity is created. This value may be used to help identify the entity in this parameter. If a value is present in this parameter, and is incorrect, the call will fail.

To format this parameter, see the Timestamp section in the Attribute Data Types topic.

lastUpdated string

Timestamps are generated when an entity is updated. This value may be used to help identify the entity in this parameter. If a value is present in this parameter, and is incorrect, the call will fail.

To format this parameter, see the Timestamp section in the Attribute Data Types topic.

include_record string

Values are true or false. When true, a result field is added to the response, containing the data of the newly updated entity record.

Note: If the attribute_name is pointed to root, the entire record is returned. If it points to a subset of the record, only that data will be returned.

attributes string required

See the value parameter, above.

/entityType

Description

Return a JSON representation of an existing entityType.

get

Description

Example Request

Return the JSON representation of the schema definition for the entityType 'user'.

curl -H "Authorization: Basic aW1fYV...NfbXk=" \
    --data-urlencode type_name=user \
    https://my-app.janraincapture.com/entityType

Example Response

{
  "schema": {
    "attr_defs": [
      {
        "name": "id",
        "type": "id"
      },
      {
        "name": "lastUpdated",
        "type": "version"
      },
      {
        "name": "birthday",
        "type": "string",
        "length": 10
      },
      {
        "name": "zipcode",
        "type": "string",
        "length": 5
      },
      {
        "name": "name",
        "type": "object",
        "attr_defs": [
          {
            "name": "id",
            "type": "id"
          },
          {
            "name": "firstName",
            "type": "string",
            "length": 128
          },
          {
            "name": "lastName",
            "type": "string",
            "length": 128
          }
        ]
      }
    ],
    "name": "user"
  },
  "stat": "ok"
}

Authorized Clients

owner login_client direct_read_access direct_access access_issuer

Security

Query Parameters

type_name string required

The name of the entityType.

/entityType.addAttribute

Description

Adds an attribute to an existing entityType schema and all stored objects of that type.

Note: Each attribute requires a type which defines the nature of the data to be stored.

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

post

Description

Example Requests

1) Add a 50 character string key named "fullName" to an existing entityType "user". In this case, the attribute is added to a simple custom schema built with the "name", "type", and "length" attributes.

curl -X POST \
    -H "Authorization: Basic aW1fYV...NfbXk=" \
    --data-urlencode type_name=user \
    --data-urlencode attr_def='{"name":"fullName","type":"string","length":50}' \
    https://my-app.janraincapture.com/entityType.addAttribute

Example 1 Response

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

2) To create an object you need to use a very specific JSON format which includes a nested attr_defs within the attr_def value:

curl -X POST \
    -H "Authorization: Basic aW1fYV...NfbXk=" \
    --data-urlencode type_name=user \
    --data-urlencode attr_def='{"name":"testObject","type":"object",
      "attr_defs":[{"name":"testOne","type":"string","length":256},
      {"name":"testTwo","type":"string","length": 256}]}' \
    https://my-app.janraincapture.com/entityType.addAttribute

Example 2 Response

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

3) To create an plural you also need to use a very specific JSON format which includes a nested attr_defs within the attr_def value:

curl -X POST \
    -H "Authorization: Basic aW1fYV...NfbXk=" \
    --data-urlencode type_name=user \
    --data-urlencode attr_def='{"name":"testPlural","type":"plural",
      "attr_defs":[{"name":"testPOne","type":"string","length":256},
      {"name":"testPTwo","type":"string","length": 256}]}' \
    https://my-app.janraincapture.com/entityType.addAttribute

Example 3 Response

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

4) Add a new dateTime attribute.

  curl -X POST \
    -H "Authorization: Basic aW1fYV...NfbXk=" \
    --data-urlencode type_name=user \
    --data-urlencode attr_def='{"name":"emailPreVerified","type":"dateTime"}' \
    https://my-app.janraincapture.com/entityType.addAttribute

Example 4 Response

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

Authorized Clients

owner

Security

Query Parameters

type_name string required

The name of the entityType which is found on the dashboard under Schema.

attr_def string required

This is a schema path to an individual attribute. Will return only the attribute value, instead of the entire record.

An attribute (as JSON) to add to the entityType. (See the Attribute Data Types section for details on attribute definitions).

The JSON must be properly formated such as: {"name":"fullName","type":"string","length":50}.

/entityType.addRule

Description

This call creates rules for user data validation on specific attributes in your schema.

User data can be validated or transformed by this rule when it is added or updated.

Example uses for entityType.addRule:

  • Defining a validation rule that rejects strings that don’t match a regular expression, such as rejecting username values that are not in the English alphabet.
  • Truncating input to a certain length.

See the Data Validation topic for a detailed overview.

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

post

Description

Example Request

curl -X POST \
    -H "Authorization: Basic aW1fYV...NfbXk=" \
    --data-urlencode type_name=user \
    --data-urlencode attributes=["givenName"] \
    --data-urlencode description="This is a rule to accept only English letters and have a maximum Length of 25" \
    --data-urlencode definition='{"and": [{"match-all":"[a-zA-Z]*"}, {"max-length":25}]}' \
    https://my-app.janraincapture.com/entityType.addRule

Example Response

{
  "result": {
  "attributes": [
    "/givenName"
  ],
  "description": "This is a rule to accept only English letters and have a maximum Length of 25",
  "uuid": "ed23abc2-5023-477d-b728-b4cfdc885f3e",
  "definition": {
      "and": [
          {
            "match-all": "[a-zA-Z]*"
          },
          {
            "max-length": 25
          }
        ]
      }
    },
    "stat": "ok"
  }

Authorized Clients

owner

Security

Query Parameters

attributes string required

A JSON array of attributes to which the rule will be applied. The default is all attributes.

description string required

A text note describing the purpose of the rule.

definition string required

A JSON object defining the rule to be added to the attribute.

type_name string required

The name of the entityType, which is found on the dashboard under Schema.

/entityType.create

Description

Create a new entityType with the specified set of attributes.

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

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.

Example Request

1) Create an entityType called user_test with attributes name and description 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=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

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"
}

2) 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

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

Query Parameters

attr_defs string required

An initial set of attributes (as JSON) to add to the entityType. (See the Attribute Data Types section for details on attribute definitions.)

The JSON must be correctly formatted such as [{"name":"Name","type":"string","case-sensitive":false}, {"name":"Description","type":"string","length":1000,"case-sensitive":false}].

type_name string required

The name of the entityType, which is found on the dashboard under Schema.

/entityType.getAccessSchema

Description

Retrieve the access schema for a particular client. An access schema defines the subset of attributes to which a client has read or write access.

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

get

Description

Example Request

Get the current write access schema for a client.

curl -H "Authorization: Basic aW1fYV...NfbXk=" \
    --data-urlencode type_name=user \
    --data-urlencode for_client_id=0987fghi0987fghi \
    --data-urlencode access_type=write \
    https://my-app.janraincapture.com/entityType.setAccessSchema

Example Response

{
  "schema": {
    "attr_defs": [
      {
        "name": "id",
        "description": "simple identifier for this entity",
        "type": "id"
      },
      {
        "name": "uuid",
        "description": "globally unique indetifier 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"
      },
      {
        "case-sensitive": false,
        "name": "Description",
        "length": 1000,
        "type": "string"
      },
      {
        "case-sensitive": false,
        "name": "Name",
        "constraints": [
          "alphanumeric"
        ],
        "length": null,
        "type": "string"
      }
    ],
    "name": "user"
  },
  "stat": "ok"
}

Authorized Clients

owner login_client direct_read_access direct_access access_issuer

Security

Query Parameters

type_name string required

The name of the entityType, which is found on the dashboard under Schema.

for_client_id string required

The client whose access schema will be returned.

access_type string required

The type of access schema. Values are read, write, read_with_token, or write_with_token.

/entityType.list

Description

Return a JSON representation of all entityTypes.

get

Description

Example Request

curl -H "Authorization: Basic aW1fYV...NfbXk=" \
    https://my-app.janraincapture.com/entityType.list

Example Response

{
  "results": [
  "user"
  ],
  "stat": "ok"
}

Authorized Clients

owner

Security

/entityType.removeAttribute

Description

Remove an existing attribute from an entityType.

Warning: All data associated with this attribute will be lost!

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

post

Description

Example Request

Remove an attribute called "fullName" from the "user" entity.

curl -X POST \
    -H "Authorization: Basic aW1fYV...NfbXk=" \
    --data-urlencode type_name=user \
    --data-urlencode attribute_name=fullName \
    https://my-app.janraincapture.com/entityType.removeAttribute

Example Response

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

Authorized Clients

owner

Security

Query Parameters

type_name string required

The name of the entityType, which is found on the dashboard under Schema.

attribute_name string required

The name of the attribute to remove.

/entityType.removeRule

Description

This removes any data validation currently configured for a specific attribute in a schema.

For a detailed explanation of creating validation filters, refer to the Data Validation topic.

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

post

Description

Example Request

curl -X POST
    -H "Authorization: Basic aW1fYV...NfbXk=" \
    --data-urlencode type_name=user
    --data-urlencode uuid=0987-fghi-0987-fghi
    https://my-app.janraincapture.com/entityType.removeRule

Example Response

{
  "stat": "ok"
}

Authorized Clients

owner

Security

Query Parameters

type_name string required

The name of the entityType, which is found on the dashboard under Schema.

uuid string required

The uuid assigned to the rule to be deleted. The uuid is found by making the entityType.rules API call.

/entityType.rules

Description

This lists the data validation rules that are currently set on a specific entityType. Each rule has a uuid identifier associated with it which is listed as well.

See the Data Validation topic for a detailed overview.

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

get

Description

curl -H "Authorization: Basic aW1fYV...NfbXk=" \
    --data-urlencode type_name=user \
    https://my-app.janraincapture.com/entityType.rules

Example Response

{
  "results": [
    {
      "attributes": [
        "/givenName"
      ],
      "description": "This is a rule to accept only English letters and have a maximum Length of 25",
      "uuid": "656670ad-ae24-43a2-8ab1-a8b070c19bb8",
      "definition": {
        "and": [
          {
            "match-all": "[a-zA-Z]*"
          },
          {
          "max-length": 25
          }
        ]
      }
    }
  ],
  "stat": "ok"
}

Authorized Clients

owner

Security

Query Parameters

type_name string required

The name of the entityType, which is found on the dashboard under Schema.

/entityType.setAccessSchema

Description

Set the access schema for a particular client. An access schema defines the subset of attributes to which a client has read or write access.

Each client can have one read access schema and one write access schema defined. Which access schema is used depends on whether the API call performs a read operation or a write operation.

Note: if you want to give a client read and write access to the same set of attributes, you must set the read and write schemas in two different calls. For mobile clients, you should use the read_with_token and write_with_token settings.

Defining the attributes parameter

When granting permissions to a top level attribute in the schema, use the attribute name formatted in JSON. Example: ["aboutMe","created"]

When granting permissions to an attribute that is part of a larger object, use an attribute path. The attribute path begins at the root of the schema, and uses slashes to navigate from the plurals to the target sub attribute. For example, to refer to the city attribute in the primaryAddress plural, use: ["/primaryAddress/city"]

When setting an access_type, for a for_client_id, you must include all attributes in one call. If an attribute is not specified, the access_type is removed.

For more information, refer to the Create an API Client page.

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

post

Description

Example Request

1) Give a client read-only access, by setting the write access schema to an empty array of attributes.

curl -X POST \
    -H "Authorization: Basic aW1fYV...NfbXk=" \
    --data-urlencode type_name=user \
    --data-urlencode for_client_id=7890fghi7890fghi \
    --data-urlencode access_type=write \
    --data-urlencode attributes='[]' \
    https://my-app.janraincapture.com/entityType.setAccessSchema

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"
      }
    ],
    "name": "user"
  },
  "notice": "reserved attributes (id, uuid, created, lastUpdated) are automatically included in the access schema",
  "stat": "ok"
}

2) Give a client write access to givenName and familyName

curl -X POST \
    -H "Authorization: Basic aW1fYV...NfbXk=" \
    --data-urlencode type_name=user \
    --data-urlencode for_client_id=7890fghi7890fghi \
    --data-urlencode access_type=write \
    --data-urlencode attributes='["givenName", "familyName"]' \
    https://my-app.janraincapture.com/entityType.setAccessSchema

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,
        "constraints": [
          "unicode-printable"
        ],
        "name": "familyName",
        "type": "string",
        "case-sensitive": false
      },
      {
        "length": 1000,
        "constraints": [
          "unicode-printable"
        ],
        "name": "givenName",
        "type": "string",
        "case-sensitive": false
      }
    ],
    "name": "user"
  },
  "notice": "reserved attributes (id, uuid, created, lastUpdated) are automatically included in the access schema",
  "stat": "ok"
}

Authorized Clients

owner

Security

Query Parameters

type_name string required

The name of the entityType, which is found on the dashboard under Schema.

for_client_id string required

The client whose access schema will be set.

access_type string required

The type of access schema to create. Values are read, write, read_with_token, or write_with_token.

attributes string required

A JSON list of attribute names. These can be full attribute paths. If a path terminates at an object or plural, then that means that the client will have access to all sub-attributes.

/entityType.setAttributeConstraints

Description

Set the list of constraints for an attribute.

Warning: This is not an additive operation, you must pass in the entire set of constraints.

The available constraints are required, unique, locally-unique, alphabetic, alphanumeric, unicode-letters, unicode-printable, and email-address.

Note: Refer to the Attribute Constraints topic for more information.

Removing Constraints

Instead of removing a constraint, use this call to overwrite the existing constraint with a new constraint. If an attribute currently has the unique and required constraints, and you want to drop the required constraint, then you would pass in constraints=["unique"]. The constraints argument must be a valid JSON array, however you can pass in an empty array, which is the equivalent of no constraints at all.

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

post

Description

Example Request

Set a "required" constraint on an attribute called "Name" on the 'user' entity.

curl -X POST \
    -H "Authorization: Basic aW1fYV...NfbXk=" \
    --data-urlencode type_name=user \
    --data-urlencode attribute_name=givenName \
    --data-urlencode constraints=["required"] \
    https://my-app.janraincapture.com/entityType.setAttributeConstraints

Example 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": null,
        "name": "aboutMe",
        "type": "string",
        "case-sensitive": false
      },
      {
        "length": 1000,
        "constraints": [
          "required"
        ],
        "name": "givenName",
        "type": "string",
        "case-sensitive": false
      },
      {
        "name": "lastLogin",
        "type": "dateTime"
      }
    ],
    "name": "user"
  },
  "stat": "ok"
}

Authorized Clients

owner

Security

Query Parameters

type_name string required

The name of the entityType.

attribute_name string required

The name of the attribute to be modified. Note: This is case sensitive.

constraints string required

A JSON list of constraints.