How to stop getting back AutoResponded code for an Envelope - java

I know the fact that in case of an invalid email address DocuSign sends back AutoResponded as an envelope status. So, whenever I get back AutoResponded some of my services break. Is there a way to turn this feature off of my DocuSign account?
In simple words just ignore if an status is AutoResponded.
Thanks

You can exclude the AutoResponded recipientEventStatusCode from the eventNotification.
Here is a sample CreateEnvelope request which includes all eventNotifications. You can remove the events that you do not want to receive.
{
"eventNotification": {
"url": "[Callback Url]",
"loggingEnabled": "true",
"requireAcknowledgment": "true",
"envelopeEvents": [
{ "envelopeEventStatusCode": "Delivered" },
{ "envelopeEventStatusCode": "Completed" },
{ "envelopeEventStatusCode": "Declined" },
{ "envelopeEventStatusCode": "Voided" },
{ "envelopeEventStatusCode": "Sent" }
],
"recipientEvents": [
{ "recipientEventStatusCode": "Sent" },
{ "recipientEventStatusCode": "Delivered" },
{ "recipientEventStatusCode": "Completed" },
{ "recipientEventStatusCode": "Declined" },
{ "recipientEventStatusCode": "AuthenticationFailed" },
{ "recipientEventStatusCode": "AutoResponded" }
],
},
"recipients": {
"signers": [
{
"name": "john smith",
"email": "johnsmith#foo.com",
"recipientId": "1",
"routingOrder": "1"
}
]
},
"documents": [
{
"documentId": "1",
"name": "Agreement ",
"fileExtension": "pdf",
"documentBase64": "[Document Bytes]"
}
],
"status": "sent",
"emailSubject": "Envelope for auto responded status"
}

Related

How to form post request body where resource contained multi reference resources from Java to FHIR api

I have to send request body as org.hl7.fhir.r4.model.CoverageEligibilityRequest which is contained Patient, Practitioner, Organization as below. This API will return Bundle response. I am using Java and Generic client from Hapi Fire library. There is provision to pass search parameter but the here I am having multilevel hierarchy of resource and input is big than usual. Can any one help me to handle this request in FHIR API.
Request Body as below,
{
"resourceType": "CoverageEligibilityRequest",
"contained": [
{
"resourceType": "Patient",
"id": "1",
"name": [
{
"family": "abcFamily",
"given": [
"abcGiven"
]
}
],
"birthDate": "1962-08-06"
},
{
"resourceType": "Practitioner",
"id": "2",
"identifier": [
{
"type": {
"coding": [
{
"code": "NPI"
}
]
},
"value": "123456789"
}
],
"name": [
{
"family": "pqrFamily",
"given": [
"pqrGiven"
]
}
]
},
{
"resourceType": "Organization",
"id": "3",
"identifier": [
{
"value": "12345"
}
],
"name": ""
},
{
"resourceType": "Coverage",
"id": "3",
"status": "active",
"subscriberId": "",
"class": [
{
"type": {
"coding": [
{
"code": "group"
}
]
},
"value": ""
}
]
}
],
"extension": [
{
"url": "searchOption",
"valueString": "NameDateOfBirth"
}
],
"status": "active",
"purpose": [
"benefits"
],
"patient": {
"reference": "#1"
},
"provider": {
"reference": "#2"
},
"insurer": {
"reference": "#3"
}
}

Apache Velocity: remove key/value from json

I have a JSON
{
"Id": "xxx",
"Type": "Transaction.Create",
"Payload": {
"result": 2,
"description": "Pending",
"body": {
"redirect": {
"url": "xxx",
"fields": {
"MD": "8a829449620619e80162252adeb66a39"
}
},
"card": {
"expiryMonth": "1",
"expiryYear": "2033"
},
"order": {
"amount": 1
}
}
}
}
And I want to remove the card info of it like this:
{
"Id": "xxx",
"Type": "Transaction.Create",
"Payload": {
"result": 2,
"description": "Pending",
"body": {
"redirect": {
"url": "xxx",
"fields": {
"MD": "8a829449620619e80162252adeb66a39"
}
},
"order": {
"amount": 1
}
}
}
}
How can I do this with Apache velocity?
What works is:
#set($content = $util.urlEncode($input.json('$')))
#set($new = $content.replaceAll("2033","2055"))
Action=SendMessage&MessageBody={"body": "$new","Event-Signature": "$util.urlEncode($input.params('Event-Signature'))"}
This gives me
{
"Id": "xxx",
"Type": "Transaction.Create",
"Payload": {
"result": 2,
"description": "Pending",
"body": {
"redirect": {
"url": "xxx",
"fields": {
"MD": "8a829449620619e80162252adeb66a39"
}
},
"card": {
"expiryMonth": "1",
"expiryYear": "2050"
},
"order": {
"amount": 1
}
}
}
}
But now I want to remove the card part but it does not work:
#set($content = $util.urlEncode($input.json('$')))
#set($new = $content.delete("$.Payload.body.card"))
Action=SendMessage&MessageBody={"body": "$new","Event-Signature": "$util.urlEncode($input.params('Event-Signature'))"}
what am I doing wrong?
Main goal is transform a mapping template in API Gateway for a webhook. The webhook contains to many information and we want to remove some part of the JSON POST call.
Try using the below
#set($dummy=$content.Payload.remove("card"))

Pojo/Entity corresponding to json response from Azure REST API

I have written a java class which hits the Azure REST API's and gets me the json response. for example below-
{
"value": [
{
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"kind": "Storage",
"id": "/subscriptions/cc60365e-3193-xxxx-b0f6-xxxxxxx/resourceGroups/WebServer-ubuntu/providers/Microsoft.Storage/storageAccounts/webserverubuntudiagxxx",
"name": "webserverubuntudiag4xx",
"type": "Microsoft.Storage/storageAccounts",
"location": "eastus",
"tags": {},
"properties": {
"networkAcls": {
"bypass": "AzureServices",
"virtualNetworkRules": [],
"ipRules": [],
"defaultAction": "Allow"
},
"trustedDirectories": [
"50228742-xxx-4cd2-xxx-3e50b7a62xx1"
],
"supportsHttpsTrafficOnly": false,
"encryption": {
"services": {
"file": {
"enabled": true,
"lastEnabledTime": "2018-03-26T15:02:26.8078850Z"
},
"blob": {
"enabled": true,
"lastEnabledTime": "2018-03-26T15:02:26.8078850Z"
}
},
"keySource": "Microsoft.Storage"
},
"provisioningState": "Succeeded",
"creationTime": "2018-03-26T15:02:26.6359768Z",
"primaryEndpoints": {
"blob": "https://webserverubuntudiagxx.blob.core.windows.net/",
"queue": "https://webserverubuntudiag4xx.queue.core.windows.net/",
"table": "https://webserverubuntudiagxx.table.core.windows.net/",
"file": "https://webserverubuntudiag4xx.file.core.windows.net/"
},
"primaryLocation": "eastus",
"statusOfPrimary": "available"
}
}
]
}
My questions is: Are there any model/pojo/bean already available to map this json to java object ?
I need to map the data from above json into the java beans/pojos to display into jsp pages, do I need to separately create custom pojos or there are any already in Azure libraries/sdk ? any suggestions?

How to parse a DiagnosticReport from a JSON and print the same JSON again?

I'm parsing a DiagnosticReport from a JSON file and It works fine, but when I try to print the same JSON file throught IParser encode function, the JSON is different to the original. I need to print the same JSON.
Original JSON (String json)
{
"resourceType": "DiagnosticReport",
"text": {
"status": "generated",
"div": "<div><p><b>Narrative A</b></p></div>"
},
"contained": [
{
"resourceType": "Patient",
"id": "1"
},
{
"resourceType": "Observation",
"id": "2",
"meta": {
"lastUpdated": "2017-03-22T22:00:28.089-05:00"
},
"text": {
"div": "<div><p><b>Narrative B</b></p></div>"
},
"comment": "a comment"
}
],
"status": "appended",
"code": {
"coding": [
{
"code": "Report01"
}
]
},
"subject": {
"reference": "#1"
},
"effectiveDateTime": "2017-03-22T22:00:28-05:00",
"issued": "2017-03-22T22:00:28.070-05:00",
"result": [
{
"reference": "#2"
}
]
}
First step is parse and the second step is encode and print
DiagnosticReport report = parser.parseResource(DiagnosticReport.class, json);
String encodeJSON = parser.encodeResourceToString(report);
System.out.println(encodeJSON);
And the result is different because the text tag in the Observation is not showed
{
"resourceType": "DiagnosticReport",
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Narrative A</b></p></div>"
},
"contained": [
{
"resourceType": "Patient",
"id": "1"
},
{
"resourceType": "Observation",
"id": "2",
"meta": {
"lastUpdated": "2017-03-22T22:00:28.089-05:00"
},
"comment": "a comment"
}
],
"status": "appended",
"code": {
"coding": [
{
"code": "Report01"
}
]
},
"subject": {
"reference": "#1"
},
"effectiveDateTime": "2017-03-22T22:00:28-05:00",
"issued": "2017-03-22T22:00:28.070-05:00",
"result": [
{
"reference": "#2"
}
]
}
I'm trying this because I have a DiagnosticReport generated by my software and I need print it completely in a JSON file.
Thanks for your help!!
It's not legal to have narrative in a contained resource, nor is it legal to have meta/lastUpdated. There are invariants that prohibit both. Ideally, the parsing software should have thrown an exception, but it's not overly surprising that the serializer has trouble serializing content that's not supposed to be there.
Look at dom-1 and dom-4 in dstu3 or dstu2

How can I tell if a build is in progress when I call the Jenkins json api?

I'm calling a url like this: /job/My-Job/710/api/json and it's returning some json like this:
{
"actions": [
{
"parameters": [
{
"name": "DEPLOY_HOST",
"value": ""
}
]
},
{
"causes": [
{
"shortDescription": "Started by user Hudson Admin",
"userId": "username",
"userName": "Hudson Admin"
}
]
},
{},
{},
{}
],
"artifacts": [],
"building": true,
"description": null,
"duration": 0,
"estimatedDuration": 390011,
"executor": {},
"fullDisplayName": "My-App #711",
"id": "2013-08-30_12-50-14",
"keepLog": false,
"number": 711,
"result": "SUCCESS",
"timestamp": 1377892214231,
"url": "http://hudsonurl:8081/job/My-App/711/",
"builtOn": "",
"changeSet": {
"items": [
{}
],
"kind": "svn",
"revisions": [
{
"module": "https://oursvn",
"revision": 27498
}
]
},
"culprits": [
{
"absoluteUrl": "http://hudsonsurl:8081/user/handsomeg",
"fullName": "handsome guy"
}
],
"mavenArtifacts": null,
"mavenVersionUsed": "3.0.4"
}
This build is actually in progress right now, but I can't see a way to know that. You'd think that the value of result should be in progress, but it's not. Is this a bug, or is there some other way to check? I'm using Jersey version 1.523
I just noticed there's a "building": true.
Makes me wonder what result is for. Maybe builds are considered SUCCESS until proven otherwise.

Categories