/entity.update

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.

This endpoint includes the following methods:

  • POST


POST

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: 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
          

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

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

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 Response


{
  "stat": "ok"
}        
                                                    

Authorized Clients

  • owner 
  • direct_access

Security

  •  janrain-signed
  •  basic-auth
  •  janrain-oauth

Query Parameters

Parameter Type Required Description
uuid string UUID for the user record. Required if you are not using the id or key_attribute parameter.
 
id string ID of the user record. Required if you are not using the uuid or key_attribute parameter.
 
key_attribute string Name of a unique attribute used in the schema. Required if you are not using the id or uuid parameter.
key_value string Value for the key_attribute parameter.
type_name string Name of the entityType where the user record is stored.
value string Yes JSON value to be assigned to the attribute_name parameter. This parameter can refer to a single value to add to the attribute_name (for example "Fred"), or contain JSON pairs of attributes and names to update (for example: {"Name":"Bob","Description":"Smith"}).
 
attribute_name string Defines a subset of the user record to be updated. If an attribute path is supplied, entity_update will change only attributes from this point forward in the schema. The default is root, meaning the entire entity will be updated.

For backward compatibility, you can also refer to this parameter as the attributes parameter.
 
created string Timestamp generated when the entity was created. If this value is present but is incorrect, the call will fail. 
 
lastUpdated string Timestamp generated when the entity was last updated. If this value is present but is incorrect, the call will fail. 
 
include_record string When set to true, the newly-updated user record is returned as part of the API response. Note that, 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.