Wiki source code of HTTP Operations

Last modified by Eva Torken on 2023/06/08 11:34

Show last authors
1 {{container}}{{container layoutStyle="columns"}}(((
2
3 In this microlearning, we will focus on learning about HTTP Operations.
4 A crucial part of setting up your (API) Gateway with the help of RESTful services is
5 knowing what HTTP Operations are and how you can use them to control what parties can change via your (API) Gateway.
6
7 Should you have any questions, please contact [[academy@emagiz.com>>mailto:academy@emagiz.com]].
8
9 == 1. Prerequisites ==
10
11 * Basic knowledge of the eMagiz platform
12
13 == 2. Key concepts ==
14
15 This microlearning centers around HTTP Operations in conjunction with the API Gateway solution of eMagiz.
16 With HTTP Operations we mean: Identify the action (i.e. Create, Read, Update or Delete) that needs to be performed on a resource (i.e. Client, Order, Employee).
17 With API Gateway we mean: A collection of RESTful API operations that can be published to the outside world to give them access to applications that are linked to your business process.
18
19 Each HTTP Method represents a certain action on a resource. Of the most frequently used ones we can make a nice comparison to the CRUD operations:
20
21 HTTP Operations: CRUD Operations:
22
23 * POST - Create
24 * GET - Read
25 * PUT - Update
26 * DELETE - Delete
27
28 So the POST represents a Create action, the GET a read action, etc.
29
30 This also means that when you do a GET (a read action) it should **not** alter the resource you are requesting from your backend operation if you want to adhere to the RESTful principles.
31
32 == 3. HTTP Operations ==
33
34 A crucial part of setting up your (API) Gateway with the help of RESTful services is
35 knowing what HTTP Operations are and how you can use them to control what parties can change via your (API) Gateway.
36
37 Each HTTP Method represents a certain action on a resource. Of the most frequently used ones we can make a nice comparison to the CRUD operations:
38
39 HTTP Operations: CRUD Operations:
40
41 * POST - Create
42 * GET - Read
43 * PUT - Update
44 * DELETE - Delete
45
46 So the POST represents a Create action, the GET a read action, etc.
47
48 This also means that when you do a GET (a read action) it should **not** alter the resource you are requesting from your backend operation if you want to adhere to the RESTful principles.
49
50 === 3.1 Determining the HTTP Operations in eMagiz ===
51
52 When you look at the conceptual idea of the API Gateway, exposing backend operations via a centralized location to the outside world
53 it stands to reason that when you set up your API Gateway (i.e. the front-end facing part) start with the backend operation you want to expose.
54
55 When the backend operation also adheres to the RESTful principles you can simply reuse that HTTP method.
56 For example, if they have a GET operation to an HTTP Operation that you want to expose you should also have a GET operation on the API Gateway side.
57
58 To expose a backend operation directly in the API Gateway double click on the backend system and look for the available Endpoint operations
59
60 [[image:Main.Images.Microlearning.WebHome@crashcourse-api-gateway-api-http-operations--endpoint-operations.png]]
61
62 Select one of them and press the button Expose in Gateway. This will lead you to the following pop-up.
63 In this pop-up select, the message type (the resource) that you want to link this operation to and press expose.
64
65 [[image:Main.Images.Microlearning.WebHome@crashcourse-api-gateway-api-http-operations--endpoint-operations-message-type.png]]
66
67 The result is that you will see the following pop-up (which is also the main configuration and edit screen in case you want to alter something).
68
69 [[image:Main.Images.Microlearning.WebHome@crashcourse-api-gateway-api-http-operations--api-gateway-exposed-from-backend-edit.png]]
70
71 The moment you are content with this action press Save and let eMagiz configure the exposed operation correctly.
72
73 === 3.2 Editing the HTTP Operation in eMagiz ===
74
75 You can easily do so in eMagiz by editing the API Gateway integration in Design via the context menu or by double-clicking on it.
76
77 [[image:Main.Images.Microlearning.WebHome@crashcourse-api-gateway-api-http-operations--edit-api-integration.png]]
78
79 In this pop-up, you can select the (backend) System Operation you want to expose via the API Gateway.
80
81 [[image:Main.Images.Microlearning.WebHome@crashcourse-api-gateway-api-http-operations--edit-api-integration-pop-up.png]]
82
83 By pressing the button Select System Operation you will see an overview of all available operations
84
85 [[image:Main.Images.Microlearning.WebHome@crashcourse-api-gateway-api-http-operations--edit-api-integration-pop-up-available-operations.png]]
86
87 Select the GET operation and eMagiz will update your integration. The result of this example will be that external clients can execute a
88 GET call to retrieve HTTP methods from the system called Crash Course * API Gateway via the help of the eMagiz API Gateway.
89
90 [[image:Main.Images.Microlearning.WebHome@crashcourse-api-gateway-api-http-operations--edit-api-integration-pop-up-result.png]]
91
92 In this screen, there are also other things you could edit that will come in handy in other scenarios.
93
94 For example, in case the external party does not adhere to the RESTful principle or does not even publish a REST endpoint but a SOAP endpoint or
95 something else entirely you need to remember the basic principles when determining the correct HTTP Operation for the job.
96
97 For example, when you need to call a backend operation that hosts a SOAP web service from which you can retrieve data (but not create or update it) you should use the GET operation **without** a body.
98
99 In future microlearnings, we will discuss these scenarios in more detail.
100
101 == 4. Key takeaways ==
102
103 Each HTTP Method represents a certain action on a resource. Of the most frequently used ones we can make a nice comparison to the CRUD operations:
104
105 HTTP Operations: CRUD Operations:
106
107 * POST - Create
108 * GET - Read
109 * PUT - Update
110 * DELETE - Delete
111
112 In eMagiz, you start your thought process at the backend operation and from there you set up your API Gateway.
113
114 == 5. Suggested Additional Readings ==
115
116 If you are interested in this topic and want more information on it please read the help text provided by eMagiz and read the following links:
117
118 * [[REST API Tutorial>>https://www.restapitutorial.com/||target="blank"]]
119 * [[HTTP Standards>>https://www.rfc-editor.org/rfc/rfc9110.html||target="blank"]]
120
121
122 )))((({{toc/}}))){{/container}}{{/container}}