Monday, June 30, 2014

Publish assets using the API-Postman-WSO2 Enterprise Store

At the moment there are two ways to publish an asset to the ES back-office.

1. Using the UI

Eg: - Browse https://localhost:9443/publisher/asset/ebook
You can find the following UI and add the new asset(ebook in this case)


2. Using the API

This is the subject that I'm going to talk in this post. I'm going to use Postman- REST client for google chrome and CURL to execute this API invocation.

First lets try out with Postman,

Prerequisite :
a) google chrome browser
b) Postman chrome-extension

Steps

i) Browse https://localhost:9443/publisher/ and login in to the back-office.
ii) Browse chrome://apps/ and launch Postman REST client.
iii) Refer following screen-shot and create the POST form-data accordingly.

Note
URL :  https://localhost:9443/publisher/api/asset/ebook
Type : POST



iv) Now you can invoke the API :)

You will receive the following output if it works right..

Lets browse the newly added ebook asset.

I will come up with a separate post on the topic POST multipart/form-data using CURL soon. So you can invoke the same above asset add API using CURL.