Repository: Cloud-CV/EvalAI

Issue:
Add swagger api documentation for remove_participant_team_from_challenge API
### Description

Hosts can use EvalAI APIs to remove participant teams from an active challenge. The remove participant team from challenge API documentation is missing documentation on EvalAI [docs](http://eval.ai/api/docs/).


### Deliverables
Add documentation for using `remove_participant_team_from_challenge` API using swagger. An example of using swagger for API documentation is available [here](https://github.com/Cloud-CV/EvalAI/blob/master/apps/jobs/views.py#L87). The documentation should provide a list of query and header params described briefly and an example.
Add swagger api documentation for remove_participant_team_from_challenge API
### Description

Hosts can use EvalAI APIs to remove participant teams from an active challenge. The remove participant team from challenge API documentation is missing documentation on EvalAI [docs](http://eval.ai/api/docs/).


### Deliverables
Add documentation for using `remove_participant_team_from_challenge` API using swagger. An example of using swagger for API documentation is available [here](https://github.com/Cloud-CV/EvalAI/blob/master/apps/jobs/views.py#L87). The documentation should provide a list of query and header params described briefly and an example.


Discussion:
Hello Sir,
I have deployed an machine learning model using Swagger API, So, I know how it works.
I am also new to open source contribution .
Can you please assign this issue to me ?
I want to help in resolving it and want to contribute to open source community.

@17Rajat yes, go ahead. 
> @17Rajat yes, go ahead.

Thanks

Hello Sir, I am Nikhilesh. I have experience in writing swagger documentation can I work on it if it is still open?
Hi @Ram81 , Can I work on this issue?
Thanks
Hello @Ram81 @RishabhJain2018 
Small doubt,
I'm working on this issue but I'm stuck at one point. I was trying to test the API using postman then I got an error "Authentication credentials were not provided." So I passed the Token to the authorization part but still I'm getting this error. Can you provide some insights?
I tried searching on google but got nothing.
Thanks
Hello Sir,
I have deployed an machine learning model using Swagger API, So, I know how it works.
I am also new to open source contribution .
Can you please assign this issue to me ?
I want to help in resolving it and want to contribute to open source community.

@17Rajat yes, go ahead. 
> @17Rajat yes, go ahead.

Thanks

Hello Sir, I am Nikhilesh. I have experience in writing swagger documentation can I work on it if it is still open?
Hi @Ram81 , Can I work on this issue?
Thanks
Hello @Ram81 @RishabhJain2018 
Small doubt,
I'm working on this issue but I'm stuck at one point. I was trying to test the API using postman then I got an error "Authentication credentials were not provided." So I passed the Token to the authorization part but still I'm getting this error. Can you provide some insights?
I tried searching on google but got nothing.
Thanks

Resolving patch:
diff --git a/apps/participants/views.py b/apps/participants/views.py
--- a/apps/participants/views.py
+++ b/apps/participants/views.py
@@ -1,5 +1,7 @@
 from django.contrib.auth.models import User
 
+from drf_yasg import openapi
+from drf_yasg.utils import swagger_auto_schema
 from rest_framework import permissions, status
 from rest_framework.decorators import (
     api_view,
@@ -456,6 +458,35 @@ def get_participant_team_details_for_challenge(request, challenge_pk):
         return Response(response_data, status=status.HTTP_404_NOT_FOUND)
 
 
+@swagger_auto_schema(
+    methods=["post"],
+    manual_parameters=[
+        openapi.Parameter(
+            name="challenge_pk",
+            in_=openapi.IN_PATH,
+            type=openapi.TYPE_NUMBER,
+            description="Challenge pk",
+            required=True,
+        ),
+        openapi.Parameter(
+            name="participant_team_pk",
+            in_=openapi.IN_PATH,
+            type=openapi.TYPE_NUMBER,
+            description="Participant team pk",
+            required=True,
+        ),
+    ],
+    operation_id="remove_participant_team_from_challenge",
+    responses={
+        status.HTTP_200_OK: openapi.Response(""),
+        status.HTTP_400_BAD_REQUEST: openapi.Response(
+            "{'error': 'Team has not participated in the challenge'}"
+        ),
+        status.HTTP_401_UNAUTHORIZED: openapi.Response(
+            "{'error': 'Sorry, you do not have permissions to remove this participant team'}"
+        )
+    },
+)
 @api_view(["POST"])
 @throttle_classes([UserRateThrottle])
 @permission_classes((permissions.IsAuthenticated, HasVerifiedEmail))


Test patch: