Digito

Actualizar campos

Actualiza varios campos de un sobre.

POST /envelope/field/update-many

URL base: https://business.digito.do/api/v2.

Ejemplos

Configura DIGITO_API_TOKEN en el servidor. Sustituye los IDs y archivos de ejemplo por los de tu equipo. TypeScript usa fetch y FormData de Node.js.

curl --fail-with-body \
  --request POST \
  --url 'https://business.digito.do/api/v2/envelope/field/update-many' \
  --header "Authorization: $DIGITO_API_TOKEN" \
  --header 'Content-Type: application/json' \
  --data-binary @- <<'JSON'
{
  "envelopeId": "sobre_de_ejemplo",
  "data": [
    {
      "id": 701,
      "type": "SIGNATURE",
      "envelopeItemId": "archivo_de_ejemplo",
      "positionX": 55,
      "positionY": 75,
      "width": 30,
      "height": 8
    }
  ]
}
JSON

Antes de empezar

  • Las variantes de fieldMeta corresponden a cada tipo de campo; no intercambies estructuras entre variantes.

Autenticación

Envía el token de la API en el encabezado Authorization. El acceso corresponde al equipo y a los permisos del token. Conserva el token en tu servidor.

Authorization: api_TU_TOKEN

Antes de cada acción de firma, el firmante debe autenticarse de nuevo con Digito ID. Una sesión previa de Business, un token de destinatario o un token de la API no sustituye este requisito.

Parámetros

Esta operación no declara parámetros de ruta ni de consulta.

Cuerpo de la solicitud

El cuerpo es obligatorio.

Tipo de contenido: application/json.

Objeto de ejemplo

{
  "envelopeId": "sobre_de_ejemplo",
  "data": [
    {
      "id": 701,
      "type": "SIGNATURE",
      "envelopeItemId": "archivo_de_ejemplo",
      "positionX": 55,
      "positionY": 75,
      "width": 30,
      "height": 8
    }
  ]
}

Los valores muestran una solicitud posible; no son valores predeterminados del servidor.

PropiedadTipoObligatoriaRestricciones
envelopeIdstringSíSin restricciones adicionales en este nivel.
dataarray de combinación (allOf)SíSin restricciones adicionales en este nivel.
Ver el esquema completo de la solicitud
{
  "type": "object",
  "properties": {
    "envelopeId": {
      "type": "string"
    },
    "data": {
      "type": "array",
      "items": {
        "allOf": [
          {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "SIGNATURE"
                    ]
                  },
                  "fieldMeta": {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string"
                      },
                      "placeholder": {
                        "type": "string"
                      },
                      "required": {
                        "type": "boolean"
                      },
                      "readOnly": {
                        "type": "boolean"
                      },
                      "fontSize": {
                        "type": "number",
                        "minimum": 8,
                        "maximum": 96,
                        "default": 12
                      },
                      "overflow": {
                        "type": "string",
                        "enum": [
                          "auto",
                          "horizontal",
                          "vertical",
                          "crop"
                        ],
                        "default": "auto"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "signature"
                        ]
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "default": {
                      "type": "signature",
                      "fontSize": 18,
                      "overflow": "auto"
                    }
                  }
                },
                "required": [
                  "type"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "FREE_SIGNATURE"
                    ]
                  }
                },
                "required": [
                  "type"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "INITIALS"
                    ]
                  },
                  "fieldMeta": {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string"
                      },
                      "placeholder": {
                        "type": "string"
                      },
                      "required": {
                        "type": "boolean"
                      },
                      "readOnly": {
                        "type": "boolean"
                      },
                      "fontSize": {
                        "type": "number",
                        "minimum": 8,
                        "maximum": 96,
                        "default": 12
                      },
                      "overflow": {
                        "type": "string",
                        "enum": [
                          "auto",
                          "horizontal",
                          "vertical",
                          "crop"
                        ]
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "initials"
                        ]
                      },
                      "textAlign": {
                        "type": "string",
                        "enum": [
                          "left",
                          "center",
                          "right"
                        ]
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "default": {
                      "type": "initials",
                      "fontSize": 12,
                      "textAlign": "left"
                    }
                  }
                },
                "required": [
                  "type"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "NAME"
                    ]
                  },
                  "fieldMeta": {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string"
                      },
                      "placeholder": {
                        "type": "string"
                      },
                      "required": {
                        "type": "boolean"
                      },
                      "readOnly": {
                        "type": "boolean"
                      },
                      "fontSize": {
                        "type": "number",
                        "minimum": 8,
                        "maximum": 96,
                        "default": 12
                      },
                      "overflow": {
                        "type": "string",
                        "enum": [
                          "auto",
                          "horizontal",
                          "vertical",
                          "crop"
                        ]
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "name"
                        ]
                      },
                      "textAlign": {
                        "type": "string",
                        "enum": [
                          "left",
                          "center",
                          "right"
                        ]
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "default": {
                      "type": "name",
                      "fontSize": 12,
                      "textAlign": "left"
                    }
                  }
                },
                "required": [
                  "type"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "EMAIL"
                    ]
                  },
                  "fieldMeta": {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string"
                      },
                      "placeholder": {
                        "type": "string"
                      },
                      "required": {
                        "type": "boolean"
                      },
                      "readOnly": {
                        "type": "boolean"
                      },
                      "fontSize": {
                        "type": "number",
                        "minimum": 8,
                        "maximum": 96,
                        "default": 12
                      },
                      "overflow": {
                        "type": "string",
                        "enum": [
                          "auto",
                          "horizontal",
                          "vertical",
                          "crop"
                        ],
                        "default": "auto"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "email"
                        ]
                      },
                      "textAlign": {
                        "type": "string",
                        "enum": [
                          "left",
                          "center",
                          "right"
                        ]
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "default": {
                      "type": "email",
                      "fontSize": 12,
                      "textAlign": "left",
                      "overflow": "auto"
                    }
                  }
                },
                "required": [
                  "type"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "DATE"
                    ]
                  },
                  "fieldMeta": {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string"
                      },
                      "placeholder": {
                        "type": "string"
                      },
                      "required": {
                        "type": "boolean"
                      },
                      "readOnly": {
                        "type": "boolean"
                      },
                      "fontSize": {
                        "type": "number",
                        "minimum": 8,
                        "maximum": 96,
                        "default": 12
                      },
                      "overflow": {
                        "type": "string",
                        "enum": [
                          "auto",
                          "horizontal",
                          "vertical",
                          "crop"
                        ],
                        "default": "auto"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "date"
                        ]
                      },
                      "textAlign": {
                        "type": "string",
                        "enum": [
                          "left",
                          "center",
                          "right"
                        ]
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "default": {
                      "type": "date",
                      "fontSize": 12,
                      "textAlign": "left",
                      "overflow": "auto"
                    }
                  }
                },
                "required": [
                  "type"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "TEXT"
                    ]
                  },
                  "fieldMeta": {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string"
                      },
                      "placeholder": {
                        "type": "string"
                      },
                      "required": {
                        "type": "boolean"
                      },
                      "readOnly": {
                        "type": "boolean"
                      },
                      "fontSize": {
                        "type": "number",
                        "minimum": 8,
                        "maximum": 96,
                        "default": 12
                      },
                      "overflow": {
                        "type": "string",
                        "enum": [
                          "auto",
                          "horizontal",
                          "vertical",
                          "crop"
                        ]
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "text"
                        ]
                      },
                      "text": {
                        "type": "string"
                      },
                      "characterLimit": {
                        "type": "number",
                        "minimum": 0
                      },
                      "textAlign": {
                        "type": "string",
                        "enum": [
                          "left",
                          "center",
                          "right"
                        ]
                      },
                      "lineHeight": {
                        "type": "number",
                        "nullable": true,
                        "minimum": 1,
                        "maximum": 10
                      },
                      "letterSpacing": {
                        "type": "number",
                        "nullable": true,
                        "minimum": 0,
                        "maximum": 100
                      },
                      "verticalAlign": {
                        "type": "string",
                        "nullable": true,
                        "enum": [
                          "top",
                          "middle",
                          "bottom",
                          null
                        ]
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "default": {
                      "type": "text",
                      "fontSize": 12,
                      "textAlign": "left",
                      "label": "",
                      "placeholder": "",
                      "text": "",
                      "required": false,
                      "readOnly": false
                    }
                  }
                },
                "required": [
                  "type"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "NUMBER"
                    ]
                  },
                  "fieldMeta": {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string"
                      },
                      "placeholder": {
                        "type": "string"
                      },
                      "required": {
                        "type": "boolean"
                      },
                      "readOnly": {
                        "type": "boolean"
                      },
                      "fontSize": {
                        "type": "number",
                        "minimum": 8,
                        "maximum": 96,
                        "default": 12
                      },
                      "overflow": {
                        "type": "string",
                        "enum": [
                          "auto",
                          "horizontal",
                          "vertical",
                          "crop"
                        ]
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "number"
                        ]
                      },
                      "numberFormat": {
                        "type": "string",
                        "nullable": true
                      },
                      "value": {
                        "type": "string"
                      },
                      "minValue": {
                        "type": "number",
                        "nullable": true
                      },
                      "maxValue": {
                        "type": "number",
                        "nullable": true
                      },
                      "textAlign": {
                        "type": "string",
                        "enum": [
                          "left",
                          "center",
                          "right"
                        ]
                      },
                      "lineHeight": {
                        "type": "number",
                        "nullable": true,
                        "minimum": 1,
                        "maximum": 10
                      },
                      "letterSpacing": {
                        "type": "number",
                        "nullable": true,
                        "minimum": 0,
                        "maximum": 100
                      },
                      "verticalAlign": {
                        "type": "string",
                        "nullable": true,
                        "enum": [
                          "top",
                          "middle",
                          "bottom",
                          null
                        ]
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "default": {
                      "type": "number",
                      "fontSize": 12,
                      "textAlign": "left",
                      "label": "",
                      "placeholder": "",
                      "required": false,
                      "readOnly": false
                    }
                  }
                },
                "required": [
                  "type"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "RADIO"
                    ]
                  },
                  "fieldMeta": {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string"
                      },
                      "placeholder": {
                        "type": "string"
                      },
                      "required": {
                        "type": "boolean"
                      },
                      "readOnly": {
                        "type": "boolean"
                      },
                      "fontSize": {
                        "type": "number",
                        "minimum": 8,
                        "maximum": 96,
                        "default": 12
                      },
                      "overflow": {
                        "type": "string",
                        "enum": [
                          "auto",
                          "horizontal",
                          "vertical",
                          "crop"
                        ]
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "radio"
                        ]
                      },
                      "values": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "number"
                            },
                            "checked": {
                              "type": "boolean"
                            },
                            "value": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "checked",
                            "value"
                          ]
                        }
                      },
                      "direction": {
                        "type": "string",
                        "enum": [
                          "vertical",
                          "horizontal"
                        ],
                        "default": "vertical"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "default": {
                      "type": "radio",
                      "fontSize": 12,
                      "values": [
                        {
                          "id": 1,
                          "checked": false,
                          "value": ""
                        }
                      ],
                      "required": false,
                      "readOnly": false,
                      "direction": "vertical"
                    }
                  }
                },
                "required": [
                  "type"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "CHECKBOX"
                    ]
                  },
                  "fieldMeta": {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string"
                      },
                      "placeholder": {
                        "type": "string"
                      },
                      "required": {
                        "type": "boolean"
                      },
                      "readOnly": {
                        "type": "boolean"
                      },
                      "fontSize": {
                        "type": "number",
                        "minimum": 8,
                        "maximum": 96,
                        "default": 12
                      },
                      "overflow": {
                        "type": "string",
                        "enum": [
                          "auto",
                          "horizontal",
                          "vertical",
                          "crop"
                        ]
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "checkbox"
                        ]
                      },
                      "values": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "number"
                            },
                            "checked": {
                              "type": "boolean"
                            },
                            "value": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "checked",
                            "value"
                          ]
                        }
                      },
                      "validationRule": {
                        "type": "string"
                      },
                      "validationLength": {
                        "type": "number"
                      },
                      "direction": {
                        "type": "string",
                        "enum": [
                          "vertical",
                          "horizontal"
                        ],
                        "default": "vertical"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "default": {
                      "type": "checkbox",
                      "fontSize": 12,
                      "values": [
                        {
                          "id": 1,
                          "checked": false,
                          "value": ""
                        }
                      ],
                      "validationRule": "",
                      "validationLength": 0,
                      "required": false,
                      "readOnly": false,
                      "direction": "vertical"
                    }
                  }
                },
                "required": [
                  "type"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "DROPDOWN"
                    ]
                  },
                  "fieldMeta": {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string"
                      },
                      "placeholder": {
                        "type": "string"
                      },
                      "required": {
                        "type": "boolean"
                      },
                      "readOnly": {
                        "type": "boolean"
                      },
                      "fontSize": {
                        "type": "number",
                        "minimum": 8,
                        "maximum": 96,
                        "default": 12
                      },
                      "overflow": {
                        "type": "string",
                        "enum": [
                          "auto",
                          "horizontal",
                          "vertical",
                          "crop"
                        ]
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "dropdown"
                        ]
                      },
                      "values": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "value": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "value"
                          ]
                        }
                      },
                      "defaultValue": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "default": {
                      "type": "dropdown",
                      "fontSize": 12,
                      "values": [
                        {
                          "value": "Option 1"
                        }
                      ],
                      "defaultValue": "",
                      "required": false,
                      "readOnly": false
                    }
                  }
                },
                "required": [
                  "type"
                ]
              }
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "number"
              },
              "envelopeItemId": {
                "type": "string"
              }
            },
            "required": [
              "id"
            ]
          },
          {
            "type": "object",
            "properties": {
              "page": {
                "type": "number",
                "minimum": 1
              },
              "positionX": {
                "type": "number",
                "minimum": 0,
                "maximum": 100
              },
              "positionY": {
                "type": "number",
                "minimum": 0,
                "maximum": 100
              },
              "width": {
                "type": "number",
                "minimum": 0,
                "maximum": 100
              },
              "height": {
                "type": "number",
                "minimum": 0,
                "maximum": 100
              }
            }
          }
        ]
      }
    }
  },
  "required": [
    "envelopeId",
    "data"
  ]
}

Respuesta de éxito

En esta respuesta, el contrato deja positionX, positionY, width y height sin un tipo explícito. Los números del ejemplo son valores sintéticos; conserva la representación que devuelve la API y no deduzcas un tipo de respuesta a partir del ejemplo.

Este objeto sintético ilustra la estructura completa de una respuesta 200. Los identificadores, fechas, estados y tokens son datos de ejemplo.

{
  "data": [
    {
      "envelopeId": "sobre_de_ejemplo",
      "envelopeItemId": "archivo_de_ejemplo",
      "type": "SIGNATURE",
      "id": 701,
      "secondaryId": "field_secundario_de_ejemplo",
      "recipientId": 501,
      "page": 1,
      "positionX": 55,
      "positionY": 75,
      "width": 30,
      "height": 8,
      "customText": "valor_de_ejemplo",
      "inserted": false,
      "fieldMeta": null
    }
  ]
}

Respuestas y errores

EstadoDescripciónContenido y esquema
200Respuesta correcta.application/json
400Datos de entrada inválidos.application/json
401No se proporcionó autorización.application/json
403Permisos insuficientes.application/json
500Error interno del servidor.application/json

Los esquemas enlazados incluyen propiedades anidadas, campos obligatorios, variantes, enumeraciones, nulabilidad y restricciones. Consulta errores y reintentos para manejar respuestas no exitosas.

Identificador de operación: envelope-field-updateMany.