WSO2 AM - Converting JSON to XML - wso2-api-manager

I want to expose the REST API in WSO2 API Manager with the back-end service (XML over http). I wanted to convert the JSON request to XML and call my back-end service.
Please let me know how to achieve this in WSO2 API Manager 3.0

Use the json-to-xml-in-message mediation sequence.
Login to api publisher.
Open the api and go to the Runtime Configurations tab from the left menu.
In the Request section, click on Edit button of the Message Mediation option.
Select the json-to-xml-in-message mediation sequence from the Common Policies.
Click on Select and Save the api.

Related

Custom website link to Dataverse without Power App

How can I go about creating an https form and getting input from there into dataverse without having an app created on Microsoft.
you will have to create application user in Azure to use dataverse API
Step by step to connect to D365 with a client_secret to use APIs
This is one example of how to consue dataverse API using Application user in python
There are numerous other example of consuming dataverse API, bascially you will need to authicate and get Token and then accees API

WSO2 API Header is not working as expected

I have created API in wso2 API manager and specified header as a required field but when API was hit by using postman I am able to get the response. Do I need to enable header check in any configuration file Please let me know.
I checked WSO2 2.6.0 API documents but did not find solution.

How to get response and reply to sms using Twilio with C# Asp.net

How to get response and reply to sms using Twilio with C# Asp.net. How do I Send Outbound SMS Text Messages?
This is taken from an article I wrote on setting up Twilio and our Conveyor extension (free, go to Tools->Extensions) for development locally.
We will use Conveyor to provide incoming access to our web project through a tunnel, enabling your webhooks to be called on localhost. Conveyor is available through the Tools->Extensions menu, by searching for conveyor.
Setup an MVC Web Application
To get started, we’re going to setup a simple webhooks MVC demo app in Visual Studio. We will use the Twilio service to notify our application when a text message (SMS) has been received and respond with a specific message. This tutorial can also be used for Twilio's other API's including Chat, Voice and Video.
This example project is designed to show you how Conveyor can be used to simplify the use of webhooks on your local machine. If you need more details about how to setup webhooks please look online at numerous tutorials and projects.
Create a new project, we’ll be creating an empty ASP.NET MVC C# project. We won’t be hosting in the Cloud so don’t select Azure.
Add NuGet Packages
In order to use the Twilio helper libraries we will need to install the Twilio NuGet package via the Package Manager console. Enter the following line and hit return;
Install-Package Twilio.AspNet.Mvc -DependencyVersion HighestMinor
Create a new Controller
To listen for the Twilio webhook we’ll create an MVC Controller. Twilio will call our webhook once an SMS text message has been received.
Right click the Controllers folder in your project, select Add > Controller and add an empty MVC 5 Controller. You can name your Controller as you see fit.
Next you will need to add the using statements to import the Twilio namespaces;
using Twilio.AspNet.Common;
using Twilio.AspNet.Mvc;
using Twilio.TwiML;
and change the Controller class to inherit from TwilioController.
Now we add the following code;
[HttpPost]
public TwiMLResult Index(SmsRequest request)
{
var response = new MessagingResponse();
response.Message("Hello World");
return TwiML(response);
}
Of course you can code your webhook however you need but for our example, we have our response message set as “Hello World” so when our webhook receives notification of a SMS text to our Twilio number, it will respond with our own message.
Run the Application
So now we can go ahead and run our application. As this is a simple project with the only content being our Controller, you will see an error page. That doesn’t matter, we just need our project to be running in Visual Studio so we can make use of the webhook.
Use Conveyor
Now the application is running, we can use Conveyor to obtain a publically accessible URL that we can provide to Twilio. Clicking Access Over Internet in the Conveyor window will then provide us with the URL we need. You may need to register an account at this point.
Calls to the conveyor.cloud URL are tunnelled to your localhost, so we will add the Controller name to the conveyor.cloud URL and then add it to the Twilio settings.
That’s it. We’re ready to test it out!
Now when I send a SMS text to my Twilio number the message from our application is sent back to the original mobile number.

Should I use graphQL for requests that don't concern application data, like request to log out from third party services?

I am working on a project where we use graphql.
Now I want to create an endpoint in the backend that accepts an id token and logs a user out from third-party services.
Should this endpoint, that has nothing to do with application data, be a graphql endpoint like all our other endpoints or should it rather be HTTP rest/rpc endpoint?
I would recognize logging to (/out from) third-party service at the same level as data - both are resources you're working on as part of your serice.
You can wrap (stitching, delegating) any service(s) you want - one of graphQL advantages is it's ability to hide changes - when sth will change (new 3rd parties) you'll just update your resolver. No app update, no many endpoints management (API versions).

Manage subscriptions on WSO2 API Manager without API Store Interface

I am using WSO2 API Manager to expose few APIs. But I don't want that the consumer use the API store for the subscriptions. The creation of subscriptions/applications and Access tokens should be managed through by my custom web application.
I have checked the WSO2 API Manager docs https://docs.wso2.com/display/AM210/apidocs/store/ and imported the swagger in SoapUI. When I try to invoke the store api of my local API Manager I am getting the HTML content of API store page. see below screenshot.
Can anyone please help what I am doing wrong? Or is there any other way to the requirement.
You need to pass token which is generated by passing scope and client secret key and password as described in https://docs.wso2.com/display/AM210/apidocs/store/#guide

Resources