Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit b200131

Browse files
committed
fix: /event/ -> /shipment/event/; /metadata/ -> /shipment/evetn/
1 parent 933bfff commit b200131

File tree

2 files changed

+30
-30
lines changed

2 files changed

+30
-30
lines changed

README.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -313,45 +313,45 @@ All the endpoints concerning shipment lie under `http://{ip/domain}/shipment/`.
313313

314314
### Shipment Metadata
315315

316-
All the endpoints concerning shipment metadata lie under `http://{ip/domain}/metadata/`.
316+
All the endpoints concerning shipment metadata lie under `http://{ip/domain}/shipment/metadata/`.
317317

318318
#### GET
319319

320320
##### Unique
321321

322-
- Send a _get_ request on the endpoint with the unique id of a metadata - `/metadata/<METADATA_INT_ID>`
322+
- Send a _get_ request on the endpoint with the unique id of a metadata - `/shipment/metadata/<METADATA_INT_ID>`
323323
- cURL example:
324324
```bash
325-
curl -sS -X GET "http://{ip/domain}/metadata/1"
325+
curl -sS -X GET "http://{ip/domain}/shipment/metadata/1"
326326
```
327327

328328
##### All
329329

330-
- Send a _get_ request on the endpoint with "all" as arguement - `/metadata/all`
330+
- Send a _get_ request on the endpoint with "all" as arguement - `/shipment/metadata/all`
331331
- cURL example:
332332
```bash
333-
curl -sS -X GET "http://{ip/domain}/metadata/all"
333+
curl -sS -X GET "http://{ip/domain}/shipment/metadata/all"
334334
```
335335

336336
##### By Shipment
337337

338-
- Send a _get_ request on the endpoint with the unique code of a shipment - `/metadata/shipment/<SHIPMENT_CODE>`
338+
- Send a _get_ request on the endpoint with the unique code of a shipment - `/shipment/metadata/shipment/<SHIPMENT_CODE>`
339339
- cURL example:
340340
```bash
341-
curl -sS -X GET "http://{ip/domain}/metadata/shipment/S1"
341+
curl -sS -X GET "http://{ip/domain}/shipment/metadata/shipment/S1"
342342
```
343343

344344
#### DELETE
345345

346-
- Send a _delete_ request on the endpoint with the unique id of a metadata - `/metadata/<METADATA_INT_ID>`
346+
- Send a _delete_ request on the endpoint with the unique id of a metadata - `/shipment/metadata/<METADATA_INT_ID>`
347347
- cURL example:
348348
```bash
349-
curl -sS -X DELETE "http://{ip/domain}/metadata/1"
349+
curl -sS -X DELETE "http://{ip/domain}/shipment/metadata/1"
350350
```
351351

352352
#### POST and PUT
353353

354-
- Send a _post_ or a _put_ request on the endpoint (`/metadata/`) with following JSON (`application/json`) data along with `Authorization: Bearer <auth-token>` header in request body:
354+
- Send a _post_ or a _put_ request on the endpoint (`/shipment/metadata/`) with following JSON (`application/json`) data along with `Authorization: Bearer <auth-token>` header in request body:
355355
```json
356356
{
357357
"shipment": "S1",
@@ -373,50 +373,50 @@ All the endpoints concerning shipment metadata lie under `http://{ip/domain}/met
373373
"temperature": "25°C",
374374
"quality": 95
375375
}' \
376-
http://{ip/domain}/metadata
376+
http://{ip/domain}/shipment/metadata/
377377
```
378378

379379
### Shipment Events
380380

381-
All the endpoints concerning shipment events lie under `http://{ip/domain}/event/`.
381+
All the endpoints concerning shipment events lie under `http://{ip/domain}/shipment/event/`.
382382

383383
#### GET
384384

385385
##### Unique
386386

387-
- Send a _get_ request on the endpoint with the unique id of an event - `/event/<EVENT_INT_ID>`
387+
- Send a _get_ request on the endpoint with the unique id of an event - `/shipment/event/<EVENT_INT_ID>`
388388
- cURL example:
389389
```bash
390-
curl -sS -X GET "http://{ip/domain}/event/1"
390+
curl -sS -X GET "http://{ip/domain}/shipment/event/1"
391391
```
392392

393393
##### All
394394

395-
- Send a _get_ request on the endpoint with "all" as arguement - `/event/all`
395+
- Send a _get_ request on the endpoint with "all" as arguement - `/shipment/event/all`
396396
- cURL example:
397397
```bash
398-
curl -sS -X GET "http://{ip/domain}/event/all"
398+
curl -sS -X GET "http://{ip/domain}/shipment/event/all"
399399
```
400400

401401
##### By Shipment
402402

403-
- Send a _get_ request on the endpoint with the unique code of a shipment - `/event/shipment/<SHIPMENT_CODE>`
403+
- Send a _get_ request on the endpoint with the unique code of a shipment - `/shipment/event/shipment/<SHIPMENT_CODE>`
404404
- cURL example:
405405
```bash
406-
curl -sS -X GET "http://{ip/domain}/event/shipment/S1"
406+
curl -sS -X GET "http://{ip/domain}/shipment/event/shipment/S1"
407407
```
408408

409409
#### DELETE
410410

411-
- Send a _delete_ request on the endpoint with the unique id of an event - `/event/<EVENT_INT_ID>`
411+
- Send a _delete_ request on the endpoint with the unique id of an event - `/shipment/event/<EVENT_INT_ID>`
412412
- cURL example:
413413
```bash
414-
curl -sS -X DELETE "http://{ip/domain}/event/1"
414+
curl -sS -X DELETE "http://{ip/domain}/shipment/event/1"
415415
```
416416

417417
#### POST and PUT
418418

419-
- Send a _post_ or a _put_ request on the endpoint (`/event/`) with following JSON (`application/json`) data along with `Authorization: Bearer <auth-token>` header in request body:
419+
- Send a _post_ or a _put_ request on the endpoint (`/shipment/event/`) with following JSON (`application/json`) data along with `Authorization: Bearer <auth-token>` header in request body:
420420
```json
421421
{
422422
"shipment": "S1",
@@ -432,7 +432,7 @@ All the endpoints concerning shipment events lie under `http://{ip/domain}/event
432432
"shipment": "S1",
433433
"event": "Arrived at warehouse"
434434
}' \
435-
http://{ip/domain}/event
435+
http://{ip/domain}/shipment/event/
436436
```
437437

438438
### Person

webapp/api/__init__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,51 +95,51 @@
9595

9696
# Endpoints related to metadata of shipment
9797
api.add_url_rule(
98-
"/metadata/<string:id>",
98+
"/shipment/metadata/<string:id>",
9999
view_func=shipment_metadata.get,
100100
methods=["GET"],
101101
endpoint="get_metadata"
102102
)
103103
api.add_url_rule(
104-
"/metadata/shipment/<string:code>",
104+
"/shipment/metadata/shipment/<string:code>",
105105
view_func=shipment_metadata.get_all_by_shipment,
106106
methods=["GET"],
107107
endpoint="get_metadata_by_shipment"
108108
)
109109
api.add_url_rule(
110-
"/metadata/<int:id>",
110+
"/shipment/metadata/<int:id>",
111111
view_func=shipment_metadata.delete,
112112
methods=["DELETE"],
113113
endpoint="delete_metadata"
114114
)
115115
api.add_url_rule(
116-
"/metadata",
116+
"/shipment/metadata",
117117
view_func=shipment_metadata.create_or_update,
118118
methods=["POST", "PUT"],
119119
endpoint="create_or_update_metadata"
120120
)
121121

122122
# Endpoints related to events of shipment
123123
api.add_url_rule(
124-
"/event/<string:id>",
124+
"/shipment/event/<string:id>",
125125
view_func=shipment_event.get,
126126
methods=["GET"],
127127
endpoint="get_events"
128128
)
129129
api.add_url_rule(
130-
"/event/shipment/<string:code>",
130+
"/shipment/event/shipment/<string:code>",
131131
view_func=shipment_event.get_all_by_shipment,
132132
methods=["GET"],
133133
endpoint="get_events_by_shipment"
134134
)
135135
api.add_url_rule(
136-
"/event/<int:id>",
136+
"/shipment/event/<int:id>",
137137
view_func=shipment_event.delete,
138138
methods=["DELETE"],
139139
endpoint="delete_events"
140140
)
141141
api.add_url_rule(
142-
"/event",
142+
"/shipment/event",
143143
view_func=shipment_event.create_or_update,
144144
methods=["POST", "PUT"],
145145
endpoint="create_or_update_events"

0 commit comments

Comments
 (0)