Restful Actions

1. Introduction

As shown in Create Request , you can use your preferred tools to monitor Restful Actions between our web application with the server.


ChromeSafariFirefox

Chrome

Safari


Most of the API End Points are accessible via GET/PUT/POST/DELETE actions. All you need to do is to simulate the actions in your application.

Please be aware to ease the difference between browsers, we treat PUT and POST actions as the same.

We use 'id' field in requests to distinguish Add and Update action. One action is treated as Update if there's valid 'id' value (exist and not NULL), otherwise it would be treated as Add action.

2. Examples

for example:  consignments

Add

URIhttp://test.birdsystem.com/client/consignment
MethodPOST
Content-Typeapplication/json
URL Param-
Body Param
Response


Query Single Record Detail

URIhttp://test.birdsystem.com/client/consignment
MethodGET
Content-Typeapplication/json
URL Paramid=1707170020000004
Body Param-
Response

Query Records List

URIhttp://test.birdsystem.com/client/consignment
MethodGET
Content-Typeapplication/json
URL Paramstart=0&limit=50&sort=[{"property":"update_time","direction":"DESC"}]

start: the return record list start offset, , Optional Default 0
limit: how much records should be return in each request,  Optional,  Default 50
sort: sort,  property means column name, direction means sort direction, the examples shows sort by update time desc

Body Param-
Response

The common query params when query record list

When we query record list, we have another common query params besides  the param "start", "limit", "sort",seeing below (the following params should send to server by GET request)

paramtypenoteexamples
selectFieldsstringthe columns which should be return when query record list (this value should be URL encoded)

such as we need to return fields : status,is_urgent,total_weight,total_volume_weight,type,update_time,create_time.

we should concat these field names with comma, then do URL encoded

finally, the url params should be:

selectFields=status%2Cis_urgent%2Ctotal_weight%2Ctotal_volume_weight%2Ctype%2Cupdate_time%2Ccreate_time



filterstringthe filter condition which should be applied when query record list (this value should be URL encoded)

such as  we need to query the consignment list  which status is FINISHED ,and last update time is newer than 2017-09-10,条the query conditions should be :

[
  {"type":"date","comparison":"gt","value":"2017-09-10","field":"update_time"},
  {"type":"list","value":["FINISHED"],"field":"status"}
].
after url encoded,the url params should be:
filter=5B%7B%22type%22%3A%22date%22%2C%22comparison%22%3A%22gt%22%2C%22value%22%3A%222017-09-10%22%2C%22field%22%3A%22update_time%22%7D%2C%7B%22type%22%3A%22list%22%2C%22value%22%3A
%5B%22FINISHED%22%5D%2C%22field%22%3A%22status%22%7D%5D
custom defined filter field by each table list string


In order to fullfill the different requirements, some API can use query filter on some frequently used fields. we can directly send params "fieldname=fieldvalue" to these API.

Please refer to the relevant API documentation for the conditions available for each API

such as Product list,frequently query by client_ref or status,so we support this two fileds used as custom filter。

then we can use this fields as url params:

client_ref=IPxxx or status=PENDING (you can use multi conditions in same time)

Modify

URIhttp://test.birdsystem.com/client/consignment
MethodPOST
Content-Typeapplication/json
URL Paramid=1707170020000004
Body Param
Response

Delete

URIhttp://test.birdsystem.com/client/consignment
MethodDELETE
Content-Typeapplication/json
URL Paramid=1707170020000004
Body Param-
Response

3. More

all table list in birdsystem can action with Restful.

Frequently used API end points