Docusign add voidedReason to callback XML? - api

I'm using the Docusign REST Api and in the create envelope request I am requesting event notifications for "voided" see below. The callback occurs, but the voidedReason is not present in the XML, so to fetch voidedReason I have to make a separate API call to get the status of the envelope as suggested in: DocuSign - getting void envelope reason.
Is there some reason (no pun intended) that voidedReason is not included in the webhook callback XML for docusignenvelopeinformation.envelopestatus? It seems inconsistent in tha declinereason is provided in the receipientstatuses.recipientstatus object. Would be nice to not have to make the additional API call.
eventNotification: {
url: docusignCallbackUrl,
loggingEnabled: "true",
includeDocumentFields: "true",
requireAcknowledgment: "true",
envelopeEvents: [
{envelopeEventStatusCode: "completed"},
{envelopeEventStatusCode: "declined"},
{envelopeEventStatusCode: "voided"},
],
recipientEvents: [
{recipientEventStatusCode: "Completed"},
],
}

The DocuSign connect configuration offers a way to "Include Envelope Voided Reason" in the DocuSign connect XML payload/notification. This was added In October 2016 timeframe.

Add:
includeEnvelopeVoidReason: "true"
to your eventNotification.

Related

How to use a mail template ID when sending an email with admin api in shopware 6?

When sending an email via Shopware 6 admin api (https://shopware.stoplight.io/docs/admin-api/b3A6MTI2MjUzOTg-send-a-mail) i would like to pass only the mail template ID, and not the other information from the template (contentHtml, contentPlain, subject).
Do you know if this is possible ?
This endpoint was not implemented to fetch an existing mail_template entity by an id. You'll have to provide the mails content yourself.
Your best bet would be to send a request to the corresponding endpoint for mail templates, e.g. GET /api/mail-template/086f8adc94f14a618e3729d933befb8d, and retrieve the values for subject, contentHtml and contentPlain from the response. These will still be un-rendered Twig at that point. So there should be no problem in passing them with your POST /api/_action/mail-template/send request. Just remember that you have to provide the data for the variables used in the templates. It looks like this isn't documented, but you need to provide the data in the request body with the key mailTemplateData.
So as an example see this abbreviated request body:
{
"contentPlain": "Hello {{ user.firstName }}!", // retrieved by `/api/mail-template/:id`
"mailTemplateData": {
"user": {
"firstName": "Pete"
}
}
}

Zapier basic auth pass blank data

I have been trying to create an app in Zapier for one of my project. On the very first step, I am doing Authentication where I choose "Basic Auth" method. I have set API URL along with details, however cannot see the expected result and seeing error in my API return value. After debugging, I found that API doesn't get the value I pass thru the Zapier. I have checked the same API in postman and it works, however it only doesn't work thru the Zapier.
Below is even more detail how I proceed, what is expected result and what I am getting:
Process we're following
We have created an App
We went to Authentication step, there we have selected “Basic Auth” option
Under the Basic Auth, we have configure with setting end point and method is “Post”
We have set our field names as Key and as value we have set “{{bundle.authData.password}” and “{{bundle.authData.username}}” in order to field mapping
Then came to Step 2 to test the authentication
Under the “Test Setup”, we have connected the current Zapier account and clicked on “Test Authentication”
This process doesn’t post any value in parameters. Hope I could explain the issue, please help us to find where we’re going wrong.
Expected Result
{
"data": {
"first_name": "Dhaval",
"last_name": "Parekh",
"email_address": "dhaval.php#gmail.com",
"phone_no": "1234567890",
"user_id": "7oiA****",
"token_id": "zNkzT***"
},
"resend_verification_link": false,
"status": true,
"message": "You have successfully Logged in!!"
}
Actual Result
{
"resend_verification_link": false,
"status": false,
"message": "The password must contain a minimum of one lower case character. one upper case character, one digit"
}
What I understand after spending too much time, is it doesn't send the data with post method and hence I'm getting this issue. While it works fine with the Get Method. So, should I consider that Basic Auth will only with work with "Get" method in Zapier? Or I'm missing any piece to include here?
Please let me know what is missing? Or even I'm going thru the wrong root. I want to create an app in Zapier to allow other apps to connect.

Wit AI response for API requests

I'm using wit ai for a bot and I think it's amazing. However, I must provide the customer with screens in my web app to train and manage the app. And here I found a big problem (or maybe I'm just lost). The documentation of the REST API is not enough to design a client that acts like the wit console (not even close). it's like a tutorial of what endpoints you can hit and an overview of the parameters, but no clean explanation of the structure of the response.
For example, there is no endpoint to get the insights edge. Also and most importantly, no clear documentation about the response structure when hitting the message endpoints (i.e. the structure the returned entities: are they prebuilt or not, and if they are, is the value a string or an object or array, and what the object might contain [e.g. datetime]). Also the problem of the deprecated guide and the new guide (the new guide should be done and complete by now). I'm building parts of the code based on my testing. Sometimes when I test something new (like adding a range in the datetime entity instead of just a value), I get an error when I try to set the values to the user since I haven't parsed the response right, and the new info I get makes me modify the DB structure at my end sometimes.
So, the bottom line, is there a complete reference that I can implement a complete client in my web app (my web app is in Java by the way and I couldn't find a client library that handles the latest version of the API)? Again, the tool is AWESOME but the documentation is not enough, or maybe I'm missing something.
The document is not enough of course but I think its pretty straightforward. And from what I read there is response structure under "Return the meaning of a sentence".
It's response in JSON format. So you need to decode the response first.
Example Request:
$ curl -XGET 'https://api.wit.ai/message?v=20170307&q=how%20many%20people%20between%20Tuesday%20and%20Friday' \
-H 'Authorization: Bearer $TOKEN'
Example Response:
{
"msg_id": "387b8515-0c1d-42a9-aa80-e68b66b66c27",
"_text": "how many people between Tuesday and Friday",
"entities": {
"metric": [ {
"metadata": "{'code': 324}",
"value": "metric_visitor",
"confidence": 0.9231
} ],
"datetime": [ {
"value": {
"from": "2014-07-01T00:00:00.000-07:00",
"to": "2014-07-02T00:00:00.000-07:00"
},
"confidence": 1
}, {
"value": {
"from": "2014-07-04T00:00:00.000-07:00",
"to": "2014-07-05T00:00:00.000-07:00"
},
"confidence": 1
} ]
}
}
You can read more about response structure under Return the meaning of a sentence

How to get AWS API Gateway to validate JSON Body against Model

The newly released "x-amazon-apigateway-request-validator" (in April I believe) is supposed to be able to run a JSON schema validation against the POST/PUT payload of an API.
I've tried to implement this in several different ways now but I can't make it work...
I have added the validators:
"x-amazon-apigateway-request-validators": {
"ValidateBody": {
"validateRequestParameters": false,
"validateRequestBody": true
},
"ValidateHeaders": {
"validateRequestParameters": true,
"validateRequestBody": false
}
}
For any methind I will look for specific headers so I also have the parameters in the "root" of the Swagger:
"x-amazon-apigateway-request-validator": "ValidateHeaders"
In the POST I have a x-amazon-apigateway-request-validator: ValidateBody and then a Model with the JSON schema where several elements are required.
I can however POST anything as long as it is JSON... There is no validation against the JSON schema done...
What am I missing?
It is working!
There is a time lag between the deploy and the actual usage of the new code even though I am not doing any caching it seems.
Went out for lunch and came back to a working solution!
{
"message": "Invalid request body"
}
It would be nice to be able to modify the response message though...

Can't create replies to some existing youtube comments

I have a software, which allows you to create a reply to a comment on your youtube video. Therefore I use the youtube API v3 comments.insert method.
POST https://www.googleapis.com/youtube/v3/comments?part=id%2Csnippet&access_token=[access_token]
{
"snippet": {
"parentId": "parentId",
"textOriginal": "test message"
}
}
Most of the time the requests are successful. But for some comments I can't create replies this way. The API always returns:
{
"error": {
"errors": [
{
"domain": "youtube.comment",
"reason": "processingFailure",
"message": "The API server failed to successfully process the request. While this can be a transient error, it usually indicates that the requests input is invalid. Check the structure of the <code>comment</code> resource in the request body to ensure that it is valid.",
"locationType": "other",
"location": "body"
}
],
"code": 400,
"message": "The API server failed to successfully process the request. While this can be a transient error, it usually indicates that the requests input is invalid. Check the structure of the <code>comment</code> resource in the request body to ensure that it is valid."
}
}
I'm using a valid access token and the parentId is valid, too, because I can retrieve it through the API.
I took a look at the successful and failing requests, but didn't find any difference. So I assume that the request input isn't invalid as it is mentioned in the error message.
In my opinion this error isn't a transient error, because the same requests are still failing after some days.
I also tried to create a reply on such a comment through the API Explorer but the result was the same.
Does anyone have the same problems or am I doing something wrong?
When I go to the video and look at the comments directly, the comment with ID z13tjxdqnuygy1lga04cilcqxqipg1zbtbs has a "reply" option under it, while the comment with ID z13rgftjgw3bulyou04ccfnbjofztxg54yo0k does not. It seems that the user posted the comment via their Google+ page and disabled replies to their posts.