Jump to: navigation, search

Extension Schema

ApiRef2.png
Purpose: Describes the schema for any service, state, or task extension.

Description

Describes one of the Extension resources.

  • Profile extensions are supported. Before your application can start adding extensions to a given profile, your application must define this extension's schema, which includes its nested attributes.
  • Service extensions are supported and multi-valued extensions are allowed.

Resource

Profile Extension Schema

Field Type Mandatory Description
name string yes The unique, case-insensitive name of the extension. The name must start with a letter, and can be followed with letters, numbers, or underscores (_).

The name is restricted to a maximum of 26 characters (Maximum RDBMS shared limit on creation of index).

type token
  • "single-valued"
  • "multi-valued"
  • "classifier"
yes Extensions come in the following forms:
  • Single-valued: a single extension record is associated with a given customer.
  • Multi-valued: multiple extension records can be associated with a given customer.
  • Classifier: the single-valued extension has no attribute.
attributes Attribute Schema[] no The array of zero or more attributes. Empty when type="classifier".
unique string[] no Lists attributes which are unique in the scope of a given customer. The customer profile cannot include several extension records with identical values for these attributes.


For example, let's consider a contact extension with the attributes "phone_num", "ext", "time_of_day". To ensure that a given customer does not have two contact extensions with the same phone number, set the following in the extension schema: unique = ["phone_num", "ext"] Each item of this array is either a single attribute, or an array of two or more attributes.

Service/State/Task Extension Schema

Schema for Service/State/Task Extensions
Name Type Mandatory Description
name string yes The unique, case-insensitive name of the extension. The name must start with a letter, and can be followed with letters, numbers, or underscores (_). The name is restricted to a maximum of 26 characters.
type token
  • "single-valued"
  • "multi-valued"
yes Extensions come in the following forms:
  • Single-valued: a single extension record is associated with a given customer.
  • Multi-valued: multiple extension records can be associated with any given customer.
attributes Attribute Schema[] yes The attributes that define the extension.
unique string[] no Lists attributes (separated with commas) which are unique in the scope of a given service, state, or task. The resource cannot include several extension records with identical values for these attributes.


For example, let's consider a bill extension with the attribute "bill_id". To ensure that a given service does not have two bills with the same "bill_id", set the following in the extension schema: unique = ["bill_id"] Each item of this array is either a single attribute, or an array of two or more attributes.

Examples

Schema of a Single-Valued Extension

 {
 "attributes": [
     {"name":"FeedbackType","type":"string","length":"10","mandatory":"true"},
     {"name":"rating","type":"integer","mandatory":"true"},
     {"name":"notes","type":"string","length":256,"mandatory":"false"}
     ],
 "name":"Feedback",
 "type":"single-valued"
 }

Schema of a Multi-valued Extension

   {
     "attributes": [
         {"name":"car type","type":"string","length":"50","mandatory":"true"},
         {"name":"price","type":"integer","mandatory":"true"},
         {"name":"seats","type":"integer"},
         {"name":"comments","type":"string","length":"1024"}
         ],
     "name":"Proposal",
     "type":"multi-valued"
   }
  

See Query State Extension Schema for further examples.

Schema of a Profile Extension

The following schema describes the Address extension.

  "name":"Address",
  "type":"single-valued",    
  "attributes": [
      {"name":"AddressType","type":"integer","default":0},
      {"name":"Address","type":"string","length":256},
      {"name":"City","type":"string","length":32},
      {"name":"County","type":"string","length":32},
      {"name":"PostCode","type":"string", "length":10},
      {"name":"Country","type":"string","length":32}
      ]
This page was last edited on November 23, 2017, at 14:24.
Comments or questions about this documentation? Contact us for support!