Hello
How can I get the information of this json to put in different fields so I can use them in business process.
{"signer_data":{"name":"laura@artica.digital","authority":"Vinculada a Correo Electrónico por Liga","id":1655735,"email":"laura@artica.digital","fingerprint":"66bf3e0a67ba87d5aeae33e5e98db771968aae83","box_id":"wxjXMgLPz","box_data":"laura@artica.digital","signature_date":"2024-12-19T19:31:59Z"},"signer_email":"laura@artica.digital","signer_fingerprint":"66bf3e0a67ba87d5aeae33e5e98db771968aae83","signer":1655735,"user":233645,"notification_type":"original_signed","notification_id":"3639332","first_notification_date":"2024-12-19T19:32:03Z","document_title":"INFONAVIT. PM005690004564500002NUEVA ASIGNACION SIN BORRADO (1).pdf","firmamex_id":"af8b17ab-9dc0-4130-8f6e-65e24134e596","text":"Document af8b17ab-9dc0-4130-8f6e-65e24134e596.pdf just signed"}
i get this json for a webhook.
Like
Hello!
Currently, to parse values from webhook via business process you would need to use a custom script task element. Also, you can read more information on how to process webhooks here.
Basically in this community thread is already was provided an answer - https://community.creatio.com/questions/parsing-webhooks
Hello
Thank you, I manage to pass the json to the parameters using the next example https://community.creatio.com/questions/help-parse-json-i-get-webservice-variables-can-after-introduce-creatio-object
but i get an error in the process
Newtonsoft.Json.JsonSerializationException: Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Collections.Generic.List`1[Terrasoft.Configuration.UsrForCustomObject.Meta]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly. To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List<T>) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object. Path 'meta.signer', line 1, position 18. at Terrasoft.Common.Json.Json.Deserialize[T](String value, Func`2 func) at Terrasoft.Core.Process.UsrProcess_e6a76c0MethodsWrapper.PerformJsonDeserialize() at Terrasoft.Core.Process.UsrProcess_e6a76c0MethodsWrapper.ScriptTask1Execute(ProcessExecutingContext context) at Terrasoft.Core.Process.ProcessScriptTask.InternalExecute(ProcessExecutingContext context) at Terrasoft.Core.Process.ProcessFlowElement.CallInternalExecute(ProcessExecutingContext context) at Terrasoft.Core.Process.ProcessFlowElement.ExecuteItem(ProcessExecutingContext context) at Terrasoft.Core.Process.ProcessFlowElement.Execute(ProcessExecutingContext context)
The method that I use is this one
public void PerformJsonDeserialize() { var passedValue = Get<string>("PassedJSONString"); if (!String.IsNullOrEmpty(passedValue)) { UsrForCustomObject testCustObj =Json.Deserialize<UsrForCustomObject>(passedValue); Set<string>("Parsedname", testCustObj.name); Set<string>("Parsedauthority", testCustObj.authority); Set<string>("Parsedsigner", testCustObj.meta[0].signer); Set<string>("Parsedreason", testCustObj.meta[0].reason); Set<string>("Parsednotification_type", testCustObj.notification_type); } } return true;
Can you help me know what is the problem? I think is related with this part UsrForCustomObject testCustObj =Json.Deserialize<UsrForCustomObject>(passedValue) but I already try changing that to
DeserializeDictionary(String) or Deserialize<T>(String, JsonSerializerSettings)
and i still have the error
thank you