SendGrid Template does not contain required placeholders - twilio

i'm trying to use the Email verify service via send grid and after i'm write all the placeholders i'm getting this error: "SendGrid Template does not contain required placeholders", and I can't find any solution.
Can someone guide me with this?
Thank you!

You need to enable the "Template Engine" read access for your API key. You can do so here: https://app.sendgrid.com/settings/api_keys. Make sure it is read access only (i.e. the slider is in the middle).

I had the same problem. I used {{{ code }}} to load the dynamic data. In my case, its OTP. So I replaced {{{ code }}} with {{{twilio_code}}} and the problem was resolved.

As of today, the following applies : https://support.twilio.com/hc/en-us/articles/6554095919003-Error-SendGrid-Template-does-not-contain-required-placeholders-
Cause
This error message usually due to the SendGrid Dynamic template missing
at least one of the following placeholders:
- {{twilio_code}}
- {{twilio_message}}
- {{twilio_message_without_code}}

Related

Swagger - API path & fixed parameter

I'm trying to put in swagger for documentation the link below.
https://server.dc.ege.ds:50001/XMII/Runner?Transaction=SC_AUTOMATION/API/SCRAP_LIST/SCRAP_LIST&OutputParameter=ResultXML&Plant=1345&Plant=1345&BookingdateFrom=2022-08-31T10%3A57%3A44
I see a particulariry of having my endpoint "/Runner?" followed by "Transaction=SC_AUTOMATION/API/SCRAP_LIST/SCRAP_LIST" I don't know ho to explicit it in swagger.
OutputParameter=ResultXML is currently a parameter but in fact there is no other possibily than "ResulXML" any possibility to define it as fixed ?
thanks a lot for your reading

Why use "?" instead of ":" in URL?

We can use
'PATCH /companies/:id' : 'CompanyController.find'
to update data.
One suggested me that I can use the alternative way:
'PATCH /companies/find?key=Value'
But I do not know what it works. Please explain me why we prefer ? mark than : mark in search path.
You can use either or. The biggest reason most people chose one or the other is just how they want to present the URL to the user.
Using a path variable (:) can symbolize you're accessing a defined resource, like a user ID, where as an argument (?) can symbolize you're are dynamically changing/searching something within a defined resource, like a token or search term.
From what I can tell that's the general practice I see:
example.com/user/:username
versus
example.com/user/?search="foo"
http://en.wikipedia.org/wiki/URL
If we are firing GET request, ? symbol is used to let the server know the url parameter variables starts from there. And this is commonly used. I didn't used : symbol instead of ?
You are probably messing the things up:
According to your example, :id indicates a variable that must me replaced by an actual value in some frameworks such as Express. See the documentation for details.
And ? indicates the beginning of the query string component according to the RFC 3986.
It's a rule to design rest api
you can find 'how to design a rest api'
Assuming below code is Sails.js
'PATCH /companies/:id' : 'CompanyController.find'
It will makes REST API that be mapped onto 'CompanyController.find' by using PathParam. Like this
www.example.com/companies/100
Second one will makes REST API by using QueryParam.
It also be mapped onto 'CompanyController.find'
/companies/find?key=Value
But the API format is different. Like this
www.example.com/companies/find?key=100
PathParam or QueryParam is fine to make REST API.
If the Key is primary for company entity,
I think PathParam is more proper than QueryParam.

How to parse Nokogiri/libXML XML errors to human-friendly errors?

We are using Nokogiri to validate XML files using a XSD. The problem is that the error messages that Nokogiri generates are not very friendly and very hard to translate:
"Element '{http://www.portalfiscal.inf.br/nfe}infNFe': The attribute 'Id' is required but missing."
Does anyone know of a parser or any other way to capture the info needed from the error to generate a more human friendly error?
Until then, we will be doing a custom parser for them... ouch!
I created a gem for this that is now open source: https://rubygems.org/gems/xml_errors_parser
It seems to work pretty well so far, but number of errors parsed is very few for now. It is however very easy to add new errors, so we will be adding them as needed.
Code reviews and pull requests are always great :)

Accessing URL variables in Aweber generated URL string

I use the Aweber API to add members to a list - and the settings are configured to pass variables back to my page for processing.
That all works fine - but the issue I'm having is with the url - the url is appended as follows:
http://someurl.com/processing.cfm&thisvar=this&custom Organisation=Some Name
On the face of it that should be fine - but my processing is returning an error of
Element CUSTOM is undefined in URL
I'm wondering if it is because of the space between custom and organisation?
I have also tried to access the URL object Organisation - but get the same Element Organisation is undefined in URL message.
Any advice appreciated?
Thanks as always!
Simon
The space is certainly the reason, it must have an equals sign in it. What library is appending this?

BIRT Engine Integration In Struts2

I am integrating the BIRT Engine with Struts2 following this link http://birtworld.blogspot.com/2010/02/birt-and-struts-2.html at basic level it is ok.
But I am facing following issues...
Passing parameter to Task renderer...
task.setParameterValue("csvFilePath", req.getParameter("csvFilePath"));
this is thorwing an exception "The type of parameter "csvFilePath" is expected as
"string", not "[Ljava.lang.String;", I dont know what is mean by string here
please help in the context.
Drill down report has broken link.
I have two reports report1 and report2. report2 is not coming up when followed the hyperlink in report1.
The hyperlink seems to be broken, report has this hyperlink "http://localhost:8080/ReportEngineIntegration/run?__report=%2FE%3A%2FDashboardReportEngine%...". I wonder why this happening and why /run? is coming in the ulr.
Please help me in the context.
Thanks in advance
getParameter returns a string array. If a method takes a string, send only one string. (Making some assumptions about what req is here.)
That said, if you're using Struts 2, why are you accessing the request anyway?

Resources