API Udianas doc

Contexts

The principle of contexts is to be able to present the data with varying granularity: either globally or for one of the given contexts. The various contexts available are:

  • General context (all data)
  • The press group
  • The press title
  • The edition of the press title
  • The Funeral Home Group
  • The funeral home
  • The agency of the funeral home

Trees and transactions are linked to contexts by a specific Id for each category other than the general context.

Several Ids can be set for a udiana, a tree or transaction.

Ids are sometimes combined. The combinations are:

  • Press group
    • Press title
      • Edition
  • Funeral home group
    • Funeral home
      • Agency
  • Insurance company
  • Rest home group

The agency's Id cannot be used alone, it must always be coupled with an Id Funeral Home because the agency is part of a funeral home company. On the other hand, a funeral home is not necessarily affiliated with a group.

Thus a combination Group - Funeral Home - Agency is possible.

These combinations are combinations of structure. They mean that the smallest element is a subset of the larger one. For example, the press title is part of the press group, or the agency is part of the funeral home.

In addition to these logical combinations, there are other possible combinations since a tree can be planted as part of a given title while being linked to a given funeral home.

It is therefore possible to have cases where all IDs are specified. The tree (or transaction) is then attached to an agency, its company and associated group as well as a title, an edition and its press group.

Use of contexts

Contexte and ContexteExtension objects are used to manage contexts:

  "Contexte": {
    "Environnement": "test",
    "ContexteGeneral": "OperatorName",
    "ContexteGeneralId": 99,
    "Contexte": null,
    "ContexteId": null,
    "ContexteGroupeEpfId": 0,
    "ContexteEpfId": 0,
    "ContexteEpfAgenceId": 0,
    "ContexteGroupePresseId": 55,
    "ContexteTitreId": 0,
    "ContexteTitreEditionId": 0,
    "ContexteAssuranceId": 0,
    "ContexteMaisonReposId": 0
  }

  "ContexteExtension": {
    "GroupeEpfTxt": null,
    "GroupeEpfIdExterne": 0,
    "GroupeEpfStringIdExterne": "",
    "GroupeEpfEmail": "",
    "GroupeEpfRapportHebdo": false,
    "EpfTxt": null,
    "EpfIdExterne": 0,
    "EpfStringIdExterne": "",
    "EpfEmail": "",
    "EpfRapportHebdo": false,
    "EpfAgenceIdExterne": 0,
    "GroupePresseTxt": "La voix du Nord",
    "GroupePresseIdExterne": 50,
    "GroupePresseStringIdExterne": "",
    "GroupePresseEmail": "",
    "GroupePresseRapportHebdo": false,
    "TitreTxt": null,
    "TitreIdExterne": 0,
    "TitreStringIdExterne": "",
    "TitreEmail": "",
    "TitreRapportHebdo": false,
    "TitreEditionTxt": null,
    "TitreEditionIdExterne": 0,
    "TitreEditionStringIdExterne": "",
    "TitreEditionEmail": "",
    "TitreEditionRapportHebdo": false,
    "AssuranceTxt": null,
    "AssuranceIdExterne": 0,
    "AssuranceStringIdExterne": "",
    "AssuranceEmail": "",
    "AssuranceRapportHebdo": false,
    "MaisonReposTxt": null,
    "MaisonReposIdExterne": 0,
    "MaisonReposStringIdExterne": "",
    "MaisonReposEmail": "",
    "MaisonReposRapportHebdo": false,
    "ExpediteurEmail": null,
    "ExpediteurSignature": null
  },

To attach a tree to one or more existing contexts, simply define the corresponding Ids in the Contexte object. Within this strict framework, the ContexteExtension object is not necessary.

In the Contexte object, the following properties are informative, they should not be specified when calling method:

    "Environnement": "test",
    "General": "Global",
    "GeneralId": 3,
    "Nom": "Contexte Titre de Presse",
    "Id": 3,

These are elements supplemented by Udianas to present a complete background information and corresponding wording for more legibility.

The ExpediteurEmail and ExpediteurSignature elements are used in marketing emails processes. there are depreciatad and will be replaced by propreties at another level for more flexibility in a short future.

External Ids and infos

The elements ending with Txt reprnsent the name of the entity and are mandatory at the creation of the context, but not for the modification of an existing context.

All elements ending with IdExterne and StringIdExterne are informative elements that represent the operator’s Ids or infos for the context concerned. They are not mandatory but welcome for the reporting pages.

The elements ending with Email and RaportHebdo are user the weekly report (see below).

In the example below, the EPF is called Laffut, its Id Udianas is 14 and its operator’s id is 50. To create the EPF context at Udianas, use this content :

  "Contexte": {
    // ...
    "EPF": 14,
    // ...
  }

  "ContexteExtension": {
    // ...
    "EpfTxt": "Pompes funèbres A. Laffut",
    "EpfIdExterne": 50,
    // ...
  },

xxIdExterne

Integer reference number in the operator system.

xxStringIdExternal

String reference code in the operator system.

xxEmail

The xxEmail property is used to send report alerts or notifications.

xxRapportHedbo

The xxRapportHedbo property set to true trigger the weekly email to the according recipient. If xxEmail is not set, no email is sent. Generally, the weekly email is just a notification and a link to the report Web page. See also Weekly report for more details.

Creating a new context

To create a new context, simply leave the Id null or 0 (zero) in the Contexte object and specify its wording in the ContextExtension object.

The response gives the Udianas’ Ids of the new elements.

If an email address and a particular signature are to be used for this context, just specify them in the ContextExtension object.

Changing the wording of a context

To change a wording, you need to define the context Id in the Context object and give the new wording in the ContextExtension object.

Change an email address or signature

To change the email address and/or the signature of a context, simply specify what or these elements in the ContextExtension.

Through this procedure, the email address and signature are assigned to the smaller specified context.

  • Press group
    • Press title
      • Edition
  • Funeral home group
    • Funeral home
      • Agency
  • Insurance company
  • Rest home group

If a press group and a title are specified, the email address and signature will be assigned to the title.

If an agency, a funeral director and a group are specified, the agency will be assigned the email address and signature.

When create or update contexts?

The contexte and contextextension objects are present in each POST methods.

A new context is needed when a specific POST method is called. The context creation/update and the POST request are made together in the same API request.

Each time a contexte object is send to the API, the API verify the contexte object and use the content of the contextextension object to create or update contexts.