API Gateway rejecting requests having spanish characters (á , í) - tomcat8

Below is my API Gateway mapping template for Integration request. This mapping template doesn't seem to allow spanish characters.
Example - John á O'Smíth
Sample XML which has spanish characters
Current API Gateway Integration Request Mapping Template
I have tried the below configuration adding charset to the content type , but that doesn't work too.
Modified Mapping Template to allow charset UTF 8
Getting below error while testing via API gateway -
Error while testing via API gateway

Related

Azure API management always returning 404 resource not found

I have an API instance in AZURE where the configurations are as below.
API endpoint : corol.abpparking.domain.com
API suffix : myaboutpage
Backend Webservice URL : http://10.20.10.2:8080/api/v1/
What works
If i call the webservice URL directly as below for the operation GET to /about, i get response code 200
http://10.20.10.2:8080/api/v1/about
Response: 200
What does not work
If i perform the same operation via APIM, i get a 404 resource not found.
http://corol.abpparking.domain.com/myaboutpage/about
Response: 404 Resource not found
I could not figure our what could be the reason. Note that i do not have any basepath in the Swagger definition.
Make sure to check that your API in Azure APIM is configured to accept HTTP in addition to HTTPS. You can set this in API settings, on the same page where you set API backend URL

IBM API Connect - Security Set up Issue - API Key in the Header not working

We are working on hosting a REST API in APIC.
I am able to test the API using APIC endpoint by turning off the security. But when I enabled the security (using API Key) I am facing problem. In fact, I am able to pass the api key in the query and able to run GET operations successfully.
However, we really want to pass the API key (X-IBM-Client-Id) in the header for Authorization. when I pass the API key in the header, I get 500 Internal Server
Error (Headers:
content-type: text/xml; charset="utf-8" x-backside-transport: FAIL FAIL). *Any idea why I am not able to pass the client ID in the header successfully? *
When you are on the API Security Definition page, and the Type entry is API key, there is a drop-down list with a choice of 'Header' or 'Query'.
My guess is that you have chosen 'Query'. Change it to 'Header' and you should be OK.

azure api management error 500

I configured an Api using API management service in Azure, all the endpoints are working fine, I defined some rules into the inbound policies, the last one is a set backend service rule. the objective of this rule is redirect the request to a diferent endpoint based on certain conditions. The problem is as follow: If i test the api endpoint inside the Azure,using the the Test option provided by API managemen service all the proceess works fine, i can see into the trace and check how the Api Management service recieve the request, check the conditions definen into the inbound policy and finally change the backend url to the right endpoint. If test outside the Azure, for example using postman, the API management service response an 500 error, the description of the error is: Expression value is invalid. Value is not a valid absolute URL. () Section : (inbound) Source : (set-backend-service)
I found the issue and the solution. The problem was generated in the policies configuration. For some reason the base tag in the backend policy was deleted. Putting back the base tag all the endpoints works fine.

Couldn't call aws api gateway from postman

I have created an api in amazon api gateway service with s3 proxy, and created a method post to upload a file to s3 using the document. Deployed the API and then using that url i tried to call the api from postman. But i couldn't post the file and it returns an error 'missing authentication token'.
I set authorization as NONE.
Then it returns an Unexpected "<" error.
Ah, okay. S3 only supports POST from an HTML form, which is why you see the error where it is expecting multipart formdata.
The method you need to use is PUT, instead of POST. PUT requires an item path, so you'll need to change the resource path to have a bucket and key, or get those from other places.
I have some more info on how to set this up in upload binary from api gateway to S3 bucket
It sounds like the document you're uploading isn't JSON. By default, API Gateway expects UTF-8 encoded JSON.
What content type are you sending with your Postman request?

Sharing the same code between several versions of the same Meteor web

I have a Meteor web deployed with Phusion Passenger integrated with Apache. The users access it with http://mycompany.org:3001.
That Meteor web communicates, via REST API, with another external server.
That external server has 3 versions of the same REST API:
http://external_server/v1/restapi
http://external_server/v2/restapi
http://external_server/v3/restapi
Each version of the above REST API manages a different user database, i.e. user_DB_1 -> v1, user_DB_2 -> v2, user_DB_3 -> v3.
Currently, my deployed Meteor web is making calls to the v1 of that REST API (http://external_server/v1/restapi).
Now, I have to call the other versions of the REST API (v2 and v3) with the same Meteor web, like this:
http://mycompany.org:3001/meteor_web_v1 (currently http://mycompany.org:3001)
http://mycompany.org:3001/meteor_web_v2
http://mycompany.org:3001/meteor_web_v3
Is it possible to capture the version of that URL and pass it as parameter to the Meteor web so that it calls the corresponding API?
For example, if the user make HTTP requests to http://mycompany.org/meteor_web_v1/login, then the web calls to http://external_server/v1/restapi, and so on...
Which is the approach here? Using maybe Apache mod_rewrite, Iron Router or which solution?
You can use either flow router or iron router to give you the url part as a parameter, you name it like this in your route declaration:
'/:myroute'
and then you will get a route parameter as a variable which you can use in your code to pass to your server method to do the http request.
You are doing the http request from the server, right ? Doing it that way prevents any CORS problems, and offloads the waiting to the server. The server should then update the database wth the received data, and the client will auto-refresh to make the results available.