How to Create a Profile

New Profiles are automatically created when Profile data is added into Audience, there is no need to explicitly create them. So, to create our first Profile we'll set a First Name on a Profile that does not yet exist.

Let's say we want to create Andy's Profile, with his email address andy.demo@apsis.com.

We'll need:

  • A Profile Key to identify the Profile

  • A valid Keyspace

  • A valid Section

  • A valid Attribute

  • A valid value for this Attribute: Andy

About discriminators

To identify fields and entities in Audience like Attributes, Sections or Keyspaces, you'll use discriminators.

We'll explain more about discriminators later on, but for now you only need to know that:

  1. The discriminator for the default First Name Attribute is com.apsis1.attributes.firstname

  2. The discriminator for the email Keyspace is com.apsis1.keyspaces.email

When using the email Keyspace, always use the email address as Profile key.


Creating a Profile with an Attribute

As mentioned, a Profile can be created with only an Attribute. An Attribute can exist in multiple versions and the version ID is used to set the value.

Per region host names

APSIS One API is provided under different hostnames depending on your region. For EU use https://api.apsis.one/, for APAC call https://api-apac.apsis.one/.

Let's fetch the list of Attributes first.

curl --request GET \
  --url https://api.apsis.one/audience/sections/com.apsis1.sections.default/attributes \
  --header 'authorization: Bearer '

With these, we can set the value of the First Name Attribute to the given string on the Profile identified by the email address.

If you run this API call and then search for the Profile in APSIS One's Audience with it's Profile Key, you should see Andy's Profile!

curl -X PATCH \
https://api.apsis.one/audience/keyspaces/com.apsis1.keyspaces.email/profiles/andy.demo%40apsis.com/sections/com.apsis1.sections.default/attributes \
  --header 'authorization: Bearer ' \
  -d '{
    "": "andy.demo@apsis.com",
    "": "Andy"
}'

About URI Encoding

Remember to apply correct URI encoding in all requests, since part of the data is set through the URI itself.

Did this answer your question?