...
Overview of Annotation Parameters
The attributes for the RestAddress annotation are listed in the table below.
Parameter Name | Description |
---|---|
type | The type of the request, either "resourcerecord" for a single record, or "collection" for list of records |
address | The URI template. "/Customers/{CustNum}" means that the resources can be accessed using the resulting URI like http://localhost:8820/web/Entities/Customers/1 - The {CustNum} placeholder represents a field used in the resulting QueryString (FOR EACH eCustomer WHERE eCustomer.CustNum = 1). There can be multiple placeholders in a single URI template (e.g. /Customers/{CustNum}/Orders/{OrderNum}/OrderLines/{OrderLine} Collection or singleton (a single record resource that does not require any further selection criteria) may not require any value placeholder at all. |
tables | The comma delimited list of tabels requested from the Business Entity (FetchDataRequest:Tables property) to serve the request |
id | The comma delimited list of fields used to return the ID of a resource |
fields | The comma delimited list of fields returned to the caller (by default), possible values may be field names, tablename.fieldname's or tablename.* |
canRead | true/false, logical value determing of the URI supports read (GET) requests |
canUpdate | true/false, logical value determing of the URI supports update requests (PUT and PATCH) - supported for individual records only |
canCreate | true/false, logical value determing of the URI supports create requests (POST) - supported for collections only |
canDelete | true/false, logical value determing of the URI supports delete (DELETE) requests - supported for collections and individual records |
childAddresses | links to resource URI's for the child records returned by the request, comma delimited list, entries are in the form of {tablename}:{uri pattern}, e.g. eSalesrep:/Salesreps/~{SalesRep} |
links | HATEOAS style links (to other business entities) in the form of {rel}:{uri pattern}, e.g.orders:/Customers/~{CustNum}/Orders,salesrep:/Salesreps/~{SalesRep} |
Query String Parameters
RESTful requests for collections can be filtered using query stirng parameters.
Parameter Name | Description | |
---|---|---|
fields | commatags | Comma-separated list of tags used for grouping endpoints in Swagger documentation. |
methodDescrptionGet | (optional) A description for Swagger documentation for GET operations for this address. | |
methodDescrptionPut | (optional) A description for Swagger documentation for PUT operations for this address. | |
methodDescrptionPost | (optional) A description for Swagger documentation for POST operations for this address. | |
methodDescrptionPatch | (optional) A description for Swagger documentation for PATCH operations for this address. | |
methodDescrptionDelete | (optional) A description for Swagger documentation for DELETE operations for this address. |
A Business Entity may also use an ApiDoc annotation to provide additional information for Swagger documentation.
Query String Parameters
RESTful requests for collections can be filtered using query string parameters.
Parameter Name | Description |
---|---|
fields | comma delimited list of field names to be returned |
sort | The sort criteria as a comma delimited list in the form of +fieldname or -fieldname, e.g. sort=+country,-city |
limit | The maximum number of records returned from a collection |
offset | The first record to be returned, allows paging in combination with the limit parameter, e.g. limit=20&offset=20 |
{fieldname} | filter criteria, e.g. | sort=+country,-city
limit | The maximum number of records returned from a collection |
offset | The first record to be returned, allows paging in combination with the limit parameter, e.g. limit=20&offset=20 |
{fieldname} | filter criteria, e.g. salesrep=BBB&creditlimit>=10000 - supported operators are =, >=, <=, >, <>, <salesrep=BBB&creditlimit>=10000 - supported operators are =, >=, <=, >, <>, < |
Supported Operators
The following query operators are supported by the RESTful interface:
- =, [=], [EQ]
- <>, [<>], [NE]
- >, [>], [GT]
- <, [<], [LT]
- >=, [>=], [GE]
- <=, [<=], [LE]
- [BEGINS]
- [CONTAINS]
- [MATCHES]
Invoking Business Entity and Business Tasks Methods through the RESTful interface
...
Code Block | ||
---|---|---|
| ||
[ { "id": 242770, "url": "http://localhost:8820/web/Entities/Customers/242770", "Name": "Mikro Designs", "CreditLimit": 83500.0, "links": [ { "rel": "orders", "href": "http://localhost:8820/web/Entities/Customers/242770/Orders" }, { "rel": "salesrep", "href": "http://localhost:8820/web/Entities/Salesreps/GPE" } ] }, { "id": 1242770, "url": "http://localhost:8820/web/Entities/Customers/1242770", "Name": "Mikro Designs", "CreditLimit": 83500.0, "links": [ { "rel": "orders", "href": "http://localhost:8820/web/Entities/Customers/1242770/Orders" }, { "rel": "salesrep", "href": "http://localhost:8820/web/Entities/Salesreps/GPE" } ] }, { "id": 46030, "url": "http://localhost:8820/web/Entities/Customers/46030", "Name": "Lazysize", "CreditLimit": 58000.0, "links": [ { "rel": "orders", "href": "http://localhost:8820/web/Entities/Customers/46030/Orders" }, { "rel": "salesrep", "href": "http://localhost:8820/web/Entities/Salesreps/JAL" } ] } ] |
...
http://localhost:8820/web/Entities/Customers/3
...
Code Block | ||
---|---|---|
| ||
{ "id": 3, "url": "http://localhost:8820/web/Entities/Customers/3", "CustNum": 3, "Country": "DE", "Name": "Hoops", "Address": "Suite 415", "Address2": "werwe", "City": "", "State": "GA", "PostalCode": "02112", "Contact": "Michael Traitser", "Phone": "(617) 355-1557", "SalesRep": "HXM", "CreditLimit": 75000.0, "Balance": 1199.95, "Terms": "Net30", "Discount": 10, "Comments": "This customer is now OFF credit hold.", "Fax": "", "EmailAddress": "info@hoops.com", "Flags": "C", "eSalesrep": { "url": "http://localhost:8820/web/Entities/Salesreps/HXM", "RepName": "Harry Munvig", "Region": "West" }, "links": [ { "rel": "orders", "href": "http://localhost:8820/web/Entities/Customers/3/Orders" }, { "rel": "salesrep", "href": "http://localhost:8820/web/Entities/Salesreps/HXM" } ] } |
http://localhost:8820/web/Entities/Customers/3/Orders?OrderStatus=Partially%20Shipped
...
Code Block | ||
---|---|---|
| ||
[ { "id": 160, "url": "http://localhost:8820/web/Entities/Customers/3/Orders/160", "OrderDate": "2008-12-02", "ShipDate": "2009-05-23", "OrderStatus": "Partially Shipped" } ] |
...