Skip to main content
Matrix42 Self-Service Help Center

Fragments Data Service: Get a list of Fragments

Details

Retrieves a list of fragments with a defined list of columns which match the specified search criteria and are sorted in the defined order.

Request

URL 

GET  http(s)://{server}/M42Services/api/data/fragments/{ddname}?where={where}&columns={columns}&pagesize={pagesize}&pagenumber={pageNumber}&sort={sort}

URL Attributes and Query Parameters

Element Description Type Required
ddName The technical name of the Data Definition (e.g. SPSActivityClassBase) string Required
where A-SQL Where Expression.  If no filtering expression is specified, the Service returns all fragments of the specified Data Definition which are allowed for the caller.
More information  please see ASQL
string Optional
columns A-SQL Column expression defines the columns in the result set, separated by Comma. If no Columns defines, then the Operation returns only Fragment Ids. 
Example: Name, Parent.Name as ParentName
string Optional

pageSize

Sets the number of records (fragments) returned by Operation. Used in combination with the PageNumber parameter integer Optional
pageNumber Sets the Number of the page. Used in combination with PageSize property. integer Optional
Sort Defines the sorting in the result. Example: "Name ASC, CreatedDate DESC" string Optional

Headers

For a list of available HTTP request headers see Web Services: REST API integration.

Response

Returns

An array of JSON objects where each object represents the Data Definition fragment which matches the specified search criteria and is allowed for the current user (caller). 

The response has the following format:

[
    {
        "DisplayString":"{Fragment Display String}",
        "ID":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "Column1": value
    }
]

Status Codes and Errors

The following table lists the returned HTTP status codes.

Code Description
500
  • Defined Data Definition is not found
  • The specified Where or Columns ASQL expressions are not valid

 

Examples

Example 1: Read Service Desk categories 

The example obtains all the list of Service Desk categories which

  • Have a Parent category. 
  • Each found category contains columns: ID, Name of the Category, Name of the parent Category.
  • Names of the categories are expected in German.
  • All the categories need to be sorted by name. 
  • Result fetches up to 3 category 
GET http://localhost/m42Services/api/data/fragments/SPSScCategoryClassBase?columns=ID,Parent.Name as ParentName,Name&where=Parent IS NOT NULL&Sort=Name asc&pageSize=3

Authorization: Bearer {token}
Explicit-Language: de

 

Response

[
   {
      "ID":"9282a500-caea-49bb-944f-9d0274fcc80a",
      "ParentName":"Organisation",
      "Name":"Ablage",
      "DisplayString":"Ablage"
   },
   {
      "ID":"8ba5e53d-3b6b-425a-baba-34438845f00d",
      "ParentName":"Einkauf",
      "Name":"Abschluss",
      "DisplayString":"Abschluss"
   },
   {
      "ID":"cbbec585-0184-4ae3-ab68-7caeb3d0e5b2",
      "ParentName":"Vertrieb",
      "Name":"Abschluss",
      "DisplayString":"Abschluss"
   }
]