Hide last authors
Achraf El Kari 1.1 1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc/}}
3 {{/box}}
4
Outhman Moustaghfir 1.2 5 = Introduction =
Achraf El Kari 1.1 6
Achraf El Kari 7.1 7 We will go through all endpoints needed to manage the Tracking type entity.
Achraf El Kari 1.1 8
Outhman Moustaghfir 1.4 9 = Endpoints =
10
Achraf El Kari 9.2 11 **PS:** __//For all those endpoints, the env params are mandatory on the header, otherwise you got an error 400 (BAD PARAMS).//__
Achraf El Kari 7.3 12
13
Achraf El Kari 9.2 14 |(% style="width:202px" %)**URL [method]**|(% style="width:126px" %)**Description**|(% style="width:250px" %)**Input example**|(% style="width:449px" %)**Output example**
15 |(% style="width:202px" %)(((
Achraf El Kari 7.2 16 /rest/trackingType [GET]
17
18
19 hedear : Authorization + env => Mandatory
Achraf El Kari 7.4 20
Achraf El Kari 9.2 21 )))|(% style="width:126px" %)(((
22 get **all **tracking Types of the giving environment ==>
Achraf El Kari 7.4 23
24 order, orderLine...
Achraf El Kari 9.2 25 )))|(% style="width:250px" %)(no input required)|(% style="width:449px" %)[[attach:TrackingTypes.json||target="_blank"]]
Achraf El Kari 9.3 26 |(% style="width:202px" %)/rest/trackingType [POST]|(% style="width:126px" %)(((
27 Insert or update new TrackingType
28
29
30 If the trackingType already exists, then it will be updated
31 )))|(% style="width:250px" %){{code language="json"}}{
32 "alias":"order",
33 "env":"iXPath",
34 "label":{
Achraf El Kari 9.4 35 "fr":"Commande",
Achraf El Kari 9.3 36 "en":"Order"
37 },
38 "dataTypes":[
39 {
40 "alias":"orderNumber",
41 "label":{
42 "fr":"Numéro de commande",
43 "en":"Order Number"
44 },
45 "type":"NUMBER",
46 "size":10,
47 "mandatory":true,
48 "isList":false
49 },
50 {
51 "alias":"orderLine",
52 "label":{
53 "fr":"Ligne de commande",
54 "en":"Order Lines"
55 },
56 "type":"TRACKING",
57 "trackingType":"orderLine",
58 "mandatory":true,
59 "isList":false
60 }
61 ]
Achraf El Kari 9.2 62 }{{/code}}|(% style="width:449px" %){{code language="JSON"}}{
Outhman Moustaghfir 1.8 63 "timestamp": 1620217014704,
64 "status": "200",
65 "data": [
66 {
67 "date": "Tue May 04 16:37:49 GMT+01:00 2021",
68 "current": "true",
69 "author": "person1232",
70 "id": "11e8707eb50e25c00a62e4efedb5f6071ec7e27e",
71 "message": "version 2"
72 },
73 {
74 "date": "Tue May 04 13:28:12 GMT+01:00 2021",
75 "current": "false",
76 "author": "person1",
77 "id": "4b64d02451f47d9cb91d08faa986c941deef0f5c",
78 "message": "version 1"
79 }
80 ]
81 }{{/code}}
Achraf El Kari 9.2 82 |(% style="width:202px" %)/rest/git/commit [POST]|(% style="width:126px" %)commit changes in files with a message|(% style="width:250px" %){{code language="JSON"}}{
Outhman Moustaghfir 1.10 83 "files":
84 [
85 {"fileName" : "newFile.xml"},
86 {"fileName" : "/dir/modifiedFile.pdf"}
87 ],
88 "message": "this is a commit message"
Outhman Moustaghfir 1.13 89 }{{/code}}|(% style="width:449px" %)(((
Outhman Moustaghfir 1.10 90 it returns a String with the commit message meaning that the commit has passed successfully.
Outhman Moustaghfir 1.4 91
Outhman Moustaghfir 1.10 92 eg :
93
Outhman Moustaghfir 1.11 94 {{code language="JSON"}}{
95 "timestamp": 1620217700570,
96 "status": "200",
97 "data": "this is a commit message"
98 }{{/code}}
Outhman Moustaghfir 1.10 99 )))
Achraf El Kari 9.2 100 |(% style="width:202px" %)(((
Outhman Moustaghfir 1.13 101 /rest/git/switchComit/{id}
Outhman Moustaghfir 1.10 102
Outhman Moustaghfir 1.13 103 [GET]
Achraf El Kari 9.2 104 )))|(% style="width:126px" %)(((
Outhman Moustaghfir 1.15 105 switch to a certain version and return the history of all commits.
106
Outhman Moustaghfir 1.26 107 **__NB __**: if there are some modified files in the current version, these files will be moved to a new directory called :
Outhman Moustaghfir 1.16 108
109 .../archive/git-{timestamp}
Achraf El Kari 9.2 110 )))|(% style="width:250px" %)(((
111
Outhman Moustaghfir 1.13 112
Outhman Moustaghfir 1.17 113
Outhman Moustaghfir 1.30 114 )))|(% style="width:449px" %)(((
115 {{code language="JSON"}}
116 {
Outhman Moustaghfir 1.15 117 "timestamp": 1620217014704,
118 "status": "200",
119 "data": [
120 {
121 "date": "Tue May 04 16:37:49 GMT+01:00 2021",
122 "current": "false",
123 "author": "person1232",
124 "id": "11e8707eb50e25c00a62e4efedb5f6071ec7e27e",
125 "message": "version 2"
126 },
127 {
128 "date": "Tue May 04 13:28:12 GMT+01:00 2021",
129 "current": "true",
130 "author": "person1",
131 "id": "4b64d02451f47d9cb91d08faa986c941deef0f5c",
132 "message": "version 1"
133 }
134 ]
Outhman Moustaghfir 1.30 135 }
136 {{/code}}
137 )))
Achraf El Kari 9.2 138 |(% style="width:202px" %)/rest/git/update [GET]|(% style="width:126px" %)(((
Outhman Moustaghfir 1.25 139 Integrates and pulls changes from a remote repository into the current branch.
Achraf El Kari 9.2 140 )))|(% style="width:250px" %)(no input required)|(% style="width:449px" %)(((
Outhman Moustaghfir 1.26 141 it returns a success message.
Outhman Moustaghfir 1.14 142
Outhman Moustaghfir 1.26 143 eg :
144
145 {{code language="JSON"}}
146 {
147 "timestamp": 1620219625637,
148 "status": "200",
149 "data": "branch is now updated"
150 }
151 {{/code}}
152 )))
Achraf El Kari 9.2 153 |(% style="width:202px" %)/rest/environment/init [POST]|(% style="width:126px" %)(((
Outhman Moustaghfir 1.28 154 Clone a git repository into the directory of the current environment,
Outhman Moustaghfir 1.26 155
Outhman Moustaghfir 1.29 156 if it doesn't exist it creates a new directory and initialize the repo,
Outhman Moustaghfir 1.28 157
Outhman Moustaghfir 5.4 158 if the directory exists, the endpoint renames the directory and creates a new one and clones the repository.
Achraf El Kari 9.2 159 )))|(% style="width:250px" %)(no input required)|(% style="width:449px" %)(((
Outhman Moustaghfir 1.29 160 it returns a "success" message :
161
162 eg :
163
Outhman Moustaghfir 1.30 164 {{code language="JSON"}}
165 {
166 "timestamp": 1620229625932,
167 "status": "200",
Outhman Moustaghfir 5.2 168 "data": "Repository initialized successfully !"
Outhman Moustaghfir 1.30 169 }
170 {{/code}}
Outhman Moustaghfir 1.29 171 )))
Achraf El Kari 9.2 172 |(% style="width:202px" %)/rest/git/checkout/{branch} [POST]|(% style="width:126px" %)switch to a certain branch|(% style="width:250px" %)(((
Outhman Moustaghfir 4.1 173 the {branch} must be replaced by the name of the branch destination.
Outhman Moustaghfir 1.29 174
Outhman Moustaghfir 4.1 175 eg : /rest/git/checkout/master
176
177 /rest/git/checkout/develop
178 )))|(% style="width:449px" %)(((
179 it returns a "success" message of checkout branch.
180
181 eg :
182
183 {{code language="JSON"}}
184 {
185 "timestamp": 1620229625932,
186 "status": "200",
187 "data": "switched to branch : master"
188 }
189 {{/code}}
190 )))
Achraf El Kari 9.2 191 |(% style="width:202px" %)(((
Outhman Moustaghfir 4.1 192 /rest/git/newbranch/{branch}
193
194 [POST]
Achraf El Kari 9.2 195 )))|(% style="width:126px" %)create and switch to a new branch |(% style="width:250px" %)(((
Outhman Moustaghfir 4.1 196 the {branch} must be replaced by the name of the branch destination.
197
198 eg :
199
200 /rest/git/checkout/newBranch
201 )))|(% style="width:449px" %)(((
202 it returns a "success" message of the branch creation.
203
204 eg :
205
206 {{code language="JSON"}}
207 {
208 "timestamp": 1620229625932,
209 "status": "200",
210 "data": "new branch has been created : newBranch"
211 }
212 {{/code}}
213 )))
Achraf El Kari 9.2 214 |(% style="width:202px" %)/rest/git/revert [POST]|(% style="width:126px" %)switch the modified file to the initial head version. |(% style="width:250px" %) |(% style="width:449px" %)(((
Outhman Moustaghfir 5.2 215 it returns a "success" message.
Outhman Moustaghfir 4.1 216
Outhman Moustaghfir 5.2 217 eg :
218
219 {{code language="JSON"}}
220 {
221 "timestamp": 1620229625932,
222 "status": "200",
223 "data": "the selected files has been synchronized to HEAD successfully !"
224 }
225 {{/code}}
226 )))
227
Outhman Moustaghfir 5.1 228 = Errors =
229
230 below, you can find an example of technical and functional errors :
231
232 {{code language="JSON"}}
233 {
234 "timestamp": 1620221672951,
235 "status": "500",
236 "error": "JSON file is not valid",
237 "thechnicalError": "JSONObject[\"fileName\"] not found."
238 }
239 {{/code}}
240
241 the functional error is shown with the JSON key "error", while technical error is stored in the "thechnicalError" key.
242
243
Outhman Moustaghfir 3.1 244 == ==
This wiki is hosted and managed by iXPath
Powered by XWiki 13.3 debian