This is a step-by-step guide to create your first Business API with GeneXus M.
If you didn't already, GeneXus M Installation Steps now, and then follow these steps.
Set the URI of the GeneXus Services and a valid GeneXus Account.
(By the time this is written, https://gxmprovisioning.genexus.com is the Server URI to set, and User ID and User Password are the ones corresponding to your GeneXus Account)
Create your first Knowledge Base.
Create your first Knowledge Base and then start modeling by discovering your business entities and their rules. For example, let's create an API for Insert/Update/Delete Customers
CustomerName! [ DataType = Character, Length = 40 ]
CustomerImage [ DataType = Image ]
CustomerBalance [ Length = 10, Decimals = 2 ]
CustomerRegisterDate [DataType = Date]
Error("Please specify a name") if CustomerName.IsEmpty();
Once you declare your entities probably you want to expose different views of the data to different clients of your API
So, GeneXusM allow presenting these different views, queries of your entities by using Data Providers
For example, expose all the customers with a balance > 10000
Where CustomerBalance > 10000
Id = CustomerId
Name = CustomerName
Now you have created the Customer Entity and the GetCustomers Data Provider, you can Build All and then Run your prototype
GeneXus M uses a business expert generator to create a database layer (DL) plus a business logic layer (BL) automatically and exposes the BL as a Restful API. Additionally, it generates a full Open API description of the API so that you can start using and trying it from any REST API client or any OPEN API editor like the Swagger online.
When you run the prototype, you get two URLs
1) The one of the Developer Menu (eg.: http://apps6.genexus.com/Id6ab5fb54b46b05021bce35ea5c39c5f3/static/developermenu.html)
Use it to Create, Read, Update, Delete data on your entities.
2) and the one of the OPEN API specification of your REST API (eg.: http://apps6.genexus.com/Id6ab5fb54b46b05021bce35ea5c39c5f3/static/default.yaml
Copy its content to http://editor.swagger.io to test it.
Congratulations! You got this first Business API up & running in a few minutes!
Now, it's time to create yours, and share the experience!