Skip to content

Tree Execution API

    This section will describe the API that Reevolute Builder exposes for an external platform to request the execution of a tree.
    Information about the request and response, as well as the parameters involved, will be provided.

    Request

    To request the execution of a tree, the following Request must be sent to the platform.

    curl -XPOST \
    https://probe.reevolute.com/v2/tenants/{TENANT_ID}/trees/{TREE_ID}/releases/{RELEASE}/executions \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Bearer {API_KEY}' \
    -H 'X-SCE-Origin: {X_SCE_Origin}' \
    -d '{"type":"{TYPE}","parameters":{PARAMS}}'

    The parameters of the request are described below.

    ParameterM/OTypeDescription
    TENANT_IDMStringIdentificador del tenant donde está el árbol que se desea ejecutar
    Ejemplo: my_tenant
    TREE_IDMStringIdentificador de árbol que se desea ejecutar
    Ejemplo: 01G66Q0R9RXJ4TFN8FAH817QCB
    RELEASEMStringRelease a ejecutar respecto al árbol
    Valores posibles: production, test
    Ejemplo: production
    API_KEYMStringAPI_KEY para ejecutar el árbol
    Ejemplo: eyJhbGciOiJSU……….6hDUYHJO5ta7HE
    X_SCE_OriginOStringIdentificador global de la transacción que puede definirse en el origen.
    Si no se define, es generado por la plataforma.
    Ejemplo: eyJhbGciOiJSU……….6hDUYHJO5ta7HE
    TYPEMStringTipo de ejecución.
    Valores posibles: sync, async, continue o cancel
    Ejemplo: sync
    PARAMSOObjeto JSONParámetros que se le entregarán al árbol.
    Ejemplo: {“param1”: “value1”, “param2”: “value2”}

    Example of request:

    curl -XPOST \
    https://probe.reevolute.com/webexec/v2/tenants/t_test/trees/01G66Q0R9R...AH817XYZ/releases/test/executions \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer eyJhbGciOiJSU...5ta7YH' \
    -H 'X-SCE-Origin:
    01GA6JP...XJBT6ZM2O' \
    -d '{"type":"sync","parameters":{"var1": "data1", "var2": "data2"}}'

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

    Respose

    In the response to a tree execution request the platform delivers the following HTTP codes.

    HTTP Status Codes

    Http Status Codes Description
    200 Successful execution tipos: “sync”, “continue”, “cancel”
    201 Successful execution types: “async”
    400 Problem in input parameters
    401 Nonexistent token
    403 No permits or no resources
    404 Tree or Release does not exist
    409 User already exists
    500 Internal error

    The format of the response for each HTTP code is described below.

    Successful Execution

    http-status-code = 200 & 201

    {
    "tree_version": "7",
    "response_type": "COMMON",
    "data": {...}
    }

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

    ParameterTypeDescription
    tree_versionStringVersión del árbol ejecutado
    response_typeStringTipo de respuesta que entrega el árbol
    Valores posibles: COMMON, INTERACTIVE
    dataObjeto JSONEstructura con la respuesta del árbol

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

    Contenido {data} para response_type "COMMON"

    For the response type “COMMON” the JSON DATA object has a structure as shown below.

    {
                     "description": "subscription payment succeded",
                     "error_code": "0",
                     "vars": {...}
      }
    

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

    Parameter Type Description
    description String Description of the error code defined in the tree
    error_code String Error code defined in the tree
    vars JSON Object Variables delivered as response by the tree

    Example of DATA structure for a successful response for COMMON type:

    {
    "description": "subscription payment succeeded",
    "error_code": "0",
    "vars": {
    "subscription_id": "298597",
    "user_id": "267568"
    }
    }

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

    Failed execution

    http-status-code = 400 & 401 & 404 & 409 & 500

    {
    "error": "tree_not_found"
    }

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

    Parameter Type Description
    error String Text describing the error

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.