Obtener estructura/esquema de un Tipo de Entrega

Para obtener la estructura/esquema de un tipo de Entrega, se debe enviar un GET como el que se especifica a continuación.

GET https://api.persat.com.ar/v1/deliveries-schemas/schema_id

Path Parameters

NameTypeDescription

schema_id*

Number

Identificador del tipo (esquema) de Entrega

Headers

NameTypeDescription

Authorization*

String

Bearer API_KEY

{
    "success": true,
    "data": {
        "schema_group": 787,
        "schema_id": 398,
        "production": true,
        "version": 4,
        "draft": false,
        "name": "Entrega de Tienda Nube",
        "default_service_time": 10,
        "default_due_days": 2,
        "labels_ids": [
            3,
            8
        ],
        "instructions_description": {
            "widgets": [
                {
                    "id": "FWtQn2m9v",
                    "title": "Campo Texto",
                    "subtitle": "Complete con los datos correspondientes",
                    "widget_type": "TEXT_FIELD"
                },
                {
                    "id": "FWYBl1VyA",
                    "title": "Campo Parrafo",
                    "subtitle": "Complete las observaciones",
                    "widget_type": "TEXT_PARAGRAPH"
                },
                {
                    "id": "FWiOVySSg",
                    "title": "Seccion Nueva",
                    "subtitle": "Subtitulo",
                    "widget_type": "NEW_SECTION"
                },
                {
                    "id": "FW8dvI3gO",
                    "title": "Titulo",
                    "subtitle": "Subtitulo",
                    "widget_type": "STATIC_FIELD"
                },
                {
                    "id": "FWJt5MLSn",
                    "title": "Campo Numero",
                    "subtitle": "Complete con el valor correspondiente",
                    "widget_type": "NUMBER_FIELD"
                },
                {
                    "id": "FWykMSmmd",
                    "title": "Campo Fecha",
                    "subtitle": "Seleccione la fecha",
                    "widget_type": "DATE_FIELD"
                },
                {
                    "id": "FWO63AbLU",
                    "title": "Campo Hora",
                    "subtitle": "Seleccione el horario",
                    "widget_type": "TIME_FIELD"
                },
                {
                    "id": "FWBsxBUIQ",
                    "title": "Seleccion Simple",
                    "subtitle": "Seleccione alguna opción",
                    "widget_type": "SIMPLE_SELECTION",
                    "description": {
                        "options": [
                            "Opcion 1",
                            "Opcion 2",
                            "Opcion 3"
                        ]
                    }
                },
                {
                    "id": "FWkLpYAEU",
                    "title": "Seleccion Simple - Lista desplegable",
                    "subtitle": "Seleccione alguna opcion",
                    "widget_type": "DROPDOWN_SELECTION",
                    "description": {
                        "options": [
                            "Opcion 1",
                            "Opcion 2",
                            "Opcion 3"
                        ]
                    }
                },
                {
                    "id": "FW6NzFzNu",
                    "title": "Seleccion Multiple",
                    "subtitle": "Seleccione las opciones",
                    "widget_type": "MULTIPLE_SELECTION",
                    "description": {
                        "options": [
                            "Opcion 1",
                            "Opcion 2",
                            "Opcion 3"
                        ]
                    }
                },
                {
                    "id": "FW7kFoJTv",
                    "title": "Seccion Nueva",
                    "subtitle": "Subtitulo",
                    "widget_type": "NEW_SECTION"
                },
                {
                    "id": "FWFkws90Z",
                    "title": "Etiqueta",
                    "subtitle": "Seleccione alguna opcion",
                    "widget_type": "LABEL_FIELD",
                    "description": {
                        "options": [
                            {
                                "color": "RED",
                                "option_name": "Etiqueta 1"
                            },
                            {
                                "color": "ORANGE",
                                "option_name": "Etiqueta 2"
                            },
                            {
                                "color": "YELLOW",
                                "option_name": "Etiqueta 3"
                            }
                        ]
                    }
                }
            ]
        },
        "results_description": {
            "widgets": [
                {
                    "id": "FW40IlFW1",
                    "title": "Campo Texto",
                    "subtitle": "Complete con los datos correspondientes",
                    "widget_type": "TEXT_FIELD"
                },
                {
                    "id": "FWy1RBJ2j",
                    "title": "Campo Parrafo",
                    "subtitle": "Complete las observaciones",
                    "widget_type": "TEXT_PARAGRAPH"
                },
                {
                    "id": "FW29cS1UT",
                    "title": "Titulo",
                    "subtitle": "Subtitulo",
                    "widget_type": "STATIC_FIELD"
                },
                {
                    "id": "FWr752ZuM",
                    "title": "Seccion Nueva",
                    "subtitle": "Subtitulo",
                    "widget_type": "NEW_SECTION"
                },
                {
                    "id": "FWGa6f4zq",
                    "title": "Campo Numero",
                    "subtitle": "Complete con el valor correspondiente",
                    "widget_type": "NUMBER_FIELD"
                },
                {
                    "id": "FWkMi5Tos",
                    "title": "Campo Fecha",
                    "subtitle": "Seleccione la fecha",
                    "widget_type": "DATE_FIELD"
                },
                {
                    "id": "FWrvecAy0",
                    "title": "Campo Hora",
                    "subtitle": "Seleccione el horario",
                    "widget_type": "TIME_FIELD"
                },
                {
                    "id": "FWKFvJY55",
                    "title": "Seleccion Simple",
                    "subtitle": "Seleccione alguna opción",
                    "widget_type": "SIMPLE_SELECTION",
                    "description": {
                        "options": [
                            "Opcion 1",
                            "Opcion 2",
                            "Opcion 3"
                        ]
                    }
                },
                {
                    "id": "FWYEmJTly",
                    "title": "Seleccion Simple - Lista desplegable",
                    "subtitle": "Seleccione alguna opcion",
                    "widget_type": "DROPDOWN_SELECTION",
                    "description": {
                        "options": [
                            "Opcion 1",
                            "Opcion 2",
                            "Opcion 3"
                        ]
                    }
                },
                {
                    "id": "FWPvZlPgg",
                    "title": "Seleccion Multiple",
                    "subtitle": "Seleccione las opciones",
                    "widget_type": "MULTIPLE_SELECTION",
                    "description": {
                        "options": [
                            "Opcion 1",
                            "Opcion 2",
                            "Opcion 3"
                        ]
                    }                    
                },
                {
                    "id": "FWiCpxJy4",
                    "title": "Campo Foto",
                    "subtitle": "Imagen",
                    "widget_type": "IMAGE_FIELD"
                },
                {
                    "id": "FWTcXUki9",
                    "title": "Seccion Nueva",
                    "subtitle": "Subtitulo",
                    "widget_type": "NEW_SECTION"
                },
                {
                    "id": "FWdWBC1FT",
                    "title": "Firma",
                    "subtitle": "firma digital",
                    "widget_type": "SIGNATURE_FIELD"
                },
                {
                    "id": "FWOIrekYj",
                    "title": "Etiqueta",
                    "subtitle": "Seleccione alguna opcion",
                    "widget_type": "LABEL_FIELD",
                    "description": {
                        "options": [
                            {
                                "color": "RED",
                                "option_name": "Etiqueta 1"
                            },
                            {
                                "color": "ORANGE",
                                "option_name": "Etiqueta 2"
                            },
                            {
                                "color": "YELLOW",
                                "option_name": "Etiqueta 3"
                            }
                        ]
                    }
                },
                {
                    "id": "FWAHpt7u9",
                    "title": "Tabla Master Db",
                    "subtitle": "Complete los datos solicitados",
                    "widget_type": "MASTER_DB_TABLE",
                    "description": {
                        "mdb_id": 133,
                        "main_field": 1,
                        "show_fields": [],
                        "cols": [
                            {
                                "col_id": "USER_COL_zyNB1626881341371",
                                "name": "Cantidad",
                                "type": "NUMBER"
                            },
                            {
                                "col_id": "USER_COL_ZuDt1626881351792",
                                "name": "Descuento",
                                "type": "DROPDOWN"
                            },
                            {
                                "col_id": "USER_COL_ObtI1626881369567",
                                "name": "Observaciones",
                                "type": "TEXT"
                            },
                            {
                                "col_id": "USER_COL_tvse1626881378692",
                                "name": "sub Total",
                                "type": "CALCULATED"
                            }
                        ],
                        "total_fields": [
                            {
                                "total_field_id": "USER_TOTAL_YNLS1626881473036",
                                "name": "Descuento magico",
                                "type": "DROPDOWN"
                            },
                            {
                                "total_field_id": "USER_TOTAL_jltS1626881482952",
                                "name": "Total",
                                "type": "NUMBER"
                            }
                        ]
                    }
                },
                {
                    "id": "FW_FINAL_STATE",
                    "title": "Estado final de la entrega",
                    "subtitle": "Seleccione una de las opciones disponibles",
                    "widget_type": "DELIVERY_FINAL_STATE_WIDGET"
                }
            ]
        }
    }
}

Analizando la Respuesta

En caso que no haya ningun error, obtenemos

Algunos widgets solo están disponibles en el formulario de devolución results_description, y no asi en el formulario de indicaciones instructions_description

{
    "success": true,
    "data": {
        "schema_group": 787,
        "schema_id": 398,
        "production": true,
        "version": 4,
        "draft": false,
        "name": "Entrega de Tienda Nube",
        "default_service_time": 10,
        "default_due_days": 2,
        "labels_ids": [
            3,
            8
        ],
        "instructions_description": {
            "widgets": [
                {
                    "id": "FWtQn2m9v",
                    "title": "Campo Texto",
                    "subtitle": "Complete con los datos correspondientes",
                    "widget_type": "TEXT_FIELD"
                },
                {
                    "id": "FWYBl1VyA",
                    "title": "Campo Parrafo",
                    "subtitle": "Complete las observaciones",
                    "widget_type": "TEXT_PARAGRAPH"
                },
                {
                    "id": "FWiOVySSg",
                    "title": "Seccion Nueva",
                    "subtitle": "Subtitulo",
                    "widget_type": "NEW_SECTION"
                },
                {
                    "id": "FW8dvI3gO",
                    "title": "Titulo",
                    "subtitle": "Subtitulo",
                    "widget_type": "STATIC_FIELD"
                },
                {
                    "id": "FWJt5MLSn",
                    "title": "Campo Numero",
                    "subtitle": "Complete con el valor correspondiente",
                    "widget_type": "NUMBER_FIELD"
                },
                {
                    "id": "FWykMSmmd",
                    "title": "Campo Fecha",
                    "subtitle": "Seleccione la fecha",
                    "widget_type": "DATE_FIELD"
                },
                {
                    "id": "FWO63AbLU",
                    "title": "Campo Hora",
                    "subtitle": "Seleccione el horario",
                    "widget_type": "TIME_FIELD"
                },
                {
                    "id": "FWBsxBUIQ",
                    "title": "Seleccion Simple",
                    "subtitle": "Seleccione alguna opción",
                    "widget_type": "SIMPLE_SELECTION",
                    "description": {
                        "options": [
                            "Opcion 1",
                            "Opcion 2",
                            "Opcion 3"
                        ]
                    }
                },
                {
                    "id": "FWkLpYAEU",
                    "title": "Seleccion Simple - Lista desplegable",
                    "subtitle": "Seleccione alguna opcion",
                    "widget_type": "DROPDOWN_SELECTION",
                    "description": {
                        "options": [
                            "Opcion 1",
                            "Opcion 2",
                            "Opcion 3"
                        ]
                    }                    
                },
                {
                    "id": "FW6NzFzNu",
                    "title": "Seleccion Multiple",
                    "subtitle": "Seleccione las opciones",
                    "widget_type": "MULTIPLE_SELECTION",
                    "description": {
                        "options": [
                            "Opcion 1",
                            "Opcion 2",
                            "Opcion 3"
                        ]
                    }                    
                },
                {
                    "id": "FWFkws90Z",
                    "title": "Etiqueta",
                    "subtitle": "Seleccione alguna opcion",
                    "widget_type": "LABEL_FIELD",
                    "description": {
                        "options": [
                            {
                                "color": "RED",
                                "option_name": "Etiqueta 1"
                            },
                            {
                                "color": "ORANGE",
                                "option_name": "Etiqueta 2"
                            },
                            {
                                "color": "YELLOW",
                                "option_name": "Etiqueta 3"
                            }
                        ]
                    }
                }
            ]
        },
        "results_description": {
            "widgets": [
                {
                    "id": "FW40IlFW1",
                    "title": "Campo Texto",
                    "subtitle": "Complete con los datos correspondientes",
                    "widget_type": "TEXT_FIELD"
                },
                {
                    "id": "FWy1RBJ2j",
                    "title": "Campo Parrafo",
                    "subtitle": "Complete las observaciones",
                    "widget_type": "TEXT_PARAGRAPH"
                },
                {
                    "id": "FW29cS1UT",
                    "title": "Titulo",
                    "subtitle": "Subtitulo",
                    "widget_type": "STATIC_FIELD"
                },
                {
                    "id": "FWr752ZuM",
                    "title": "Seccion Nueva",
                    "subtitle": "Subtitulo",
                    "widget_type": "NEW_SECTION"
                },
                {
                    "id": "FWGa6f4zq",
                    "title": "Campo Numero",
                    "subtitle": "Complete con el valor correspondiente",
                    "widget_type": "NUMBER_FIELD"
                },
                {
                    "id": "FWkMi5Tos",
                    "title": "Campo Fecha",
                    "subtitle": "Seleccione la fecha",
                    "widget_type": "DATE_FIELD"
                },
                {
                    "id": "FWrvecAy0",
                    "title": "Campo Hora",
                    "subtitle": "Seleccione el horario",
                    "widget_type": "TIME_FIELD"
                },
                {
                    "id": "FWKFvJY55",
                    "title": "Seleccion Simple",
                    "subtitle": "Seleccione alguna opción",
                    "widget_type": "SIMPLE_SELECTION",
                    "description": {
                        "options": [ 
                            "Opcion 1",
                            "Opcion 2",
                            "Opcion 3"
                        ]
                    }
                },
                {
                    "id": "FWYEmJTly",
                    "title": "Seleccion Simple - Lista desplegable",
                    "subtitle": "Seleccione alguna opcion",
                    "widget_type": "DROPDOWN_SELECTION",
                    "description": {
                        "options": [ 
                            "Opcion 1",
                            "Opcion 2",
                            "Opcion 3"
                        ]
                    }                    
                },
                {
                    "id": "FWPvZlPgg",
                    "title": "Seleccion Multiple",
                    "subtitle": "Seleccione las opciones",
                    "widget_type": "MULTIPLE_SELECTION",
                    "description": {
                        "options": [ 
                            "Opcion 1",
                            "Opcion 2",
                            "Opcion 3"
                        ]
                    }                    
                },
                {
                    "id": "FWiCpxJy4",
                    "title": "Campo Foto",
                    "subtitle": "Imagen",
                    "widget_type": "IMAGE_FIELD"    // deprecado
                },
                {
                    "id": "FWxblfGvY",
                    "title": "Campo Fotos",
                    "subtitle": "Subtitulo",
                    "widget_type": "MULTIPLE_IMAGES_FIELD"
                },                
                {
                    "id": "FWTcXUki9",
                    "title": "Seccion Nueva",
                    "subtitle": "Subtitulo",
                    "widget_type": "NEW_SECTION"
                },
                {
                    "id": "FWdWBC1FT",
                    "title": "Firma",
                    "subtitle": "firma digital",
                    "widget_type": "SIGNATURE_FIELD"    // deprecado
                },
                {
                    "id": "FWGez6FvL",
                    "title": "Firmas Digitales",
                    "subtitle": "Firma y aclaración",
                    "widget_type": "SIGNATURES_FIELD_V2"
                },                
                {
                    "id": "FWOIrekYj",
                    "title": "Etiqueta",
                    "subtitle": "Seleccione alguna opcion",
                    "widget_type": "LABEL_FIELD",
                    "description": {
                        "options": [
                            {
                                "color": "RED",
                                "option_name": "Etiqueta 1"
                            },
                            {
                                "color": "ORANGE",
                                "option_name": "Etiqueta 2"
                            },
                            {
                                "color": "YELLOW",
                                "option_name": "Etiqueta 3"
                            }
                        ]
                    }
                },
                {
                    "id": "FWAHpt7u9",
                    "title": "Tabla Master Db",
                    "subtitle": "Complete los datos solicitados",
                    "widget_type": "MASTER_DB_TABLE",
                    "description": {
                        "mdb_id": 133,
                        "main_field": 1,
                        "show_fields": [],
                        "cols": [
                            {
                                "col_id": "USER_COL_zyNB1626881341371",
                                "name": "Cantidad",
                                "type": "NUMBER"
                            },
                            {
                                "col_id": "USER_COL_ZuDt1626881351792",
                                "name": "Descuento",
                                "type": "DROPDOWN"
                            },
                            {
                                "col_id": "USER_COL_ObtI1626881369567",
                                "name": "Observaciones",
                                "type": "TEXT"
                            },
                            {
                                "col_id": "USER_COL_tvse1626881378692",
                                "name": "sub Total",
                                "type": "CALCULATED"
                            }
                        ],
                        "total_fields": [
                            {
                                "total_field_id": "USER_TOTAL_YNLS1626881473036",
                                "name": "Descuento magico",
                                "type": "DROPDOWN"
                            },
                            {
                                "total_field_id": "USER_TOTAL_jltS1626881482952",
                                "name": "Total",
                                "type": "NUMBER"
                            }
                        ]
                    }
                },
                {
                    "id": "FW_FINAL_STATE",
                    "title": "Estado final de la entrega",
                    "subtitle": "Seleccione una de las opciones disponibles",
                    "widget_type": "DELIVERY_FINAL_STATE_WIDGET"
                }
            ]
        }
    }
}

schema_group: identificador del grupo al que pertenece el Tipo de Entrega. Cada vez que se crea una nueva versión, el shema_id del tipo de entrega cambia, pero el schema_group es el mismo.

Entonces la Entrega de tipo "Entrega de Tienda Nube" tiene un schema_group único, pero cada una de sus versiones tiene un schema_id diferente.

schema_id: Identificador unico del tipo de Entrega. Es único por versión.

production: Boolean indicando si este tipo de Entrega está en producción (publicada)

version: Número indicando la versión del Tipo de Entrega

draft: Boolean indicando si es un tipo de Entrega que está en borrador y todavia no fue publicada.

name: Nombre del tipo de Entrega

default_service_time: Number. Tiempo de servicio por default

default_due_days: Number. Días de vencimiento por default. Luego de "default_due_days" la entrega estará vencida.

labels_ids: Array de numbers, identificando etiquetas previamente creadas en Persat. Las nuevas entregas tendrán estas etiquetas por defecto apenas son creadas.

Es una "referencia débil", es decir que puede que no existan a la hora de hacer la consulta, debido a que el usuario administrador de Persat las sacó del sistema, o las modificó por otras.

instructions_description: Objeto JSON que describe el formulario de indicaciones para el trabajo

instructions_description.widgets: Array de objetos JSON, en donde cada item es un widget del formulario de indicacones para la entrega. Para ver los widgets disponibles puede acceder aqui Tipos de Widgets

Todos los widgets tienen la siguiente estructura

  • id: Obligatorio. Identificador del widget

  • title: Obligatorio. Titulo del widget

  • subtitle: Obligatorio. Subtitulo del widget. Puede contener texto vacio ""

  • widget_type: Obligatorio. String identificando el tipo de widget. Ver Tipos de Widgets

  • description: Opcional. Solo se utiliza para los widgets mas complejos: SIMPLE_SELECTION, DROPDOWN_SELECTION, MULTIPLE_SELECTION, LABEL_FIELD, POWER_TABLE_FIELD, CLIENT_OBJECT_DROPDOWN, CLIENT_OBJ_TABLE y MASTER_DB_TABLE.

results_description: Objeto JSON que describe el formulario que completó el chofer indicando que pasó con la entrega.

results_description.widgets: Array de objetos JSON al igual que "instructions_description.widgets"

Last updated