Schema attributes

When a user opts in to the marketing consent, the following pieces of data are written to the marketing consent object within the user record:

  • clientId
  • context
  • granted
  • type
  • updated Consent data in user record

What if you want to make a change to this, similar to any of the following:

  • Write something different than “profileUpdate” into the context attribute?
  • Remove the type attribute from the marketing object?
  • Add another attribute to this object in order to store an additional piece of data?

Customizations like this may be done in one or two steps:

1. Update the schema (if applicable)

If you need to remove or add a data attribute from the marketing object, this is a change to the schema.

Remove a data attribute

You can remove an attribute from the schema in the Identity Cloud Console:

  1. Click on your application in the left column navigation
  2. Click to open MANAGE SCHEMAS, and click on the pertinent Entity Type (e.g. user) Manage Schema in Console
  3. Click on the consents object to open it
  4. Click on the marketing object to open it
  5. Locate the attribute within the marketing object you wish to remove (Example: I don’t need to store type because this consent will always be ‘explicit’, so I’d like to remove this attribute.) Find consents.marketing.type schema attribute in Console
  6. Click the Actions menu ( ) and select Delete
  7. A pop-up will display which requires you to type in the name of the attribute you wish to delete before clicking DELETE as confirmation Delete consents.marketing.type schema attribute in Console

    WARNING! When you delete an attribute from the schema, all existing user data stored in that attribute will be deleted as well. This deletion is irreversable, and the deleted data cannot be restored!

Add a data attribute

You can add a new attribute to the consents.marketing object for each additional piece of data to be stored. This can be done via API call.

In this step, you’ll make RESTful API calls to the Identity Cloud using your platform or language of choice. We provide complete sample calls in cURL format.

New to making API calls?

You can add a new attribute to the schema by making an API call to the /entityType.addAttribute endpoint using the POST method.

  • The base URL for this call is your Registration Domain.

    Find my Registration Domain

  • This call requires Basic Authorization. To create the authorization code for this call, your application owner Client Id and Secret must be combined with a colon in between (id:secret) and then base64 encoded.

    Find my application owner Client Id and Secret
    How to create the authorization code in Postman

SAMPLE CALL:

curl -X POST \
	https://my-registration-domain.janraincapture.com/entityType.addAttribute \
	-H 'Authorization: Basic AUTHORIZATION CODE' \
	-H 'Content-Type: application/x-www-form-urlencoded' \
	--data-urlencode type_name=user \
	--data-urlencode attr_def='{"name":"consents.marketing.myNewAttribute","type":"string","length":1000}'

Note the attr_def value used in this call:

'{"name":"consents.marketing.myNewAttribute","type":"string","length":1000}'

This is the attribute definition in JSON format.

  • Specifying the attribute name as consents.marketing.myNewAttribute places a new attribute named “myNewAttribute” into the consents/marketing object. This dot notation can be used anytime you need to add a new attribute to an existing object or plural in the schema.
  • This attribute definition creates a string attribute with a max length of 1000 characters. You may need to create a different type of attribute with different constraints. For more information, see Managing Your Schema.

If successful, you can immediately see your new attribute in the Identity Cloud Console. Navigate to MANAGE SCHEMAS > your schema (e.g. user). Scroll to the consents object (in the Name column) and click on it, then click on the marketing object to open and view your new attribute.

New marketing consent attribute in schema

2. Update the logic that writes data

If you need to add to, remove from, or change the metadata values that are written to the user record, please reach out to your Akamai Identity Cloud representative.

Example: I want to write something different than “profileUpdate” into the context attribute

The logic that tells Hosted Login what values to write into the user record can be modified by the Akamai Identity Cloud Professional Services team to support your specific needs.