Is it possible to change verbiage of listAuditEvents?

时间:2018-09-18 20:01:16

标签: docusignapi

The current [Envelopes: listAuditEvents] creates the following verbiage for correction: "eventFields": [ { "name": "logTime", "value": "2018-09-18T19:09:01.3603686Z" }, { "name": "Source", "value": "api" }, { "name": "UserName", "value": "Staging" }, { "name": "UserId", "value": "8c57af14-e46a-4965-ae8b-42bb0c29b706" }, { "name": "Action", "value": "Correction Initiated" }, { "name": "Message", "value": "Staging initiated correction" }, { "name": "EnvelopeStatus", "value": "correct" }, I would like to modify the Message values. I have gone through Docusigns API but I have not found any indication that this is possible.

Has anyone had the same need? and if so were you able to add custom message verbiage for certain events/actions?

Thanks.

1 个答案:

答案 0 :(得分:2)

您无法为 listAuditEvents 操作配置API响应的内容。但是,您可以(在您的代码中)包含用于解析API响应的逻辑,并基于响应中的某些值,用您喜欢的语言替换值(出于您应用中的目的)。

例如,假设您的应用程序中有一个页面,该页面显示信封发生的各种事件,但是您不想在您的文本中显示“ [UserName]发起的更正”字样用户启动信封改正时的UI-而是要显示文本“ [[用户名]已更改信封设置”。您代码中的逻辑可以执行以下伪代码所示的操作(其中auditEvent代表 listAuditEvents 操作的API响应主体中的对象):

if (auditEvent.ActionInitiated == "Correction Initiated") {
   displayMessageInUI(auditEvent.UserName + " changed envelope settings.");
}