Quantcast
Channel: Question and Answer » web-services
Viewing all articles
Browse latest Browse all 136

Creating a user-customizable web api

$
0
0

Technologies: Javascript for $http call, ASP.NET Web API, MSSQL for data retrieval

Web API will return array of widget objects with following properties:

WidgetId,
WidgetAttribute1 Bool,
WidgetAttribute2 Bool,
WidgetAttribute3 Bool, etc. attributes to return is defined by user.

Basically, we are returning the widget’s attributes, where each attribute is a True/False. True if attribute exists for the widget, false if not. The exact attributes to return will be defined by the user. The available list of attributes (50-100) is pre-defined. User selects the attributes he/she cares about (will be a subset of the total), and API should only return those.

My idea for approach: User posts simple array with list of WidgetAttributeIds he/she wants returned. Web API looks at simple array and executes query according to the present Ids.

Should i use a stored procedure and pass in parameters of which attributes to return, or should i construct the query within the web api controller, then pass it to sql server?


Viewing all articles
Browse latest Browse all 136

Trending Articles