Skip to content

Latest commit

 

History

History
346 lines (263 loc) · 12.6 KB

DefaultApi.md

File metadata and controls

346 lines (263 loc) · 12.6 KB

leetcode.DefaultApi

All URIs are relative to https://leetcode.com

Method HTTP request Description
api_problems_topic_get GET /api/problems/{topic}/
graphql_post POST /graphql
problems_problem_interpret_solution_post POST /problems/{problem}/interpret_solution/
problems_problem_submit_post POST /problems/{problem}/submit/
submissions_detail_id_check_get GET /submissions/detail/{id}/check/

api_problems_topic_get

Problems api_problems_topic_get(topic)

Example

from __future__ import print_function
import time
import leetcode
from leetcode.rest import ApiException
from pprint import pprint

# Configure API key authorization: cookieCSRF
configuration = leetcode.Configuration()
configuration.api_key['csrftoken'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['csrftoken'] = 'Bearer'
# Configure API key authorization: cookieSession
configuration = leetcode.Configuration()
configuration.api_key['LEETCODE_SESSION'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['LEETCODE_SESSION'] = 'Bearer'
# Configure API key authorization: headerCSRF
configuration = leetcode.Configuration()
configuration.api_key['x-csrftoken'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-csrftoken'] = 'Bearer'
# Configure API key authorization: referer
configuration = leetcode.Configuration()
configuration.api_key['Referer'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Referer'] = 'Bearer'

# create an instance of the API class
api_instance = leetcode.DefaultApi(leetcode.ApiClient(configuration))
topic = 'topic_example' # str | 

try:
    api_response = api_instance.api_problems_topic_get(topic)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->api_problems_topic_get: %s\n" % e)

Parameters

Name Type Description Notes
topic str

Return type

Problems

Authorization

cookieCSRF, cookieSession, headerCSRF, referer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

graphql_post

GraphqlResponse graphql_post(body=body)

Example

from __future__ import print_function
import time
import leetcode
from leetcode.rest import ApiException
from pprint import pprint

# Configure API key authorization: cookieCSRF
configuration = leetcode.Configuration()
configuration.api_key['csrftoken'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['csrftoken'] = 'Bearer'
# Configure API key authorization: cookieSession
configuration = leetcode.Configuration()
configuration.api_key['LEETCODE_SESSION'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['LEETCODE_SESSION'] = 'Bearer'
# Configure API key authorization: headerCSRF
configuration = leetcode.Configuration()
configuration.api_key['x-csrftoken'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-csrftoken'] = 'Bearer'
# Configure API key authorization: referer
configuration = leetcode.Configuration()
configuration.api_key['Referer'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Referer'] = 'Bearer'

# create an instance of the API class
api_instance = leetcode.DefaultApi(leetcode.ApiClient(configuration))
body = leetcode.GraphqlQuery() # GraphqlQuery | GraphQL query (optional)

try:
    api_response = api_instance.graphql_post(body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->graphql_post: %s\n" % e)

Parameters

Name Type Description Notes
body GraphqlQuery GraphQL query [optional]

Return type

GraphqlResponse

Authorization

cookieCSRF, cookieSession, headerCSRF, referer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

problems_problem_interpret_solution_post

Interpretation problems_problem_interpret_solution_post(problem, body=body)

Example

from __future__ import print_function
import time
import leetcode
from leetcode.rest import ApiException
from pprint import pprint

# Configure API key authorization: cookieCSRF
configuration = leetcode.Configuration()
configuration.api_key['csrftoken'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['csrftoken'] = 'Bearer'
# Configure API key authorization: cookieSession
configuration = leetcode.Configuration()
configuration.api_key['LEETCODE_SESSION'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['LEETCODE_SESSION'] = 'Bearer'
# Configure API key authorization: headerCSRF
configuration = leetcode.Configuration()
configuration.api_key['x-csrftoken'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-csrftoken'] = 'Bearer'
# Configure API key authorization: referer
configuration = leetcode.Configuration()
configuration.api_key['Referer'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Referer'] = 'Bearer'

# create an instance of the API class
api_instance = leetcode.DefaultApi(leetcode.ApiClient(configuration))
problem = 'problem_example' # str | 
body = leetcode.TestSubmission() # TestSubmission | Solution to test (optional)

try:
    api_response = api_instance.problems_problem_interpret_solution_post(problem, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->problems_problem_interpret_solution_post: %s\n" % e)

Parameters

Name Type Description Notes
problem str
body TestSubmission Solution to test [optional]

Return type

Interpretation

Authorization

cookieCSRF, cookieSession, headerCSRF, referer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

problems_problem_submit_post

SubmissionId problems_problem_submit_post(problem, body=body)

Example

from __future__ import print_function
import time
import leetcode
from leetcode.rest import ApiException
from pprint import pprint

# Configure API key authorization: cookieCSRF
configuration = leetcode.Configuration()
configuration.api_key['csrftoken'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['csrftoken'] = 'Bearer'
# Configure API key authorization: cookieSession
configuration = leetcode.Configuration()
configuration.api_key['LEETCODE_SESSION'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['LEETCODE_SESSION'] = 'Bearer'
# Configure API key authorization: headerCSRF
configuration = leetcode.Configuration()
configuration.api_key['x-csrftoken'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-csrftoken'] = 'Bearer'
# Configure API key authorization: referer
configuration = leetcode.Configuration()
configuration.api_key['Referer'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Referer'] = 'Bearer'

# create an instance of the API class
api_instance = leetcode.DefaultApi(leetcode.ApiClient(configuration))
problem = 'problem_example' # str | 
body = leetcode.Submission() # Submission | Solution to test (optional)

try:
    api_response = api_instance.problems_problem_submit_post(problem, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->problems_problem_submit_post: %s\n" % e)

Parameters

Name Type Description Notes
problem str
body Submission Solution to test [optional]

Return type

SubmissionId

Authorization

cookieCSRF, cookieSession, headerCSRF, referer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

submissions_detail_id_check_get

InlineResponse200 submissions_detail_id_check_get(id)

Example

from __future__ import print_function
import time
import leetcode
from leetcode.rest import ApiException
from pprint import pprint

# Configure API key authorization: cookieCSRF
configuration = leetcode.Configuration()
configuration.api_key['csrftoken'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['csrftoken'] = 'Bearer'
# Configure API key authorization: cookieSession
configuration = leetcode.Configuration()
configuration.api_key['LEETCODE_SESSION'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['LEETCODE_SESSION'] = 'Bearer'
# Configure API key authorization: headerCSRF
configuration = leetcode.Configuration()
configuration.api_key['x-csrftoken'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-csrftoken'] = 'Bearer'
# Configure API key authorization: referer
configuration = leetcode.Configuration()
configuration.api_key['Referer'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Referer'] = 'Bearer'

# create an instance of the API class
api_instance = leetcode.DefaultApi(leetcode.ApiClient(configuration))
id = leetcode.Id() # Id | Either submission id (int) or interpretation id (string)

try:
    api_response = api_instance.submissions_detail_id_check_get(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->submissions_detail_id_check_get: %s\n" % e)

Parameters

Name Type Description Notes
id Id Either submission id (int) or interpretation id (string)

Return type

InlineResponse200

Authorization

cookieCSRF, cookieSession, headerCSRF, referer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]