Resource check is token valid.
    ---
    request_serializer: serializers.CheckToken
    type:
        username:
            required: true
            type: string
            description: token related user

    responseMessages:
        - code: 200
          message: Token is valid

        - code: 400
          message: Token is not valid

        - code: 401
          message: Unauthorized

def check_token(request):
    """
    Resource check is token valid.
    ---
    request_serializer: serializers.CheckToken
    type:
        username:
            required: true
            type: string
            description: token related user

    responseMessages:
        - code: 200
          message: Token is valid

        - code: 400
          message: Token is not valid

        - code: 401
          message: Unauthorized
    """
    serializer = serializers.CheckToken(data=request.data)
    serializer.is_valid(raise_exception=True)
    token = serializer.validated_data['token']
    logger.debug('Token correct', extra={'token': token, 'username': token.user.username})
    return Response({'username': token.user.username})