Getting field definitions endpoint
This endpoint is invoked by AMS to retrieve field definitions. This is currently only applicable to Responsys.
Service URL
<product-base-url>/export/tenants/<tenantId>/instances/<instanceId>/schema
Request Method
GET
Request Header
Authorization: Bearer <JWT>
Content-Type=application/json
Bearer Token
JWT claims
In the scenario where AMS makes the request to the endpoint, the key and value pairs bear the following meanings:
Key | Value Definition | Context |
---|---|---|
iss
|
The issuer of the token. | The issuer is ams . |
aud
|
The audience of the token. | The product UUID created by AMS. |
exp
|
The date and time the token will expire, expressed as a Unix timestamp. Must be after the current date/time. | Set to 60 seconds after the JWT was created. |
iat
|
The date and time the JWT was issued, expressed as a Unix timestamp. | Set to the current time. |
o.a.p.ctenantId
|
The id of the tenant. | The id of the tenant. |
Signature
Signed with an app's install secret.
Sample JWT Payload
{
"iss": "AMS",
"iat": 1507745530,
"exp": 1539281530,
"aud": "71c092df-351e-4f39-da0a-687a108fae4f",
"o.a.p.ctenantId": "6607"
}
Sample Response in case of success
RESPONSE NOTES:
-
The endpoint responds with an object that contains a collection of objects
{
objects: [{}, {}]
}
Here is a sample response of objects from Responsys.
{
"objects": [
{
"name": "",
"type": "",
"fields": [
{
"name": "RIID_",
"dataType": "Text",
"width": 0,
"readOnly": true
},
{
"name": "CREATED_SOURCE_IP_",
"dataType": "Text",
"width": 255,
"readOnly": true
},
{
"name": "CUSTOMER_ID_",
"dataType": "Text",
"width": 255,
"readOnly": true
},
{
"name": "EMAIL_ADDRESS_",
"dataType": "Text",
"width": 500,
"readOnly": true
},
{
"name": "EMAIL_DOMAIN_",
"dataType": "Text",
"width": 255,
"readOnly": true
},
{
"name": "EMAIL_ISP_",
"dataType": "Text",
"width": 255,
"readOnly": true
},
{
"name": "EMAIL_FORMAT_",
"dataType": "Text",
"width": 1,
"readOnly": true
},
{
"name": "EMAIL_PERMISSION_STATUS_",
"dataType": "Text",
"width": 1,
"readOnly": true
},
{
"name": "EMAIL_DELIVERABILITY_STATUS_",
"dataType": "Text",
"width": 1,
"readOnly": true
},
{
"name": "EMAIL_PERMISSION_REASON_",
"dataType": "Text",
"width": 255,
"readOnly": true
},
{
"name": "EMAIL_MD5_HASH_",
"dataType": "Text",
"width": 50,
"readOnly": true
},
{
"name": "EMAIL_SHA256_HASH_",
"dataType": "Text",
"width": 100,
"readOnly": true
},
{
"name": "MOBILE_NUMBER_",
"dataType": "Text",
"width": 25,
"readOnly": true
},
{
"name": "MOBILE_COUNTRY_",
"dataType": "Text",
"width": 25,
"readOnly": true
},
{
"name": "MOBILE_PERMISSION_STATUS_",
"dataType": "Text",
"width": 1,
"readOnly": true
},
{
"name": "MOBILE_DELIVERABILITY_STATUS_",
"dataType": "Text",
"width": 1,
"readOnly": true
},
{
"name": "MOBILE_PERMISSION_REASON_",
"dataType": "Text",
"width": 255,
"readOnly": true
},
{
"name": "POSTAL_STREET_1_",
"dataType": "Text",
"width": 255,
"readOnly": true
},
{
"name": "POSTAL_STREET_2_",
"dataType": "Text",
"width": 255,
"readOnly": true
},
{
"name": "CITY_",
"dataType": "Text",
"width": 50,
"readOnly": true
},
{
"name": "STATE_",
"dataType": "Text",
"width": 50,
"readOnly": true
},
{
"name": "POSTAL_CODE_",
"dataType": "Text",
"width": 25,
"readOnly": true
},
{
"name": "COUNTRY_",
"dataType": "Text",
"width": 50,
"readOnly": true
},
{
"name": "POSTAL_PERMISSION_STATUS_",
"dataType": "Text",
"width": 1,
"readOnly": true
},
{
"name": "POSTAL_DELIVERABILITY_STATUS_",
"dataType": "Text",
"width": 1,
"readOnly": true
},
{
"name": "POSTAL_PERMISSION_REASON_",
"dataType": "Text",
"width": 255,
"readOnly": true
},
{
"name": "CREATED_DATE_",
"dataType": "DateTime",
"width": 0,
"readOnly": true
},
{
"name": "MODIFIED_DATE_",
"dataType": "DateTime",
"width": 0,
"readOnly": true
},
{
"name": "CITY",
"dataType": "Text",
"width": 500,
"readOnly": false
},
{
"name": "COUNTRY",
"dataType": "Text",
"width": 500,
"readOnly": false
},
{
"name": "HUMIDITY",
"dataType": "Double",
"width": 22,
"readOnly": false
},
{
"name": "TEMPERATURE",
"dataType": "Double",
"width": 22,
"readOnly": false
}
]
}
]
}
This is a sample object named "contact" that was defined.
{
"name": "contact",
"type": "Standard"
"fields": [{
"name": "firstname",
"dataType": "Text",
"width": 40,
"unique": false,
"required": false,
"readOnly": false,
"minimumValue": null,
"maximumValue": null,
"possibleValues": null,
"format": null,
"resourceBundles": {
"en": {
"name": "Firstname"
},
"zh": {
"name": "Firstname in Chinese"
}
}
}],
"children": ["address", "organization"],
"resources": {
"defaultLocale": "en",
"resourceBundles": {
"en": {
"name": "Contact"
},
"zh": {
"name": "Contact in Chinese"
}
}
}
}
Defining an object
The following table defines attributes used to define an object.
Attribute | Description |
---|---|
name | Name of an object |
type | Type of an object, could either be "Standard" or "Custom" |
fields | Collection of fields within an object |
children | Collection of names of objects that are children to this object |
resources | A map that provides display name of an object in different locales. Also provides the default locale. |
The following table defines attributes used to define a field.
Attribute | Description |
---|---|
name | Name of an object |
dataType | Data type of a field, could be one of the following [Boolean, Integer, Long, Float, Double, Text, DateTime] |
width | Defines character width of a text field |
unique | A boolean set to "true" is the field is unique |
required | A boolean set to "true" for not null field where a value is required |
readOnly | A boolean set to "true" for a field the can be read but cannot be set |
minimumValue | A value used to define the lower end of a range for a field.Does not apply for fields of type Boolean or Text |
maximumValue | A value used to define the upper end of a range for a field.Does not apply for fields of type Boolean or Text |
possibleValues | A list of value that can be set in a field |
format | A format that needs to be applied. This could be a date format, number format etc. |
resources | A map that provides display name of a field in different locales. Also provides the default locale. |