How to send data through url params in WSO2 - wso2

I would like to know how to add url params in wso2 for a url similar to http://localhost/mytestapi/123456 where 123456 is the id I want to pass onto the mytestapi api.

You can define the API and Endpoint like below. I gave a sample API with Endpoint mapping. For more information, please check on this documentation on Map the Parameters of your Backend URLs with the API Publisher URLs

Related

How to test client web api on postman

I'm working on BP monitor app and trying to test web APIs according to the documentation with the OAuth 2.0 type authorization. But I'm facing some problems to get validate GET or POST response.
Could you please help me how I can get the response of GET and POST web APIs.
1) In the postman app, you first enter your API endpoint into the URL field.
2) Just to the left of the URL input, there is a dropdown to select whether you'd like to send your request as GET or POST.
3) To the right of the URL input, you can define any extra parameters needed.
These parameters are where you can define specific details needed for your test-case.
Postman also allows you to easily generate OAuth tokens for testing (support for OAuth 1.0a and OAuth2).

Disable Case sensitive URLs for wso2 am

I created an api in wso2 api manager 2.0 publisher. When I publish this api, I have some resource /Some/things In the wso2 store. If I keep the case as is in the URL, then my api works. If I use any other tool to call and change the case in url to then I get a 202 error.
I know the WSO2 API Manager is handling the API URL correctly but i want to disable these feature.
how can i do this??
There is no option to disable case-sensitive in api manager. But you can rewrite the request url by any reverse proxy and send the request to apim.
e.g nginx url redirect[1]
[1] https://www.nginx.com/blog/creating-nginx-rewrite-rules/

WSO2 API Manager Custom Routing

Is there a way to dynamically set the endpoints in WSO2 API Manager to something other than the configured production and sandbox URLs? In my case, I want to route based on an incoming header value; resulting in something like:
https://my_dynamically_determined_subdomain.my_static_domain.com
I tried doing this with a custom handler class that writes my desired URL to the "To" header, but that doesn't seem to affect the routing.
Is there another way to accomplish this?
Your approach seems to be good. You can set "To" header dynamically. But you have to use a Default Endpoint, instead of a HTTP Endpoint. Default Endpoint will send the message to the URL found in "To" header. Please modify your inSequence of the API Configuration (found in $AM_HOME/repository/deployment/server/synapse-configs/default/api/your-api.xml) to replace the HTTP endpoint with a Default endpoint, as shown below.
If you want to do this to all of your APIs, then you can edit velocity_templates.xml so that all the APIs will be published with default endpoints automatically. Please refer this doc for more details on this. It is worth to have a look at this blog post which is discussing a similar pattern what you are trying to do.

WSO2 API Manager filter JSON result

I am trying to filter JSON results coming from our main application in our WSO2 API Manager and to filter URL's in the results. I haven't tried anything specific. Any ideas?
In Filter mediator use xpath to identify the certain messages/properties.check the url in the payload and filter..Check the documenation

How to send the post request in wso2 api manager?

How to send the post request in wso2 api manager? What would be the content type, parameters etc.
I am publishing Rest APIs in WSO2 API Manager , I would like to intercept my own API input field validations for each API like input parameter format and value etc. If validation success then API Manager should allow the request to invoke back-end , else reject the request with error message.
You can create a custom handler or custom sequence and deploy it for that api. You can implement the validation logic inside that.
see following product documentation
https://docs.wso2.com/display/AM1100/Writing+Custom+Handlers
https://docs.wso2.com/display/AM1100/Adding+Mediation+Extensions