From 144d6daa6fdac918340c36d77c2da49910e133cd Mon Sep 17 00:00:00 2001 From: omma Date: Wed, 21 Aug 2024 14:58:22 +0330 Subject: [PATCH 1/3] end point doc work in progress --- ReadMe | 216 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 216 insertions(+) create mode 100644 ReadMe diff --git a/ReadMe b/ReadMe new file mode 100644 index 0000000..3f65a9d --- /dev/null +++ b/ReadMe @@ -0,0 +1,216 @@ +## Well Service End Points + +## JWT related end-points +### 1. Get token +**URL:** +.../token/ +**Method**: +POST +**Input**: +1. Request body: +```python +{ +"username": "omma", +"password": "123456" +} +``` +## Well related end-points +### 1. create +**URL:** +.../wells/create/ +**Method**: +POST +**Input**: +1. Request body: +```python +{ +"license_code": "", +"representor": "", +"subscriptionـcode": "", +} +``` +2. Header: + ```python +{"Authorization" : f"Bearer {access_token}" } +``` +**Output:** +1. OK: +```python +({"data": ""}, +status=status.HTTP_200_OK) +``` +2. Errors: +```python +1 ({"message":f'<{data["license_code"]} already exists>'}, +status=status.HTTP_409_CONFLICT) + +2 ({"message": serializer.errors}, +status=status.HTTP_400_BAD_REQUEST) + +3 ({"message": "<_Internal Server Error>", +status=status.HTTP_500_INTERNAL_SERVER_ERROR) +``` +--------- +### 2. Get by ID +**URL:** +.../wells// +**Method**: +GET +**Input**: +1. URL: well id +2. Header: +```python +{"Authorization" : f"Bearer {access_token}" } +``` +**Output:** +1. OK: +```python +({"data": ""}, +status=status.HTTP_200_OK) +``` +2. Errors: +```python +1 ({"message": "Not Found"}, +status=status.HTTP_404_NOT_FOUND) + +2 ({"message": "<_Internal Server Error>", +status=status.HTTP_500_INTERNAL_SERVER_ERROR) +``` +------------- +### 3. Get All +**URL:** +.../wells/ +**Method**: +GET +**Input**: +1. Header: +```python +{"Authorization" : f"Bearer {access_token}" } +``` +**Output:** +1. OK: +```python +({"data": ""}, +status=status.HTTP_200_OK) +``` +2. Errors: +```python +1 ({"message": "<_Internal Server Error>", +status=status.HTTP_500_INTERNAL_SERVER_ERROR) +``` +--------------- +### 4. Delete +**URL:** +...wells//delete/ + +**Method**: +DELETE + +**Input**: +1. URL: well id +2. Header: + ```python +{"Authorization" : f"Bearer {access_token}" } +``` +**Output:** +1. OK: +```python +({"data": "", +"message": f"Successfully removed {instance.license_code}"}, +status=status.HTTP_200_OK) +``` +2. Errors: +```python + +1.({"message": "Not Found"}, +status=status.HTTP_404_NOT_FOUND) + +2 ({"message": "<_Internal Server Error>", +status=status.HTTP_500_INTERNAL_SERVER_ERROR) +``` +--------- + +### 5. Update +**URL:** +...wells//update/ + +**Method**: +PUT + +**Input**: +1. URL: well id +2. Header: + ```python +{"Authorization" : f"Bearer {access_token}" } +``` +3. Request body: +```python +{ +"license_code": "", +"representor": "", +"subscriptionـcode": "", +} +``` +**Output:** +5. OK: +```python +( +{"data": "", +"message": f""}, +status=status.HTTP_200_OK) +``` +6. Errors: +```python + +7. ({"message": "Not Found"}, +status=status.HTTP_404_NOT_FOUND) + +8. ({"message":serializer.errors}, +status=status.HTTP_400_BAD_REQUEST) +2 ({"message": "<_Internal Server Error>", +status=status.HTTP_500_INTERNAL_SERVER_ERROR) +``` +--------- + +### 6. Edit +**URL:** +...wells//edit/ + +**Method**: +PUT + +**Input**: +1. URL: well id +2. Header: + ```python +{"Authorization" : f"Bearer {access_token}" } +``` +3. Request body: +```python +{ +"license_code": "", +"representor": "", +"subscriptionـcode": "", +} +``` + +**Output:** +1. OK: +```python +({"data": "", +"message": f""}, +status=status.HTTP_200_OK) +``` +2. Errors: +```python + +1. ({"message": "Not Found"}, +status=status.HTTP_404_NOT_FOUND) + +2. ({"message":serializer.errors}, +status=status.HTTP_400_BAD_REQUEST) + +2 ({"message": "<_Internal Server Error>", +status=status.HTTP_500_INTERNAL_SERVER_ERROR) +``` +--------- From 5f1bc59f4c554debc6625bf1e4dca025187742ca Mon Sep 17 00:00:00 2001 From: omma Date: Wed, 21 Aug 2024 14:59:29 +0330 Subject: [PATCH 2/3] Update ReadMe.md --- ReadMe => ReadMe.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ReadMe => ReadMe.md (100%) diff --git a/ReadMe b/ReadMe.md similarity index 100% rename from ReadMe rename to ReadMe.md From cd7f94c202fd6143ff819e0d23ad1b0450382438 Mon Sep 17 00:00:00 2001 From: omma Date: Wed, 21 Aug 2024 16:30:46 +0330 Subject: [PATCH 3/3] Update ReadMe.md --- ReadMe.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 3f65a9d..7e505ac 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -10,8 +10,8 @@ POST 1. Request body: ```python { -"username": "omma", -"password": "123456" +"username": "", +"password": "" } ``` ## Well related end-points