I just noticed the allFailureReasons field for uploaded documents, which has been added since we first implemented document upload approval handling. Documentation states:
Contained in the response will be a failureReason field which corresponds to one or more of the following values. In case of a failure due to multiple reasons, an additional allFailureReasons of reasons and descriptions is also returned
This almost sounds to me like the field will only be available when there are multiple failure/rejection reasons, and I need to still rely on the singular failureReason field if there is only one reject reason.
Is that the case, or can I replace our existing failureReason references to use allFailureReasons in all cases?
edit: Testing this empirically, allFailureReasons does seem to be populated even for a single failure reason. It would still be nice to know if this is official behavior though, and not something that could be retracted/“fixed” later to align with documentation.
Yes, the allFailureReasons JSON object will be present for any number of failures. It just looks like we’d need to update our documentation with the same. Thanks for bringing this up!
To provide more color, we introduced the allFailureReasons object to populate alongside failureReason to not introduce a breaking change. You can definitely replace your existing failureReason references to use allFailureReasons in all cases!
I take it this data wasn’t backfilled? Or at least not in the sandbox? As I tested a failed document from ~1 year ago and there’s a failureReason but allFailureReasons is empty
Document ID is 439642d5-dc29-4e84-bddd-6d06b42d5fab in the sandbox