API Udianas doc

POST /Udianas/Creer

[POST] /Udianas/creer

Creates a new udiana

The species used is calculated by Tree-Nation. It depends on the availability and the operators' rules.

Request parameters

Key

The operator's public key is passed through a Header key entry and does not appear in the method URL.

[body] Json object

The Body section of the request contains a UdianasCreer object.

Example of the object, context and contextExtension parameters are shortened for readability :

{
  "Objet": "string",
  "Id": 0,
  "IdExternal": "string",
  "Statut": "string",
  "Contexte": {
    "Environnement": "string",
    "ContexteGeneral": "string",
    "ContexteGeneralId": 0,
    ...
  },
  "ContextExtension": {
    ...
  },
  "Defunt": {
    "Nom": "string",
    "Prenom": "string",
    "Civilite": "string",
    "DateDeces": "2020-05-17T10:57:03.180Z",
    "DateNaissance": "2020-05-17T10:57:03.180Z",
    "DateDecesApproximative": false,
    "Url": "https://www.website.ext/page",
    "ImageUrl": "https://www.website/ext/images/image.jpg"
  },
  "Famille": {
    "FamilleEmail": "string",
    "FamilleNom": "string",
    "Langue": "string"
  },
  "UdianaId": 0,
  "Message": "string",
  "AConfirmer": false,
  "ExternalId": 0,
  "DeLaPartDe": "string",
  "Langue": "string",
  "UdianaAnonyme": false,
  "UdianaAnonymeNom": "string",
  "ArbreOrphelin": false,
  "SpecialEmailType": 0,
  "UdianasLot": 0,
  "UEventId": 0
}

UdianaId

Set to 0 or null (default) to create a new udiana. Set to an UdianaId to plant the new tree in an existing udiana. In this case, the parameter AConfirmer is ignored. In case of ArbreOrphlin set to true, the UdianaId is ignored too. See ArbreOrphelin parameter bolow.

Message

Message to add in the tee page. Generally left blank or null. Example of message : "Sincere condolences".

AConfirmer

Default is false. If set to true, an email if sent the the family with a confirmation link. The udiana is created without any tree and not visible on Internet. If the family click the confirmation link, the udiana becomes visible and the first tree is added on behalf of the context defined in the request.

ExternalId

Numeric external reference. For information only. Added too in the transaction object for information.

DeLaPartDe

Define the planter. This text is published on the tree's card and in the tree's page to explain who plant this tree. If null or white spaces, replaced with "unknown" in the choosen language.

Langue

Force the language of the messages for this udiana. Default is null. If not set or emplty. The context language is used. If the context language is not defined, the operateur language is used. It allows the operator to work in multilingual zones selecting the right language for the families.

UdianaAnonyme

Set to true if the udiana have to be anonymous. In this case, you can set the name and the firstname of the deseased person like another case, but the name shown in the udiana is UdianaAnonymeNom value or if UdianaAnonymeNom is null, the udianaId. No information about the deseaced person is shown.

UdianaAnonymeNom

Only used if UdianaAnomyme is set to true. This value is used as name of the udiana and no information about the deseaced person is shown even if the deceased person name and firstname value are set.

ArbreOrphelin

Set to true if the tree is not attached to any person and will be planted in the global forest which contanins all orphan trees. The UdianaId of the global forest is managed by the API. UdianaId can be set to 0 in all cases. If the global forest does not exist, the API create it and link it to the operator.

Url

Url in Defunt object is use to redirect the Website visitor to an operator's Web page related to the deceased. This link is used only during the 14 days after the creation of the udiana. If the Url is null or white spaces, no link is shown.

ImageUrl

ImageUrl in Defunt object is use to set the path of the image used in the udiana to represent the deceased.

SpecialEmailType

Select the email type. Allways set to null or 0, except for special purpose. Ask Udianas to have the emailTypeId when needed.

DateDecesApproximative

Is set to true if the date of death is not sure. In this case the date is not shown on the deceased person's Web presentation. But the date is still mandatoty and used to calculate some deadlines.

UdianasLot set to specify a batch number. Used in some statistical reports.

UEventId, optional, set to an Event Id. Events are predefined by Udianas and correspond to special events organised inside Udianas Website. Like Memorials or Souvenir Week.

Response parameters

Response 200

Udiana id created

{
  "Objet": "string",
  "Id": 0,
  "IdExerne": "string",
  "Statut": "string",
  "Contexte": {
    "Environnement": "string",
    "ContexteGeneral": "string",
    "ContexteGeneralId": 0,
    "Contexte": "string",
    "ContexteId": 0,
    "ContexteGroupeEpfId": 0,
    "ContexteEpfId": 0,
    "ContexteEpfAgenceId": 0,
    "ContexteGroupePresseId": 0,
    "ContexteTitreId": 0,
    "ContexteTitreEditionId": 0,
    "ContexteAssuranceId": 0,
    "ContexteGroupeMaisonReposId": 0
  },
  "Date": "2020-05-17T10:57:03.551Z",
  "Erreur": "string",
  "IdUdiana": 0,
  "IdDefunt": 0,
  "IdEspece": 0,
  "NombreArbre": 0,
  "AConfirmer": false,
  "NombreArbresGratuits": 0,
  "IdTransaction": 0,
  "UdianasLot": 0
}

NombreArbre

The number of tree planted. Typically 1.

AConfirmer

Confirm the AConfirmer setting. If true, the number of trees is 0 because the tree is planted later.

NombreArbresGratuits

Gives the number of free trees for this operation. Could not be greater than NombreArbre. Prepaid trees used in this operation appears as free trees because the payment is not link to this transaction.

IdTransaction

Udianas' transaction id. Can be used inside Transaction API methods for control purpose.

Types of udianas

An udiana can be

  • classic
  • anonymous
  • global

Classic udiana

This is the default behaviour.

Anonymous udiana

The udiana is created and oe tree is planted for a deceased person, but information about this person appears on the public websites. If no specific message is set, the udiana id is used as title for the udiana.

Set UdianaAnonyme to true and optionally give a value to UdianaAnonymeNom to create an anonymous udiana.

Global udiana

There is maximum one global udiana by operator. All the trees not attached to a classic or a anonymous udiana are stored in this global udiana.

The name of this udiana is the name of the operator.

Error 400 403 404 500

Something was wrong. The explaination is in the Message parameter

{
  "Objet": "string",
  "Statut": "string",
  "Message": "string",
  "ApiContexte": {
    "Environnement": "string",
    "ContexteGeneral": "string",
    "ContexteGeneralId": 0,
    "Contexte": "string",
    "ContexteId": 0,
    "ContexteGroupeEpfId": 0,
    "ContexteEpfId": 0,
    "ContexteEpfAgenceId": 0,
    "ContexteGroupePresseId": 0,
    "ContexteTitreId": 0,
    "ContexteTitreEditionId": 0,
    "ContexteAssuranceId": 0,
    "ContexteGroupeMaisonReposId": 0
  },
  "HttpStatusCode": xxx
}

Error 400

Request with an incorrect or incoherent request object. More details in Message property.

Error 403

Access denied. The API key is missing or not allowad to access the API.

Error 404

Not found. Returned if an unexisting element is requested. More details in Message property.

Error 500

Unattended fatal error. Typically database error, application incoherence or server system error.