Figlut Web Service REST API

Basic SQL Table CRUD: A list/array of entities must be used with the entity & property names matching those of a table and its columns.

  • Create: POST entities to '/sqltable/{tableName}' where {tableName} is the name of DB table.
  • Read: GET entities from '/sqltable/{tableName}'.
  • Update: PUT entities to to '/sqltable/{tableName}'.
  • Delete: DELETE entities to '/sqltable/{tableName}'.

e.g. http://localhost:2983/Figlut/sqltable/Order

Filtered Read:

  • Read: GET entities from '{sqltable/{tableName}/{filters}' where {filters} applies a where clause to the generated SELECT statements.
  • Filter Format (comma separated): {columnName}{comparisonOperator}{columnName}_{logicalOperator}, ...
  • Comparison Operators: =, >, <, >=, <=, <>, !=, !<, !>, IS, IS_NOT
  • Logical Operators: ALL, AND, ANY, BETWEEN, EXISTS, IN, LIKE, NOT, OR, SOME

e.g. http://localhost:2983/Figlut/Order/OrderNumber=KMI1983AND,UserStatusCode<_5

Raw SQL: raw sql statements/scripts may be sent to the service to be executed against the target DB.

  • Execute: PUT SQL to '/sql' where no results are returned e.g. INSERT/UPDATE/DELETE statements.
  • Execute: PUT SQL to '/sql/{typeName}' where {typeName} is the name of the entities to be generated and returned e.g. SELECT statements.

Content Types: The content type can be specified either in the web request's 'Content-Type' and 'Accept' parameters or as the last parameter in the URL.

  • Specified in web request:
    • XML : text/plain/xml
    • JSON : text/plain/json
    • CSV : text/plain/csv

e.g (request header)

User-Agent: Fiddler
Host: localhost:2983
Content-Type: text/plain/xml
Accept: text/plain/xml

  • Appended in URL (overrides 'Content-Type' and 'Accept' if also specified in web request):
    • XML : /xml
    • JSON : /json
    • CSV : /csv

e.g. http://localhost:2983/Figlut/sqltable/Order/xml

N.B. 'Content-Type' relates to the content being sent to the service and 'Accept' relates to the content it responds with.

Last edited Aug 8, 2013 at 4:13 PM by BinaryChef, version 13

Comments

No comments yet.