Skip to main content

Posts

Showing posts with the label WSO2 API Manager

RESTful API for WSO2 API Manager

Here, I will explain, how to create an API through API Publisher .  This request is to obtain the consumer key/ secret key pair. curl -X POST -H "Authorization: Basic < BASE64 username:password >" -H "Content-Type: application/json" -d '{"callbackUrl": "www.google.lk","clientName": "rest_api_publisher","tokenScope": "Production","owner": " username ","grantType": "password refresh_token","saasApp": true}' https:// api.cloud.wso2.com /client-registration/v0.11/register Note: The <user name> should be email@organization_key. For example, if the e-mail is john@gmail.com, the <user name> should be  john@gmail.com@organization_key. You can find the organization_key on the Manage page of the cloud. Sample Request: curl -X POST -H "Authorization: Basic dml2ZWthbmFudGhhbxxxxxxxxxxxxxx= " -H "Content-Type: ...

How to add custom headers to published APIs in WSO2 API Cloud?

This blog guides you to add additional headers to published API in WSO2 API Cloud .  The API Cloud is based on WSO2 API Manager , WSO2's complete solution for designing and publishing APIs and managing a developer community. In order to add additional headers to the allowed headers, we have to configure CORS headers per API level . Once we configure, we can include additional headers in the API Console. In the example below, we will add a custom header called " setName " to an existing API and invoke it from the Developer Portal. Edit a published API and then click "Next: Implement >"          Select the Enable API based CORS Configuration check box to enable CORS for the API. Add the additional headers in "Access Control Allow Headers", then Enter and click Save. Now we have completed for configuring  CORS headers. Then we need to include additional headers in the API Console. Edit a published API again, then nav...