The api namespace holds all methods to communicate with the backend system.

dsmx.api.admin

The api.admin namespace can be used to get information about the system and current api users.

dsmx.api.admin.getAllAdminTokens(doneCallback, failCallback)

Method to receive all registered admin tokens on this system.

dsmx.api.admin.getAllAccountIds(doneCallback, failCallback)

Method to receive all account ids which have access to the api and at least one registered key pair.

dsmx.api.admin.getAllTokens(doneCallback, failCallback)

Method to receive all tokens from all accounts.

dsmx.api.admin.getAllTokensByAccountId(accountId, doneCallback, failCallback)

Method to receive all tokens from a specific account.

dsmx.api.accounts

The api.accounts namespace can be used to administrate accounts.

dsmx.api.admin.create(model, doneCallback, failCallback)

Method to create a new account.

The first parameter model must be a dsmx.model.api.createAccount model.

You can create this model via dsmx.model.api.createAccount.create().

dsmx.api.contacts

The api.contacts namespace can be used to handle contacts.

dsmx.api.contacts.count(doneCallback, failCallback)

Method to get the currenct contacts count.

dsmx.api.contacts.insert(model, doneCallback, failCallback)

Method to insert a new contact.

The first parameter model must be a dsmx.model.contact model.

You can create this model via dsmx.model.contact.create().

dsmx.api.contacts.get(doneCallback, failCallback)

Method to get contacts. This method will return the first 50 contacts.

dsmx.api.contacts.getWithStart(start, doneCallback, failCallback)

Method to get contacts. This method will return a maximum of 50 contacts, skipping start entries.

dsmx.api.contacts.getWithStartAndSize(start, size, doneCallback, failCallback)

Method to get contacts. This method will return a maximum of size contacts, skipping start entries.

dsmx.api.contacts.getWithQuery(query, doneCallback, failCallback)

Method to get contacts paged and sorted. This method will return a maximum of query.size contacts, skipping query.start entries.

The sorting defined within the query model will be applied.

The first parameter query must be a dsmx.model.api.query model.

You can create this model via dsmx.model.api.query.createcreateEmpty().

dsmx.api.contacts.update(model, doneCallback, failCallback)

Method to update a contact.

The first parameter model must be a dsmx.model.contact model.

The configuration holds the connection properties and the keys used for signing.

dsmx.config.targetSystem

Defines the target domain name. Only domain names are allowed. You must not prefix with http / https.

dsmx.config.targetProtocol

Defines the target protocol. The standard is https. Normally you do not need to change it.

dsmx.config.targetPort

Defines the target port. The standard value is null. Normally you do not need to change it.

dsmx.config.publicKey

Your public key to access the api. You need to set this property in order to access the api via signed calls. This key is used to identify you on the server when using signed api calls.

dsmx.config.privateKey

Your private api key. This key is only used to sign your requests. You need to set this property in order to access the api via signed calls. It will never be sent to the server. Never expose this key on unsecured sites (e.g. called via http).

The settings defines some properties for the behavior of the model display values when used in combination with the dsmx.ui.js file.

dsmx.settings.preferredCountryProperty

The preferred property to show when displaying the country property of the contacts model.
Possible values:
  • englishName - The english name of the country.
  • number - The ISO number code for this country.
  • alpha2 - The ISO 3166-1 alpha-2 code for this country.
  • alpha3 - The ISO 3166-1 alpha-3 code for this country.

dsmx.settings.preferredLanguageProperty

The preferred property to show when displaying the language property of the contacts model.
Possible values:
  • englishName - The english name of the language.
  • nativeName - The native name of the language.
  • name - The IETF tag of the language.
  • alpha2 - The ISO 639-1 alpha-2 code for this language.
  • alpha3 - The ISO 639-2 (T) alpha-3 code for this language.

The algorithm namespace defines helper functions needed to sign requests.

dsmx.algorithm.hmacSha256(data, password)

Method to generate the hmac sha256 hash for the given data using the given password.

dsmx.algorithm.currentUtcDateTimeStamp()

Method to get the current utc date time. The format is yyyy-MM-dd HH:mm:ssZ (e.g. 2014-11-25 17:25:30Z).

dsmx.algorithm.currentUtcDateStamp()

Method to get the current utc date without time information. The format is yyyy-MM-dd (e.g. 2014-11-25).

dsmx.algorithm.getSortedKeys()

Method to get the properties of an object as a sorted array. Only the names of the properties are returned.

The model namespace contains all models used within the api and some helper methods to handle them more easily.

dsmx.model.getDisplayValue(column, model)

Method to get the display value from a model. Handles all the possible columns to chose the right return value.

dsmx.model.contact

The contact model represents the contact data.

dsmx.model.contact.create()

Method to create a new contact model with default values.

dsmx.model.contact.columns

An array containing all column definitions used for the contact model.

Every array element represents one column. Each column has some standard properties.

The name property is the name of the contact model property used to hold the specified value.

The displayName property is the display name for this column.

The isEditable property states whether this value can be edited or not.

The possibleValues property contains the possible values for this column when the type is select.

The type property is the underlying value type. The possible values are:

  • int - integer type, whole number
  • nullableint - integer type, whole number, can be null for unkown values
  • string - text, which can be null
  • bool - boolean value [true|false]
  • nullablebool - boolean value with possible unknown value [true|false|null]
  • nullabledate - date value, can be null for unknown values
  • gender - special case of nullablebool, used to differentiate for later display
  • mailAddress - special value for mail addresses
  • country - special value used for a country, display can be configured
  • language - special value used for a language, display can be configured
  • select - predefined values which are available in the possibleValues property

dsmx.model.contact.getDisplayValue(column, model)

Method to get the display value. In the standard configuration this method points to getDisplayValue.

dsmx.model.api.createAccount

The createAccount model is used to create new accounts.

dsmx.model.api.createAccount.create()

Method to create a new createAccount model with default values.

dsmx.model.api.createAccount.columns

An array containing all column definitions used for the createAccount model. See columns for detailed information.

dsmx.model.api.createAccount.getDisplayValue(column, model)

Method to get the display value. In the standard configuration this method points to getDisplayValue.

dsmx.model.codeContract.language

The language model stores information about a language.

dsmx.model.codeContract.language.create()

Method to create a new language model with default values.

Properties:

  • nativeName - The native name of this language.
  • englishName - The english name of this language.
  • name - The IETF tag of the language.
  • alpha2 - The ISO 639-1 alpha-2 code for this language.
  • alpha3 - The ISO 639-2 (T) alpha-3 code for this language.
  • value - The value of this language. Only used when this is a possible invalid or unknown language.
  • isEmpty - Boolean value whether this language has defined properties or has no value set.
  • isValid - Boolean value whether this language is know within the system or not.

dsmx.model.codeContract.language.getValue()

Method to get the current value for display or editing purposes. This will return the value defined in preferredLanguageProperty when the language model is in a valid state.

dsmx.model.codeContract.country

The country model stores information about a country.

dsmx.model.codeContract.country.create()

Method to create a new country model with default values.

Properties:

  • englishName - The english name of this country.
  • number - The ISO number code for this country.
  • alpha2 - The ISO 3166-1 alpha-2 code for this country.
  • alpha3 - The ISO 3166-1 alpha-3 code for this country.
  • value - The value of this country. Only used when this is a possible invalid or unknown country.
  • isEmpty - Boolean value whether this country has defined properties or has no value set.
  • isValid - Boolean value whether this country is know within the system or not.

dsmx.model.codeContract.country.getValue()

Method to get the current value for display or editing purposes. This will return the value defined in preferredCountryProperty when the country model is in a valid state.