MSPX API GETTING DATA The interface for getting data is /tablename[/:id?] Valid tablenames are those returned by the discovery (see discovery description). Providing an id when getting data will return data for that object only. Getting data without giving an id will return the whole content of that table in a list. Note that this may be large and hence the server may start paginating data! Use discovery and pagination when requesting a table with much data, or to decide if you have been paginated. Note that there are may be security restrictions on what gets returned when getting data! Always check the message returned. When getting a data list the following parameter can be added to the request: ?limit=X[&offset=Y] The server will at most return X objects in the result list. Note that there may be fewer items returned if the table contains fewer than X objects. The offset is used to let the server know which object in the total result that should be the first one in the returned list. The first offset in the result is 0 so not supplying the parameter will use 0 for offset. NOTE that the system can enforce limits and currently enforces a general 1000 limit! Always inspect the X-Results-Limit header. Consult the section on Custom HTTP headers below. ?fields=-?X[,-?Y]* The fields to return can be set using the fields parameter. A comma separated list (no whitespace allowed) is used to list the fields to return. Fields can be omitted from the set of all fields by prefixing them with a -. Not that if one field is omitted, only omitting fields are allowed in the query. ?sort=-?X[,-?Y]* Sort can be used to list a number of fields that should be used for sorting the result. If several fields are given the result list will be sorted by reverse radix sorting using them. A field can be prefixed with a - to indicate that descending sort order should be used for that field. ?q=Q The query parameter can be used to specialize query´s. Queries can be constructed using the following grammar Q -> S | (Q) | S and Q | S or Q S -> field O V | field in L O -> is not | is | != | = | >= | > | <= | < | like L -> ( C ) C -> V | V, C V -> null | true | false | number | 'value' Ex: ?q=fieldA='FOO' Ex: ?q=fieldA='FOO' and fieldB in ('BAR', 'BAZ') or fieldC like "FROB" Ex: ?q=fieldA is not null Ex: ?q=fieldA!='FOO' or fieldA is null Ex: ?q=dateField < '2017-01-01' ?expand=B (deprecated, will be removed. Please use collections only.) The expand can be set with a boolean to expand the values of the collections. This will add a field called collections to the fields returned. ?collections=-?X[,-?Y]* The parameter for collections works like the parameter for fields, but decides what collections to return. For example, if a table deals has a collection called estates which links all the estates included in the deal, adding ?collections=states will add a field containing a list of all expanded collections, that is the list will contain a property estates which contains a list of the estates. When getting either a list or a single object, the following parameter can be used. ?strip=false Strip will remove all fields with null values from the returned result. Not stripping will return all fields. The removal is nested. Stripping can also be requested using a header, see below. Custom HTTP headers The system will when appropriate return the following headers: Last-Modified: date in UTC format (for objects and files). X-Results-Last-Modified: Latest Last-Modified date of members in returned list X-Results-Limit: Any limit on the returned list. X-Results-Offset: The offset (if any) of the first object in the returned list. X-Results-Total: The number of elements in the result before limiting the returned list. X-Strip: sent with the value true to strip the results, see ?strip=true above. X-Deprecated-Request: Set to true if the request is or will be deprecated. The value NULL The system uses 'null' to represent that no value is set for a field. EXAMPLES curl -k -u "$UNAME:$PASSWD" https://api.mspecs.se/deals?fields=id,displayName,objectStatus&sort=displayName curl -k -u "$UNAME:$PASSWD" https://api.mspecs.se/deals?fields=id,displayName&q=displayName%20like%20%27%25vägen%25%27