Alemba RestFul API
The Alemba API a RESTful API, and as such, is entity centric – it exposes all the entities within ASM, and the verbs that can be used to manipulate those entities follow the same standard pattern.
About the Alemba API
The Alemba API has been introduced as part of a new generation of product software that will offer greater functionality and an improved user experience.
API URLs
Agent/User Role
*For building Data Queries and viewing content od database tables for each entity.
Admin Access
*For managing Systems, ClientID, and other properties
What is a RESTful API?
A RESTful API is an Application Programming Interface that follows REST (or Representational State Transfer) principles to allow one system to manipulate data on another. REST is a widely used protocol that provides a wide range of benefits over older protocols, such as performance, scalability and simplicity.
The Alemba API is self-documenting, in that you can discover more detail about how to use the API from the API itself.
The API fits within the ASM Core architecture, as described in Alemba API Architecture and is installed automatically with the product. See Installing the Alemba API for more details.
The Alemba API Explorer is the interface to the API. You are required to log in, as described in Logging In to the Alemba API Explorer, and can then examine the entities with ASM, as explained in Navigating the Alemba API Explorer.
Once you are familiar with the explorer, you may wish to investigate the programmatic opportunities, in the Alemba API Programmers’ Guide. The Alemba API Programmers' Cookbook contains information on how to use the API to create well-formed Alemba® objects; and the Alemba API Cookbook - Recipes section contains further instruction and examples of programming in use. Finally, you may wish to be aware of the database tables that contain the metadata driving the API, which are listed in Alemba API Related Database Tables.
Extra's
Adding a field | Meaning |
, | Next Column |
. | Look-up (Linked Field option, for example .Name) |
Name | The name of the field for example P1 and not the Ref of 1 |
Filtering
The Rest API supports expressive filtering of search results.
$filter accepts a C# LINQ style predicate which is translated to parameterized SQL and applied as a search filter
This would return all accessible calls where the Priority is equal to 1
Equality Operators and Methods
All data types support basic equality comparison
== | Is equal to |
= | Is equal to |
!= | Not equal to |
Binary data types support basic equality comparison but in practice, this can only be used to compare the property value with null.
Boolean data types support basic equality operators
When comparing with true or false, the right hand side of a boolean property equality expression can be omitted.
Binary equality expressions can also be negated with !
Number data types support more complex equality comparison operators
> | Greater than |
< | Less than |
>= | Greater than or equal to |
<= | Less than or equal to |
The Contains method can be used to match records where a string property contains a word or phrase
The StartsWith method can be used to match records where a string property starts with a word or phrase
The EndsWith method can be used to match records where a string property ends with a word or phrase
As with all filters, the expressions can be combined using logical And (&&) and Or (||) operators
Sorting
The API supports sorting using $order, and you can use several qualifiers, as illustrated in the following examples.
would sort the result by the FirstName property in descending (a-z) order.
would also sort the result by the FirstName property in descending (a-z) order.
would sort the result by the FirstName property in ascending (z-a) order.
It is also possible to specify multiple order properties:
would sort the result by the FirstName property in descending (a-z) order and then sort by the LastName property in ascending (z-a) order, e.g. Andrew Anderson, John Smith, John Jones
Main filter used to sort by descending Ref order
Useful Augmenters Sorting
Augmenter | Application | Example |
@IsDeleted | Entities that have been deleted | $filter=@IsDeleted $filter=!@IsDeleted |
@DateTime | Creates a value from a date/time string in ISO 8601 format, for use in query filters | $filter=CreatedDate > @DateTime(2000-01-01T00:00:00.000Z) |
@Guid | Creates a value from a GUID string, for use in query filters | $filter=Id = @Guid(75f7a7d5-652f-4e30-bd92-dc6e9594b28b) |
@Now | Current date | $filter= CreatedDate <= @Now |
@NowOffset | Offsets the current date by days, hours and minutes Filter logged date within last 7 days, 2 hours, 30 minutes | $filter= CreatedDate > @NowOffset(-7,-2,-30) |
@OrganizationId | Current users Organization id | $filter=User.OrganizationId == @OrganizationId $filter=User.Organization == @OrganizationId $filter=User.Organization.Ref == @OrganizationId |
@UserId | Current user's id | $filter=User == @UserId $filter=UserId == @UserId $filter=User.Ref == @UserId |
Creating a Join
Join: Alias Name:ResourceName(Matching field from the linked resource==Matching field from the main resource)
Field: Alias Name.Recource field name
Example: