简体   繁体   中英

How to create an API for our own database using WSO2 API manager

Actually, I want to offer my data from my own database (postgresql) through API. I want to do it using WSO2 API manager.

I am not sure that I'm doing it in a right way, but suggest me the possibilities.

(i) First I've created a postgresql database.

(ii) did connections and performed CRUD operation using node js.

(iii) used the link ( for example GET verb and the link is http://localhost:8000/v1/api ) as the REST endpoint in the WSO2 API manager while publishing the api.

(iv) *****step********

(v) developed a simple html and used Javascript to parse the JSON data and displayed it. ( but I've done it using direct JSON data not with the WSO2 API)

******step********

How to use the consumer key and consumer id to authenticate the API from WSO2 to parse the data through the Javascript

Since you're new to APIM, you should look at WSO2 tutorials .

On a related note: You can use WSO2 Data Services Server to expose your data (in a database, for example) as a service (REST or SOAP). In your case, you can use it instead of your nodejs implementation. Once you expose your data as a REST services, you can use APIM to front them.

I think you've to register a new user to your api manager (the user that will use the api), the this user has to subscribe to your api. Once this is done you'll get a token, this token should be provided in the header of your queries (in the js in your case). You can see examples of call when you access your api in the api store.

Hope it helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM