Overview

Objects in Aprimo generally have some sort of relationship to other objects. For example, a Record can contain 0 or more Metadata Fields. Sometimes you will want data from these related objects within the context of your current request. You don’t want to have to make an API request to get the data of every Metadata Field you want, nor do you want to store the unique GUIDs for each of those fields. That is where Select Headers come in. Select Headers are unique headers that allow you to request additional, related, data from Aprimo. So when making a GET request for a Record you can also request all Metadata Fields associated to that record.

There are a lot of object relationships in Aprimo and we aren’t going to cover them all here. Instead this article will serve to provide a few examples to get you started so you understand the pattern.

To start, make sure all requests you make while doing this tutorial have the header {Accept: application/hal+json}. Otherwise you will be missing data that will help you identify what select headers are available on any given request.

Get Record Fields

First we need to make a basic GET Record request. You can refer to the Simplest Approach tutorial on how to do that. Once you have that request working, because of your included {Accept: application/hal+json}, you will see a “_links” attribute. This is a list of different select headers that can be used. Add the following header to your request “{select-record: fields}”. The header name is “select-record” because that is the object you are selecting off of. Then make the request again. This time the response will contain a new “_embedded” attribute and this will contain all the field data on your record. You can use this response data to search for the fields you need by ID or Field Name.

curl --location --request GET 'https://{{Environment Name}}.dam.aprimo.com/api/core/record/{{Record ID}}' \
--header 'Authorization: Bearer {{Access Token}}' \
--header 'API-VERSION: 1' \
--header 'select-record: fields' \
--header 'Accept: application/hal+json'

 

You will also see the “_links” attribute appear in the “_embedded” fields response. These are select keys that can be used with fields, right from this same request. You should see a select key for “definition” in the response. Go ahead and add the header {select-field: definition} and make the request again. Now each field will have its own “_embedded” attribute that will contain the field definition where you can learn about the different configuration values for that specific field.

curl --location --request GET 'https://{{Environment Name}}.dam.aprimo.com/api/core/record/{{Record ID}}' \
--header 'Authorization: Bearer {{Access Token}}' \
--header 'API-VERSION: 1' \
--header 'select-record: fields' \
--header 'select-field: definition' \
--header 'Accept: application/hal+json'

Additionally, Lets say you have a lot of fields on a record and already know the ID or Field Name of the fields you need. Keep the {select-record: fields} header and also add {select-record-fields: [Comma separated list of fields]}. This new header will only return the fields you specify.

curl --location --request GET 'https://{{Environment NAme}}.dam.aprimo.com/api/core/record/{{Record ID}}' \
--header 'Authorization: Bearer {{Access Token}}' \
--header 'API-VERSION: 1' \
--header 'select-record: fields' \
--header 'Accept: application/hal+json' \
--header 'select-record-fields: 295B1779-A381-4018-BE1D-B29E3458B41C, MyField, DummyField'

 

Get Record MasterfileLatestVersion

Frequently during integrations, you will need data about the master file on an Aprimo DAM Record, such as file size or file name. On a GET Record request, try adding the header {select-record: masterfilelatestversion}. Your response will contain an “_embedded” attribute that contains some data about this file.

curl --location --request GET 'https://{{Environment Name}}.dam.aprimo.com/api/core/record/{{Record ID}}' \
--header 'Authorization: Bearer {{Access Token}}' \
--header 'API-VERSION: 1' \
--header 'Accept: application/hal+json' \
--header 'select-record: masterfilelatestversion'

Just like in the previous example, the embedded “masterfilelatestversion” contains a “_links” attribute that has a list of available select keys in it. If you want to use any of those, its important to understand that “masterfilelatestversion” is not an object, its a reference to a specific object of type “fileversion”. So if you want to get the thumbnail of a masterfilelatestversion, your select header will be {select-fileversion: thumbnail}

curl --location --request GET 'https://{{Environment Name}}.dam.aprimo.com/api/core/record/{{Record ID}}' \
--header 'Authorization: Bearer {{Access Token}}' \
--header 'API-VERSION: 1' \
--header 'Accept: application/hal+json' \
--header 'select-record: masterfilelatestversion' \
--header 'select-filversion: thumbnail'

Get Public Links

Public Links are a common aspect of integrations and you can access them through both Record and File Version select headers.
curl --location --request GET 'https://{{Environment Name}}.dam.aprimo.com/api/core/record/{{Record ID}}' \
--header 'Authorization: Bearer {{Access Token}}' \
--header 'API-VERSION: 1' \
--header 'select-record: masterfilelatestversion' \
--header 'Accept: application/hal+json' \
--header 'select-fileversion: publiclinks'