WStore Programmer Guide Resources management integration
Agenda 1.Introduction 2.Resources management integration – Registering resources Downloadable resource Downloadable resource providing link – Getting resources
INTRODUCTION WStore Programmer Guide
Introduction It is possible for a developer to integrate the Resources API in order to monetize different catalogues included in the developer solution. To perform this monetization, it is necessary to register the resources using a POST request, making them available to be bound in an offering.
RESOURCES MANAGEMENT INTEGRATION WStore Programmer Guide
Registering resources The contents of the request depends on the resource characteristics and the developer criteria. Downloadable resource If the resource is a downloadable resource and the resource is provided, it is possible to provide the resource itself by creating a multipart request or encode it in base64 and include this encoding in the JSON: POST /api/offering/resources HTTP 1.1 Content-type: multipart/form-data { “name”: “Smart City Lights Mashup”, “version”: “1.0”, “description”: “This resource contains a mashup for Smart City Lights”, “content_type”: “application/x-mashup+mashable-application-component” } + FILE POST /api/offering/resources HTTP 1.1 Content-type: application/json { “name”: “Smart City Lights Mashup”, “version”: “1.0”, “description”: “This resource contains a mashup for Smart City Lights”, “content_type”: “application/x-mashup+mashable-application-component”, “content”: { “name”: “SmartCityLights.wgt”, “data”: “encoded_data” }
Registering resources Downloadable resource providing link If the resource is a downloadable resource but the service provider has her own server to serve media files, s/he can provide an URL where the resource can be downloaded instead of the resource itself, making the request as follows: POST /api/offering/resources HTTP 1.1 Content-type: application/json { “name”: “Smart City Lights Mashup”, “version”: “1.0”, “description”: “This resource contains a mashup for Smart City Lights”, “content_type”: “application//x-mashup+mashable-application-component”, “link”: “ } All this requests return a 201 code if everything is successful
Getting resources It is also possible to retrieve the information of the different resources belonging to the user making the following call: GET /api/offering/resources HTTP 1.1 Accept: application/json This call returns a list with the following format: HTTP/ OK Content-Type: application/json Vary: Cookie { [ { “content_type”: "application/x-mashup+mashable-application-component" “description”: "Smart City Lights is an app" “name”: "Smart City Management" “version”: "1.0" } ] }
Thanks!