NAV Navbar
shell python
  • Introduction
  • Authentication
  • Errors
  • Pagination
  • Rate Limits
  • Test API
  • Invite API
  • Problem API
  • Problem Testcase API
  • PDF report API
  • LearnFeed Item API
  • Submission API
  • Code Lab API
  • Embed API
  • Webhooks
  • Help
  • Changelog
  • Introduction

    Welcome to the DoSelect API documentation! These APIs provide you access to various resources and functionalities of the DoSelect platform.

    The Platform APIs are organized around REST, and can be accessed at api.doselect.com. All request and response bodies, including errors, are encoded in JSON. These APIs include resources like Tests, Invites, Problems, Submissions and Users.

    The Embed API gives you a simple JavaScript interface to embed resources like tests and problems on your front-end application directly -- without you having to store any kind of state data.

    Using these APIs, you can leverage the DoSelect platform to augment your application, or build useful tools and integrations to enhance your workflows.

    Authentication

    Example request with authentication:

    import requests
    
    url = 'https://api.doselect.com/platform/v1/test'
    
    headers = {
        "DoSelect-API-Key": "88d4266fd4e6338d13b845fcf28",
        "DoSelect-API-Secret": "385041b7bbc2320471b8551d"
    }
    
    response = requests.get(url, headers=headers)
    
    curl "https://api.doselect.com/platform/v1/test" \
      -H "DoSelect-API-Key: 88d4266fd4e6338d13b845fcf28" \
      -H "DoSelect-API-Secret: 385041b7bbc2320471b8551d"
    

    Access to the Platform APIs are authenticated using your team account's API_KEY and API_SECRET. These credentials are available in your team dashboard under the path Team Settings > Integrations.

    You must include the API_KEY and API_SECRET in custom request headers, DoSelect-API-Key and DoSelect-API-Secret respectively. Because your API_SECRET is sensitive information and allows access to your account, we strongly advise you to not expose your API_SECRET in publicly accessible avenues such as GitHub, or in client-side code.

    Errors

    The APIs return standard HTTP success or error status codes. For errors, extra information about what went wrong will also be sent in the respose, encoded in JSON. The various HTTP codes we might return are listed below.

    Code Title Description
    200 OK The request was successful.
    400 Bad request The request was malformed or in an unaccepted format.
    401 Unauthorized Your API_KEY and/or API_SECRET is wrong or missing.
    403 Forbidden The requested resource was not accessible to you.
    404 Not found The specified resource was not be found.
    405 Method not allowed You were trying to access the resource using an invalid HTTP method.
    50X Internal server error An error occured with our APIs.

    Error messages in embed.

    Code Error Message State
    E101 Invalid request body. INIT
    E102 The API Key is invalid. INIT
    E103 The user cannot be verified.Please check the user_hash corresponding to given email. INIT
    E104 You’re trying to open the embed with the email example@doselect.com which belongs to a team admin user account on DoSelect. INIT
    E105 data-slug attribute not found for this embed. INIT
    E106 Invalid referrer host. INIT
    E107 Please Provide API key. INIT
    E108 Token Invalid. INIT
    E109 Email address invalid. INIT
    E201 Permission denied to this resource. Please add this test to your learn feed. Test Embed
    E202 Error creating the invite: Invalid invite email provided. Test Embed
    E203 Error creating the invite: Atleast one problem required in test to send an invite. Test Embed
    E204 Error creating the invite: Cannot invite candidates for an archived test. Test Embed
    E205 Error creating the invite: Expiry can't be lesser than current time. Test Embed
    E206 Error loading test embed: The test invite has expired. Please contact your test administrator. Test Embed
    E301 You don't seem to have access to this Code Lab, or it's not published yet. CodeLab Embed
    E302 Error creating the invite: Cannot create CodeLabInvite for a recruiter. CodeLab Embed
    E303 Error creating the invite: CodeLabInvite - empty 'email' field not allowed. CodeLab Embed
    E304 Error creating the invite: CodeLabInvite - empty 'codelab' field not allowed. CodeLab Embed
    E305 Error creating the invite: Invite for email ex@doselect.com and codelab java_test already exists. CodeLab Embed
    E401 Permission denied to this resource. Please add this problem to your learn feed. Problem Embed
    E501 The organization account isn't active! Please contact support@doselect.com Problem, Test, CodeLab Embed
    E502 There are no credits left! Please contact support@doselect.com Test Embed

    Pagination

    API endpoints that return a collection of results are always paginated, and contain a meta object with pagination details. The objects object contains the list of resource objects in such responses.

    Meta

    {
        "meta": {
                "limit": 100,
                "next": "/platform/v1/test?limit=100&offset=200",
                "offset": 100,
                "previous": "/platform/v1/test?limit=100&offset=0",
                "total_count": 217
        },
        "objects":[
            {
                ...
            },
            {
                ...
            }
        ]
    }
    

    The meta object contains the following information:

    Parameter Description
    limit The page size for this request. This is set to 10 by default.
    offset The offset of the first object sent in this response.
    next The resource URI of the next page in this resource list. This field would be null if there's no next page.
    previous The resource URI of the previous page in this resource list. This field would be null if there's no previous page.
    total_count The total number of objects in this resource list.

    Rate Limits

    The overview documentation describes the rate limit rules. This will help us prevent a Denial-of-Service (DoS) attack by a malicious user in case of our clients' API key or embeds becoming exposed publicly.

    Platform API limits

    Request

    import requests
    
    url = 'https://api.doselect.com/platform/v1/test'
    headers = {
        "DoSelect-Api-Key": "88d4266fd4e6338d13b845fcf28",
        "DoSelect-Api-Secret": "385041b7bbc2320471b8551d"
    }
    response = requests.get(url, headers=headers)
    
    curl "https://api.doselect.com/platform/v1/test" \
      -H "DoSelect-Api-Key: 88d4266fd4e6338d13b845fcf28" \
      -H "DoSelect-Api-Secret: 385041b7bbc2320471b8551d"
    

    Response

    HTTP/1.1 200 OK
    Date: Thu, 31 May 2018 17:27:06 IST
    Status: 200 OK
    
    <Data>
    
    X-RateLimit-Limit: 10000
    X-RateLimit-Remaining: 9999
    X-RateLimit-Reset: 1527750919
    
    

    The platform APIs will have a per-hour limit based on the request type. These APIs will also have a per-second rate limit of 200. If a request fails due to the per second limit, then it will not be counted against the hourly limit. While calculating the rate-limit, if an API call has returned a 4xx response, it will be counted.

    These limits will be based on your unique API key.

    The per hour rate limits are:

    Request Method Limit per hour
    GET 15,000
    POST 10,000
    PUT 2,000
    PATCH 4,000
    DELETE 2,000

    The platform APIs will have the following headers which will contain information regarding the rate-limit.

    Header Description
    X-RateLimit-Limit An integer denoting the limit for the request method type.
    X-RateLimit-Remaining An integer denoting the number of requests remaining.
    X-RateLimit-Reset An integer denoting the epoch time of the next reset of limits.

    Embed API limits

    The embed APIs will be rate limited to 200 requests per second. These limits will be calculated based on the unique session ID to prevent a single malicious user from affecting the services.

    Test API

    The Test API lets you retrieve tests that have been created in your team.

    The test information which can be accessed from our APIs will contain the following information:

    Field Name Type Description
    resource_uri string The URI for a particular test
    slug string The identifier for that test
    name string The name of the test
    is_usable boolean If true, this test is active and has more than 1 problems in it
    archived boolean If false, this test cannot be taken
    instructions string The instructions for the test taker
    duration integer The duration of the test in seconds
    total_problems integer The total number of problems in the test
    total_sections integer The total number of sections in the test
    cutoff integer The cutoff marks for a test
    level string The level of this test
    public_access_url string This will be the publically accessible url for this test
    public_access_password string This will be the password if any, for accessing the test on the public_access_url
    start_time string This will contain the start time of the test in a date time string
    end_time string This will contain the end time of the test in a date time string
    redirection_url string After the test, the user will be redirected to this URL
    tags list
    sections list This will contain a list of dictionaries with information about each section of the test
    settings dictionary
    total_test_score integer The total score for a test
    in_learn_feed boolean If true, this test is added to the learn feed

    The aforementioned settings will have the following information:

    Field Name Type Description
    secure_mode boolean If true, it indicates tha the test has secure mode on
    webcam_proctoring boolean If true, it indicates tha the test has webcam proctoring on
    custom_fields list A list of custom fields
    test_administrators list A list of test administrators
    invite_expiry_enabled boolean If true, indicates that the invites can expire
    invite_expiry_days integer Indicates the number of days for which an invite of this test will be active

    Get all tests

    Request

    import requests
    
    url = 'https://api.doselect.com/platform/v1/test'
    headers = {
        "DoSelect-Api-Key": "88d4266fd4e6338d13b845fcf28",
        "DoSelect-Api-Secret": "385041b7bbc2320471b8551d"
    }
    response = requests.get(url, headers=headers)
    
    curl "https://api.doselect.com/platform/v1/test" \
      -H "DoSelect-Api-Key: 88d4266fd4e6338d13b845fcf28" \
      -H "DoSelect-Api-Secret: 385041b7bbc2320471b8551d"
    

    Response

    {
        "objects": [
            {
                "archived": false,
                "cutoff": 40,
                "duration": 120,
                "end_time": null,
                "in_learn_feed": true,
                "instructions": "<ol><li><!--block-->This is an online programming test by Doselect.</li>",
                "is_usable": true,
                "level": "EAS",
                "name": "Sample Test",
                "public_access_password": null,
                "public_access_url": null,
                "resource_uri": "/platform/v1/test/esows",
                "sections": [
                    {
                        "description": "",
                        "duration": 0,
                        "name": "Section 1",
                        "num_problems": 1,
                        "problems": [
                            {
                                "allowed_technologies": [],
                                "level": "MED",
                                "name": "Create a decorator",
                                "problem_type": "SCR",
                                "score": 100,
                                "slug": "rra3l"
                            }
                        ],
                        "randomization": {
                            "sampling": "1 out of 1",
                            "shuffle": false
                        },
                        "slug": "section-1"
                    }
                ],
                "settings": {
                    "custom_fields": [],
                    "invite_expiry_days": 15,
                    "invite_expiry_enabled": true,
                    "secure_mode": true,
                    "test_administrators": [],
                    "webcam_proctoring": true
                },
                "slug": "esows",
                "start_time": null,
                "tags": [],
                "total_candidates": 1,
                "total_problems": 1,
                "total_sections": 1,
                "redirection_url": "https://www.doselect.com",
                "total_test_score": 100
            },
    
        ]
    }
    

    This endpoint retrieves all tests that exist in your team's account.

    HTTP Request

    GET https://api.doselect.com/platform/v1/test

    Search for tests

    The list endpoint enables you to search for tests as well, the constraints of which can be controlled via GET parameters listed below. The query can contain any combination of these parameters.

    Parameter name Possible values Description
    in_learn_feed true, false Filter on learn feed tests
    archived true, false Filter on archived status

    Filter candidates report uri

    The list endpoint enables you to filter for all candidates who have given test. The query can contain any combination of these parameters.

    Parameter name Required Possible values Description
    candidates Yes true, false Allows to filter for candidates reports for given time
    from Yes datetime (%Y-%m-%d %H:%M:%S) Start datetime for reports to fetch (Requires candidates parameter to be true)
    to Yes datetime (%Y-%m-%d %H:%M:%S) End datetime for reports to fetch (Requires candidates parameter to be true)

    Get one test

    Request

    import requests
    
    url = 'https://api.doselect.com/platform/v1/test/esows'
    headers = {
        "DoSelect-Api-Key": "88d4266fd4e6338d13b845fcf28",
        "DoSelect-Api-Secret": "385041b7bbc2320471b8551d"
    }
    response = requests.get(url, headers=headers)
    
    curl "https://api.doselect.com/platform/v1/test/esows" \
      -H "DoSelect-Api-Key: 88d4266fd4e6338d13b845fcf28" \
      -H "DoSelect-Api-Secret: 385041b7bbc2320471b8551d"
    

    Response

    {
        "archived": false,
        "cutoff": 40,
        "duration": 120,
        "end_time": null,
        "instructions": "<ol><li><!--block-->This is an online programming test by Doselect.</li>",
        "is_usable": true,
        "level": "EAS",
        "name": "Sample Test",
        "public_access_password": null,
        "public_access_url": null,
        "resource_uri": "/platform/v1/test/esows",
        "sections": [
            {
                "description": "",
                "duration": 0,
                "name": "Section 1",
                "num_problems": 1,
                "problems": [
                    {
                        "allowed_technologies": [],
                        "level": "MED",
                        "name": "Create a decorator",
                        "problem_type": "SCR",
                        "score": 100,
                        "slug": "rra3l"
                    }
                ],
                "randomization": {
                    "sampling": "1 out of 1",
                    "shuffle": false
                },
                "slug": "section-1"
            }
        ],
        "settings": {
            "custom_fields": [],
            "invite_expiry_days": 15,
            "invite_expiry_enabled": true,
            "secure_mode": true,
            "test_administrators": [],
            "webcam_proctoring": true
        },
        "slug": "esows",
        "start_time": null,
        "tags": [],
        "total_candidates": 1,
        "total_problems": 1,
        "total_sections": 1,
        "redirection_url": "https://www.doselect.com",
        "total_test_score": 100
    }
    

    A test is identified by a unique slug that gets generated during creation. This endpoint retrieves a specific test:

    HTTP Request

    GET https://api.doselect.com/platform/v1/test/<slug>

    Get all candidates of a test

    Request

    import requests
    
    url = 'https://api.doselect.com/platform/v1/test/esows/candidates'
    headers = {
        "DoSelect-Api-Key": "88d4266fd4e6338d13b845fcf28",
        "DoSelect-Api-Secret": "385041b7bbc2320471b8551d"
    }
    response = requests.get(url, headers=headers)
    
    curl "https://api.doselect.com/platform/v1/test/esows/candidates" \
      -H "DoSelect-Api-Key: 88d4266fd4e6338d13b845fcf28" \
      -H "DoSelect-Api-Secret: 385041b7bbc2320471b8551d"
    

    Response

    {
        "objects": [
            {
                "email": "donnie@campushash.com",
                "expiry": "2015-06-22T08:01:50.960070",
                "report": {
                    "report_uri": "/platform/v1/test/esows/candidates/donnie@campushash.com/report",
                    "time_taken": null,
                    "total_problems": 2,
                    "total_score": null,
                    "total_solutions": null
                },
                "resource_uri": "",
                "status": "accepted",
                "test": "/platform/v1/test/esows"
            },
    
        ]
    }
    

    This endpoint retrieves all candidates of a test.

    HTTP Request

    GET https://api.doselect.com/platform/v1/test/<slug>/candidates

    The candidate information which can be accessed from our APIs will contain the following information:

    Field Name Type Description
    resource_uri string The URI for a particular candidate
    email string The email of the candidate
    expiry string The datetime string about the expiry date of this candidate's invite
    status string It indicates whether the candidate has accepted/rejected/not responded to the invite
    test string The URI of the test
    candidate_access_url string The public access URL of the test for the candidate
    report dictionary The information about the report of this candidate

    The aforementioned report dictionary will contain the following information:

    Field Name Type Description
    report_uri string The URI of the report of the candidate for this test, if it exists
    time_taken integer The time taken by this candidate for the test in seconds
    total_score float The total score of this candidate
    total_solutions integer The number of solutions submitted by the candidate
    total_problems integer The number of problems in the test

    Get a candidate's report

    Request

    import requests
    
    url = 'https://api.doselect.com/platform/v1/test/4242/candidates/donnie@campushash.com/report'
    headers = {
        "DoSelect-Api-Key": "88d4266fd4e6338d13b845fcf28",
        "DoSelect-Api-Secret": "385041b7bbc2320471b8551d"
    }
    response = requests.get(url, headers=headers)
    
    curl "https://api.doselect.com/platform/v1/test/4242/candidates/donnie@campushash.com/report" \
      -H "DoSelect-Api-Key: 88d4266fd4e6338d13b845fcf28" \
      -H "DoSelect-Api-Secret: 385041b7bbc2320471b8551d"
    

    Response

    {
        "accepted": 0,
        "attempted": 1,
        "email": "donnie@campushash.com",
        "ended_at": "2016-07-08T07:26:03.549447",
        "insights": {
            "technologies_used": [
                "julia"
            ],
            "tags": []
        },
        "test_name": "Python Development Test", 
        "is_submitted": true,
        "status": "PAS",
        "max_score": 100,
        "quality_analysis": [
            {
                "labels": "Bug Risk",
                "value": 3
            },
    
        ],
        "rejected": 0,
        "resource_uri": "",
        "sections": [
            {
                "name": "Section 1",
                "duration": 0,
                "slug": "bb0bf780046a4c96bc0fdef5ba219cf0",
                "problem_ids": [166800, 218600, 218519, 218612, 218510],
                "problems": [
                    {
                        "insights": [
                            "Exceptions"
                        ],
                        "level": "EAS",
                        "name": "Whois Search Tool",
                        "problem_type": "SCR",
                        "score": 50,
                        "slug": "shjx7",
                        "penalty": 0,
                        "is_multi_correct": false,
                        "solution": {
                            "is_submitted": true,
                            "score": "0.0",
                            "slug": "2pda3",
                            "status": "NRE",
                            "worst_score": 0.0,
                            "best_score": 10.0,
                            "is_manual_reviewed": false,
                        },
                        "tags": [
                            "Exceptions",
                            "Python Exceptions"
                        ]
                    },
                ]
            }
        ],
        "started_at": "2016-07-08T07:25:21.937355",
        "time_taken": 41,
        "total_problems": 1,
        "total_score": 0,
        "total_solutions": 1,
        "verdict": {
            "percentage": 0,
            "quality_score": null,
            "quality_verdict": "bad",
            "verdict": "Qualified",
            "rating": 0.8
        },
        "plagiarism_data": {
            "y9x31": [
                {
                    "email": "iliyas@doselect.com",
                    "first_name": "Iliyas",
                    "last_name": "Shirol",
                    "similarity_score": "93.0",
                    "submitted_at": "2018-05-20T13:07:53.693251"
                    }
            ]
        },
        "proctored_data": {
            "navigator": {
                "fingerprint": {
                    "count": 1,
                    "flagged": false
                },
                "navigation": {
                    "count": 0,
                    "flagged": false
                }
            },
            "webcam": {
                "flagged": false
            },
            "verdict": "NOT_SUSPICIOUS"
        },
        "public_access_url": "https://doselect.com/reports/test?access_code=23iuerdn-092JZh/jAPHLEIZu6lLT4rfdjfmePn2mf"
    }
    

    This endpoint retrieves the reports of one candidate in a test. A candidate is identified by the email in a test.

    HTTP Request

    GET https://api.doselect.com/platform/v1/test/<slug>/ candidates/<email>/report

    The report which can be accessed from our APIs will contain the following information:

    Field Name Type Description
    resource_uri string The URI for a particular candidate
    email string The email of the candidate
    total_solutions integer The number of solutions submitted by the candidate
    attempted integer The number of problems attempted
    rejected integer The number of problems rejected
    accepted integer The number of problems accepted
    total_score float The total score of this candidate
    max_score float The maximum score of a candidate can get in this test
    started_at string A datetime string indicating when the candidate began taking the test
    ended_at string A datetime string indicating when the candidate stopped the test
    time_taken integer The time taken to give this test in seconds
    is_submitted boolean If true, the candidate has made the final submission
    sections list A list of sections of the test
    insights list A list of
    quality_analysis list A list of dictionaries containing analysis details
    public_access_url string A publicaly accessible URL of the report
    expiry string The datetime string about the expiry date of this candidate's invite
    status string The status of candidate's test
    test string The URI of the test
    verdict dictionary The verdict on this report
    proctored_data dictionary A dictionary containing suspicious activity data
    plagiarism_data dictionary A dictionary containing plagiarized problem slugs
    test_name string The name of the test taken by candidate

    The aforementioned verdict dictionary will contain the following information:

    Field Name Type Possible Values Description
    percentage float N.A The percentage of marks scored by the candidate
    quality_score string N.A The average code quality score in this test
    quality_verdict string good, ok, bad The verdict based on the code written by the candidate
    verdict string Not qualified, Qualified, Outstanding The verdict on the candidate

    The aforementioned proctored_data dictionary will contain the following information:

    Field Name Type Description
    navigator dictionary A Dictionary containing browser activity. Contains fingerprint and navigation data.
    fingerprint dictionary Record for test opened in multiple browsers. count contains the number of browser/tab in which the test was opened by the canidate and flagged is a boolean for suspicion.
    navigation dictionary Record for candidate moving out of test window. count contains the number of times candidate has moved out of the window while giving the test and flagged is a boolean for suspicion.
    webcam dictionary Record for candidate's suspicious activity on camera. flagged is a boolean for suspicion.
    verdict string The proctor verdict. Possible values: NOT_ENABLED, IN_PROGRESS, SUSPICIOUS, NOT_SUSPICIOUS

    The aforementioned plagiarism_data dictionary will contain the following information in a list:

    Field Name Type Description
    email string The matching candidate's email address
    first_name string The matching candidate's first name
    last_name string The matching candidate's last name
    similarity_score string Percentage of code match
    submitted_at string The matching candidate's submission time

    The aforementioned status string might contain one of the following code:

    Code Description
    CTK Currently Taking
    CMP Completed
    NRE Needs Review
    PAS Passed
    FAL Failed

    Get a candidate's previous attempts

    Request

    import requests
    
    url = 'https://api.doselect.com/platform/v1/test/4242/candidates/donnie@campushash.com/past_reports'
    headers = {
        "DoSelect-Api-Key": "88d4266fd4e6338d13b845fcf28",
        "DoSelect-Api-Secret": "385041b7bbc2320471b8551d"
    }
    response = requests.get(url, headers=headers)
    
    curl "https://api.doselect.com/platform/v1/test/4242/candidates/donnie@campushash.com/past_reports" \
      -H "DoSelect-Api-Key: 88d4266fd4e6338d13b845fcf28" \
      -H "DoSelect-Api-Secret: 385041b7bbc2320471b8551d"
    

    Response

    {
        "reports": [{
            "time_taken": 1202, # in seconds
            "total_problems": 10,
            "total_score": 120,
            "total_solutions": 9,
            "report_uri": "/platform/v1/past_report/23498"
        }]
    }
    

    This endpoint retrieves the past reports of one candidate in a test. For example, if a candidate's test has been reset, or the candidate retakes a test, this is visible in the endpoint.

    HTTP Request

    GET https://api.doselect.com/platform/v1/test/<slug>/ candidates/<email>/past_reports

    The report which can be accessed from our APIs will contain the following information:

    Field Name Type Description
    report_uri string The URI for a particular attempt
    total_solutions integer The number of solutions submitted by the candidate
    total_score float The total score of this candidate
    total_problems integer Total problems that had to be solved
    time_taken float Total time taken by the candidate in seconds

    Invite API

    Using the Invite API, you can invite a candidate to take a test in your team via their email address. The resources contains the following fields:

    Field Name Type Description
    resource_uri string URI that can be used to access this invite
    email string Email address of the candidate
    status string Status of this invite. Possible values are accepted, rejected and pending
    expiry string Optional, denotes the expiry of this invite
    start_time string Optional, denotes the time when the test becomes active for this invite
    test string URI of the test resource for this invite
    candidate_access_uri string Access link for the candidate to take the test for this invite
    report object Optional. If the test has been attempted, this would contain the gist of the result

    Get all invites of a user

    Request

    import requests
    
    url = "https://api.doselect.com/platform/v1/invite/"
    
    querystring = {"email":"hemil@doselect.com"}
    
    headers = {
        'Doselect-Api-Key': "88d4266fd4e6338d13b845fcf28",
        'Doselect-Api-Secret': "385041b7bbc2320471b8551d",
        'Cache-Control': "no-cache"
        }
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    curl -X GET \
      'https://api.doselect.com/platform/v1/invite/?email=hemil@doselect.com' \
      -H 'Doselect-Api-Key: 88d4266fd4e6338d13b845fcf28' \
      -H 'Doselect-Api-Secret: 385041b7bbc2320471b8551d'
    

    Response

    {
        "meta": {
            "limit": 1,
            "next": null,
            "offset": 0,
            "previous": null,
            "total_count": 1
        },
        "objects": [
            {
                "candidate_access_url": "https://doselect.com/gateways/test?access_code=f4nldRcHaVw6W2VcNk9ExrMWa6htLUaVF4G28HRCmgO342n",
                "email": "hemil@doselect.com",
                "expiry": "2017-12-29T09:47:35+00:00",
                "report": {
                    "report_uri": "/platform/v1/test/2xmrr/candidates/hemil@doselect.com/report",
                    "time_taken": 4,
                    "total_problems": 2,
                    "total_score": 0,
                    "total_solutions": 0
                },
                "resource_uri": "/platform/v1/test/2xmrr/candidates/hemil@doselect.com",
                "start_time": "2017-11-29T09:45:35+00:00",
                "status": "accepted",
                "test": "/platform/v1/test/2xmrr",
                "test_name": "DoSelect Demo Test for Backend Engineer"
            }
        ]
    }
    

    This API will fetch all the invites of a particular user which are associated with your account. If the user has been invited for tests from multiple accounts, then this API will return only those which are associated with the account whose credentials you send.

    The user email needs to be sent in the GET params as shown in the sample request with the key email.

    Optionally, You can filter the invites based on start_time and/or expiry by providing start_time and/or expiry in GET params with suffix __lte or __gte e.g start_time_gte, expiry_lte which stands for less than or equal to and greater than or equal to.

    For example, to fetch all the invites with start_time greater than or equal to 2018-07-01 and expiry less than or equal to 2018-07-25 send start_time__gte=2018-07-01T00:00:00Z and expiry__lte=2018-07-25T00:00:00Z in GET params.

    NOTE: start_time and expiry accepts ISO 8601 format string, for example 2018-01-29T15:15:35+05:30

    Create a new invite

    Request

    import requests
    
    url = 'https://api.doselect.com/platform/v1/test/esows/candidates'
    headers = {
        "DoSelect-Api-Key": "88d4266fd4e6338d13b845fcf28",
        "DoSelect-Api-Secret": "385041b7bbc2320471b8551d"
    }
    
    payload = {
        "email": "john@example.com",
        "expiry": "2018-05-29T15:17:35+05:30",
        "start_time": "2018-05-10T15:17:35+05:30"
    }
    
    response = requests.post(url, headers=headers, json=payload)
    
    curl -X POST \
      https://api.doselect.com/platform/v1/test/esows/candidates/ \
      -H 'content-type: application/json' \
      -H 'doselect-api-key: 88d4266fd4e6338d13b845fcf28' \
      -H 'doselect-api-secret: 385041b7bbc2320471b8551d' \
      -d '{
        "email": "john@example.com",
        "expiry": "2018-05-29T15:17:35+05:30",
        "start_time": "2018-05-10T15:17:35+05:30"
    }'
    

    Response

    {
        "candidate_access_url": "https://doselect.com/gateways/test?access_code=U2DsXUOgvXe2yUXiSPMHglkd/ORMykzTvw8jqmQrj6d1OL8N6MBqUqtu2nxSLz2E5BAuG5T8C9l%2BXYmjUPA0akTATBJB47bU9Yc8CQmwC8s%3D",
        "email": "john@example.com",
        "expiry": "2018-05-29T15:17:35+05:30",
        "start_time": "2018-05-10T15:17:35+05:30",
        "resource_uri": "/platform/v1/test/esows/candidates/john@example.com",
        "status": "pending",
        "test": "/platform/v1/test/esows"
    }
    

    HTTP Request

    POST https://api.doselect.com/platform/v1/test/<slug>/candidates

    Optionally, you can add a suppress_email=True GET parameter to the URL if you do not want the candidate to receive an invitation email from DoSelect.

    If you need to schedule a test, it can be done by setting the start_time and expiry of the invite accordingly.

    JSON payload attributes:

    Field Required Type Description
    email Yes string The email of the candidate
    expiry No string The expiry of the invite in an ISO format datetime string
    start_time No string The scheduled start time of an ISO format datetime string

    Bulk creation of invites

    Request

    import requests
    import json
    
    url = "https://api.doselect.com/platform/v1/test/esows/candidates/bulk/"
    
    payload = {
        "objects": [
            {
                "email": "hemil+bulk+1@doselect.com",
                "expiry": "2018-05-29T15:17:35+05:30",
                "start_time": "2018-04-29T15:15:35+05:30"
            },
            {
                "email": "hemil+bulk+2@doselect.com",
                "expiry": "2018-12-29T15:17:35+05:30",
                "start_time": "2018-01-29T15:15:35+05:30"
            }
        ]
    }
    headers = {
        'Doselect-Api-Key': "88d4266fd4e6338d13b845fcf28",
        'Doselect-Api-Secret': "385041b7bbc2320471b8551d",
        'Content-Type': "application/json",
        }
    
    response = requests.request("POST", url, data=json.dumps(payload), headers=headers)
    
    
    curl -X POST \
      'https://api.doselect.com/platform/v1/test/esows/candidates/bulk/' \
      -H 'Content-Type: application/json' \
      -H 'Doselect-Api-Key: 88d4266fd4e6338d13b845fcf28' \
      -H 'Doselect-Api-Secret: 385041b7bbc2320471b8551d' \
      -d '{
        "objects": [
            {
                "email": "hemil+bulk+1@doselect.com",
                "expiry": "2018-05-29T15:17:35+05:30",
                "start_time": "2018-04-29T15:15:35+05:30"
            },
            {
                "email": "hemil+bulk+2@doselect.com",
                "expiry": "2018-12-29T15:17:35+05:30",
                "start_time": "2018-01-29T15:15:35+05:30"
            }
        ]
    }'
    

    Response

    {
        "errors": [
            {
                "email": "hemil+bulk+1@doselect.com",
                "error": "Unable to save invite. Error: This candidate has already been invited for this test."
            }
        ],
        "invites": [
            {
                "status": "pending",
                "test": "/platform/v1/test/2edpq",
                "candidate_access_url": "http://doselect.com/gateways/test?access_code=B8lhneCES5yNCqTMmJxKLfMhyWoHZV2/Cr5vKnHmg1VtpLvrp1cI5asvYWndxNlE6opZbKfY2/NPCdVtVQX0YfqroK8JjEU%2BKT5u5/H0hyY%3D",
                "test_name": "Site Reliability Engineering Test",
                "report": null,
                "start_time": "2017-11-29T15:15:35+05:30",
                "resource_uri": "/platform/v1/test/2edpq/candidates/hemil+bulk+01@doselect.com",
                "email": "hemil+bulk+2@doselect.com",
                "expiry": "2017-12-29T15:17:35+05:30"
            }
        ]
    }
    

    This API will allow you to create multiple invites in bulk using a single http call.

    Optionally, you can add a suppress_email=True GET parameter to the URL if you do not want the candidate to receive an invitation email from DoSelect.

    If you need to schedule a test, it can be done by setting the start_time and expiry of the invite accordingly in ISO 8601 format.

    A sample ISO 8601 format string: 2018-01-29T15:15:35+05:30

    JSON payload attributes:

    Field Required Type Description
    email Yes string The email of the candidate
    expiry No string The expiry of the invite in an ISO format datetime string
    start_time No string The scheduled start time of an ISO format datetime string

    If there are any errors in the creation of any of the invites, they'll be mentioned in the errors key in the response with the reason for failure.

    Delete an invite

    Request

    import requests
    
    url = 'https://api.doselect.com/platform/v1/test/esows/candidates/john@example.com'
    headers = {
        "DoSelect-Api-Key": "88d4266fd4e6338d13b845fcf28",
        "DoSelect-Api-Secret": "385041b7bbc2320471b8551d"
    }
    
    response = requests.delete(url, headers=headers)
    
    curl -X DELETE \
      http://api.doselect.com/platform/v1/test/esows/candidates/ \
      -H 'doselect-api-key: 88d4266fd4e6338d13b845fcf28' \
      -H 'doselect-api-secret: 385041b7bbc2320471b8551d'
    

    Response

    204 NO CONTENT
    

    This endpoint deletes an invite for an email.

    HTTP Request

    DELETE https://api.doselect.com/platform/v1/test/<slug>/candidates/<email>

    Optionally, you can add a suppress_email=True GET parameter to the URL if you do not want the candidate to receive an invitation email from DoSelect.

    Reset an invite

    Request

    import requests
    
    url = 'https://api.doselect.com/platform/v1/test/esows/candidates/john@example.com/reset/'
    headers = {
        "DoSelect-Api-Key": "88d4266fd4e6338d13b845fcf28",
        "DoSelect-Api-Secret": "385041b7bbc2320471b8551d"
    }
    
    payload = {
        "start_time": "2017-11-30T15:15:35+05:30",
        "expiry": "2017-12-30T15:15:35+05:30"
    }
    
    response = requests.post(url, payload=payload, headers=headers)
    
    curl -X POST \
      https://api.doselect.com/platform/v1/test/esows/candidates/john@example.com/reset/ \
      -H 'doselect-api-key: 88d4266fd4e6338d13b845fcf28' \
      -H 'doselect-api-secret: 385041b7bbc2320471b8551d' \
      -d {
        "start_time": "2017-11-30T15:15:35+05:30",
        "expiry": "2017-12-30T15:15:35+05:30"
    }
    

    Response

    {
        "start_time": "2017-11-30T15:15:35+05:30",
        "email": "john@example.com",
        "candidate_access_url": "https://doselect.com/gateways/test?access_code=lYDMH0%2BnjSiS2NoYej",
        "expiry": "2017-12-30T15:15:35+05:30"
    }
    

    This endpoint resets the invite for an user. This will work only if the user has already taken the test, else it will throw a 400 BAD REQUEST.

    Once an invite has been reset, a user can take the test again.

    The request takes two params in the request body:

    Title Type Description
    start_time string A ISO 8601 datetime string denoting the new invite start time
    expiry string A ISO 8601 datetime string denoting the new invite expiry

    HTTP Request

    POST https://api.doselect.com/platform/v1/test/<slug>/ candidates/<email>/reset

    Update an invite

    Request

    import requests
    
    url = "https://api.doselect.com/platform/v1/test/2edq1/candidates/hemil@doselect.com"
    
    payload = {
        "expiry": "2018-01-31T15:17:35+05:30",
        "start_time": "2017-12-15T15:15:35+05:30"
    }
    
    headers = {
        'Doselect-Api-Key': "88d4266fd4e6338d13b845fcf28",
        'Doselect-Api-Secret': "385041b7bbc2320471b8551d",
        'Content-Type': "application/json",
        }
    
    response = requests.request("PATCH", url, data=payload, headers=headers)
    
    
    curl -X PATCH \
      'https://api.doselect.com/platform/v1/test/2edq1/candidates/hemil@doselect.com' \
      -H 'Doselect-Api-Key: 88d4266fd4e6338d13b845fcf28' \
      -H 'Doselect-Api-Secret: 385041b7bbc2320471b8551d' \
      -d '{
        "expiry": "2018-01-31T15:17:35+05:30",
        "start_time": "2017-12-15T15:15:35+05:30"
    }'
    

    Response

    {
        "candidate_access_url": "https://doselect.com/gateways/test?access_code=7HEdD1C7cis6RA46k214h0GbJB7ZupX3xxuhdH1/znaPCr4x453nCICbR",
        "email": "hemil@doselect.com",
        "expiry": "2018-01-31T15:17:35+05:30",
        "report": null,
        "resource_uri": "/platform/v1/test/2edq1/candidates/hemil@doselect.com",
        "start_time": "2017-12-15T15:15:35+05:30",
        "status": "pending",
        "test": "/platform/v1/test/2edq1"
    }
    

    This endpoint updates the invite for an user.

    The request takes two params in the request body:

    Title Type Description
    start_time string A ISO 8601 datetime string denoting the new invite start time
    expiry string A ISO 8601 datetime string denoting the new invite expiry

    This API will only work for the aforementioned fields and will throw an 400 BAD REQUEST if any other field is sent in the payload.

    HTTP Request

    PATCH https://api.doselect.com/platform/v1/test/<slug>/candidates/<email>/

    Optionally, you can add a suppress_email=True GET parameter to the URL if you do not want the candidate to receive an invitation email from DoSelect.

    Extend an invite's test duration

    Request

    import requests
    
    url = "https://api.doselect.com/platform/v1/test/2edq1/candidates/hemil@doselect.com/extend_duration"
    
    payload = {
        "minutes": 15,
    }
    
    headers = {
        'Doselect-Api-Key': "88d4266fd4e6338d13b845fcf28",
        'Doselect-Api-Secret': "385041b7bbc2320471b8551d",
        'Content-Type': "application/json",
    }
    
    response = requests.request("POST", url, data=payload, headers=headers)
    
    
    curl -X PATCH \
      'https://api.doselect.com/platform/v1/test/2edq1/candidates/hemil@doselect.com/extend_duration' \
      -H 'Doselect-Api-Key: 88d4266fd4e6338d13b845fcf28' \
      -H 'Doselect-Api-Secret: 385041b7bbc2320471b8551d' \
      -d '{
        "minutes": 10,
    }'
    

    Response

    {
        "candidate_access_url": "https://doselect.com/gateways/test?access_code=7HEdD1C7cis6RA46k214h0GbJB7ZupX3xxuhdH1/znaPCr4x453nCICbR",
        "email": "hemil@doselect.com",
        "expiry": "2018-01-31T15:17:35+05:30"
    }
    

    This endpoint updates the end time for a test invite.

    The request takes one param in the request body:

    Title Type Description
    minutes string Number of minutes by which to extend the test's duration

    The API works only if the candidate has started the test. If not, Bad Request (400) is returned. The test extension is supposed to be synchronous. It means that if the test is supposed to end at 20:00 UTC, and extended by 20 minutes, the test will now end at 20:20 UTC. If the candidate is offline at this period, they will not be able to use this extended time.

    HTTP Request

    POST https://api.doselect.com/platform/v1/test/<slug>/ candidates/<email>/extend_duration

    Extend an invite's test retake

    Request

    import requests
    
    url = 'https://api.doselect.com/platform/v1/test/esows/candidates/john@example.com/retake'
    headers = {
        "DoSelect-Api-Key": "88d4266fd4e6338d13b845fcf28",
        "DoSelect-Api-Secret": "385041b7bbc2320471b8551d"
    }
    
    payload = {
        "max_retakes": 3,
        "suppress_email": False,
        "expiry": "2018-05-29T15:17:35+05:30"
    }
    
    response = requests.post(url, headers=headers, json=payload)
    
    curl -X POST \
      https://api.doselect.com/platform/v1/test/esows/candidates/john@example.com/retake \
      -H 'content-type: application/json' \
      -H 'doselect-api-key: 88d4266fd4e6338d13b845fcf28' \
      -H 'doselect-api-secret: 385041b7bbc2320471b8551d' \
      -d '{
        "max_retakes": 3,
        "suppress_email": false,
        "expiry": "2018-05-29T15:17:35+05:30"
    }'
    

    Response

    {
        "candidate_access_url": "https://doselect.com/gateways/test?access_code=U2DsXUOgvXe2yUXiSPMHglkd/ORMykzTvw8jqmQrj6d1OL8N6MBqUqtu2nxSLz2E5BAuG5T8C9l%2BXYmjUPA0akTATBJB47bU9Yc8CQmwC8s%3D",
        "email": "john@example.com",
        "expiry": "2018-05-29T15:17:35+05:30",
        "start_time": "2018-05-10T15:17:35+05:30",
        "resource_uri": "/platform/v1/test/esows/candidates/john@example.com",
        "status": "pending",
        "test": "/platform/v1/test/esows"
    }
    

    The endpoint adds a retake attempt for the user to a particular test. This will work even if the user hasn’t attempted the test yet.

    Once a retake has been added, our platform will trigger an email to the user with the access URL to attempt the test. Optionally, you can add a suppress_email=False to the request body if you want the candidate to receive an retake email from DoSelect.

    HTTP Request

    POST https://api.doselect.com/platform/v1/test/<slug>/ candidates/<email>/retake

    JSON payload attributes:

    Field Required Type Description
    max_retakes Yes integer Number of retakes to be add. By default, the value will be 0.
    suppress_email No boolean If True don’t trigger an email from the platform, return the access_url as the response. By default, the value will be True.
    expiry No string A ISO 8601 datetime string denoting the new invite expiry.

    Problem API

    The Problem API allows you to retrieve one problem on DoSelect. You can also retrieve all submissions made to the problem within your team, as well as by a particular user identified by email.

    Get all problems

    You can get all problems in your team account using the list endpoint:

    HTTP Request

    GET https://api.doselect.com/platform/v1/problem

    Request

    import requests
    
    url = 'https://api.doselect.com/platform/v1/problem'
    headers = {
        "DoSelect-Api-Key": "88d4266fd4e6338d13b845fcf28",
        "DoSelect-Api-Secret": "385041b7bbc2320471b8551d"
    }
    response = requests.get(url, headers=headers)
    
    curl "https://api.doselect.com/platform/v1/problem" \
      -H "DoSelect-Api-Key: 88d4266fd4e6338d13b845fcf28" \
      -H "DoSelect-Api-Secret: 385041b7bbc2320471b8551d"
    

    Response

    {
        "objects": [
            {
                "in_learn_feed": true,
                "archived": false,
                "name": "Create a decorator",
                "level": "MED",
                "created": "2017-07-21T16:10:53",
                "is_active": true,
                "penalty": 0,
                "score": 100,
                "resource_uri": "/platform/v1/problem/rra3l",
                "problem_type": "SCR",
                "slug": "rra3l",
                "solving_time": "5",
                "tags": [
                    "decorators",
                    "file handling",
                    "Python"
                ],
                "description": "Implement a Python decorator that should take whatever the decorated function returns, and writes it to a file in a new line.For the sake of this problem, let us assume that the decorated functions always return a string. Constraints:The decorator should ..."
            }
        ],
        "meta": {
            "total_count": 1,
            "next": null,
            "offset": 0,
            "limit": 10,
            "previous": null
        }
    }
    

    Search for problems

    The list endpoint enables you to search for problems as well, the constraints of which can be controlled via GET parameters listed below. The query can contain any combination of these parameters.

    Parameter name Possible values Description
    q Any string Generic query parameter that does a full text search
    is_active true, false Filter only active problems that are usable
    tags Comma separated tags Searches on discovery tags of problems
    problem_type Allowed problem type codes Filter on problem types
    archived true, false Filter on archived status
    in_learn_feed true, false Filter on learn feed items

    Get one problem

    Request

    import requests
    
    url = 'https://api.doselect.com/platform/v1/problem/esows'
    headers = {
        "DoSelect-Api-Key": "88d4266fd4e6338d13b845fcf28",
        "DoSelect-Api-Secret": "385041b7bbc2320471b8551d"
    }
    response = requests.get(url, headers=headers)
    
    curl "https://api.doselect.com/platform/v1/problem/esows" \
      -H "DoSelect-Api-Key: 88d4266fd4e6338d13b845fcf28" \
      -H "DoSelect-Api-Secret: 385041b7bbc2320471b8551d"
    

    Response

    {
        "in_learn_feed": true,
        "archived": false,
        "attachments": [],
        "created": "2019-04-15T07:42:43.313046",
        "description": "<div><!--block-->Which of the following statement is true for lists and tuples?</div>",
        "eval_mode": "AUT",
        "insight_tags": [
            "Sequences and File Operations"
        ],
        "is_active": true,
        "is_locked": false,
        "level": "EAS",
        "max_submissions": 0,
        "mcq_options": [
            {
                "content": "<div><!--block-->List is a mutable datatype and can hold heterogeneous data elements</div>",
                "id": "1"
            },
            {
                "content": "<div><!--block-->List is an immutable datatype and can hold heterogeneous data elements</div>",
                "id": "2"
            },
            {
                "content": "<div><!--block-->Tuple is an immutable datatype and can hold heterogeneous data elements</div>",
                "id": "3"
            },
            {
                "content": "<div><!--block-->Tuple is a mutable datatype and can hold heterogeneous data elements</div>",
                "id": "4"
            }
        ],
        "mcq_options_correct": "[u'3']",
        "modified": "2019-04-15T08:26:27.613249",
        "name": "Tuples",
        "penalty": 0,
        "private_attachments": [],
        "problem_type": "MCQ",
        "solving_time": "5",
        "resource_uri": "/platform/v1/problem/rxmpo",
        "sample_solutions": {},
        "score": 5,
        "slug": "rxmpo",
        "stubs": {},
        "tags": [
            "Python"
        ],
        "technologies": [],
        "testcases": [],
        "time_limit_secs": null
    }
    

    A problem is identified by a unique slug that gets generated during creation. This endpoint retrieves a specific problem: The query can contain any combination of these parameters.

    Parameter name Possible values Description
    author_logs True, False Adds audit logs in the response

    HTTP Request

    GET https://api.doselect.com/platform/v1/problem/<slug>

    Get all submissions of one problem

    Request

    import requests
    
    url = 'https://api.doselect.com/platform/v1/problem/esows/solution'
    headers = {
        "DoSelect-Api-Key": "88d4266fd4e6338d13b845fcf28",
        "DoSelect-Api-Secret": "385041b7bbc2320471b8551d"
    }
    response = requests.get(url, headers=headers)
    
    curl "https://api.doselect.com/platform/v1/problem/esows/solution" \
      -H "DoSelect-Api-Key: 88d4266fd4e6338d13b845fcf28" \
      -H "DoSelect-Api-Secret: 385041b7bbc2320471b8551d"
    

    Response

    {
        "objects": [
            {
                {
                    "code": "",
                    "analysis_details": {
                        "quality": {
                            "analysis_ended": "2017-04-30T10:26:25Z",
                            "score": "4.3",
                            "analysis_started": "2017-04-30T10:26:12Z",
                            "issues": [{
                                "description": "Remove this useless assignment to local variable DoSelectHack",
                                "engine_name": "checks",
                                "check_name": "javascript:S1854",
                                "location": {
                                    "path": "source.js",
                                    "lines": {
                                        "begin": 4,
                                        "end": 4
                                    }
                                },
                                "type": "issue",
                                "categories": ["Bug Risk"],
                                "remediation_points": 0
                            }, {
                                "description": "Remove this logging statement.",
                                "engine_name": "checks",
                                "check_name": "javascript:S2228",
                                "location": {
                                    "path": "source.js",
                                    "lines": {
                                        "begin": 6,
                                        "end": 6
                                    }
                                },
                                "type": "issue",
                                "categories": ["Security"],
                                "remediation_points": 0
                            }, {
                                "description": "Remove this logging statement.",
                                "engine_name": "checks",
                                "check_name": "javascript:S2228",
                                "location": {
                                    "path": "source.js",
                                    "lines": {
                                        "begin": 8,
                                        "end": 8
                                    }
                                },
                                "type": "issue",
                                "categories": ["Security"],
                                "remediation_points": 0
                            }],
                            "sid": "f770685b-c969-4d39-b9db-71377e7d5881"
                        }
                    },
                    "technology": "angularjs",
                    "status": "ACC",
                    "resubmissions": 0,
                    "solution_type": "UIX",
                    "total_score": "45.0",
                    "choice": null,
                    "answer": "",
                    "is_submitted": true,
                    "slug": "75ee0",
                    "submitted_at": "2017-05-14T09:10:22.558Z",
                    "run_details": null,
                    "attachments": "[]",
                    "creator": {
                        "email": "john@example.com"
                    }
                }
            },
        ]
    }
    

    The problem is identified by a unique slug that gets generated during creation. This endpoint retrieves all submission of a specific problem:

    HTTP Request

    GET https://api.doselect.com/platform/v1/problem/<slug>/submission

    Get solution revision

    The Solution Revision API allows you to view the revisions of solution to a problem.

    Request

    import requests
    
    url = 'https://api.doselect.com/platform/v1/submission/mmoe0/revisions/john@example.com'
    headers = {
        "DoSelect-Api-Key": "88d4266fd4e6338d13b845fcf28",
        "DoSelect-Api-Secret": "385041b7bbc2320471b8551d"
    }
    response = requests.get(url, headers=headers)
    
    curl "https://api.doselect.com/platform/v1/submission/mmoe0/revisions/john@example.com" \
      -H "DoSelect-Api-Key: 88d4266fd4e6338d13b845fcf28" \
      -H "DoSelect-Api-Secret: 385041b7bbc2320471b8551d"
    

    Response

    {
        "meta": {
            "limit": 1,
            "next": "?limit=1&offset=1",
            "offset": 0,
            "previous": null,
            "total_count": 2
        },
        "objects": [
            {
                "code": "\n# Read the variable from STDIN\nread a\n\n# Output the variable to STDOUT\necho $a\ns\n\n",
                "creator": {
                    "email": "john@example.com",
                    "first_name": "John",
                    "last_name": "Doe",
                    "username": "johndoe"
                },
                "resource_uri": "/platform/v1/submission/mmoe0/revisions/john@example.com",
                "run_details":  {
                    "evaluation_ended": "2018-01-19T15:38:17Z",
                    "evaluation_started": "2018-01-19T15:38:06Z",
                    "evaluation_status": "",
                    "running_time": "",
                    "score": 0,
                    "sid": "SCR:2018-01-19:12195f75-3330-41cc-9713-539c143c2b86"},
                "score": 0,
                "solution": "/platform/v1/submission/mmoe0",
                "status": "REJ",
                "technology": "bash",
                "testcases_failed": 11,
                "testcases_passed": 0,
                "total_testcases": 11
            }
        ]
    }
    

    HTTP Request

    GET https://api.doselect.com/platform/v1/submission/<slug>/revisions/<email>

    Get submission by a user

    Request

    import requests
    
    url = 'https://api.doselect.com/platform/v1/problem/esows/solution/john@example.com/'
    headers = {
        "DoSelect-Api-Key": "88d4266fd4e6338d13b845fcf28",
        "DoSelect-Api-Secret": "385041b7bbc2320471b8551d"
    }
    response = requests.get(url, headers=headers)
    
    curl "https://api.doselect.com/platform/v1/problem/esows/solution/john@example.com/" \
      -H "DoSelect-Api-Key: 88d4266fd4e6338d13b845fcf28" \
      -H "DoSelect-Api-Secret: 385041b7bbc2320471b8551d"
    

    Response

    {
        "code": "",
        "analysis_details": {
            "quality": {
                "analysis_ended": "2017-04-30T10:26:25Z",
                "score": "4.3",
                "analysis_started": "2017-04-30T10:26:12Z",
                "issues": [{
                    "description": "Remove this useless assignment to local variable DoSelectHack",
                    "engine_name": "checks",
                    "check_name": "javascript:S1854",
                    "location": {
                        "path": "source.js",
                        "lines": {
                            "begin": 4,
                            "end": 4
                        }
                    },
                    "type": "issue",
                    "categories": ["Bug Risk"],
                    "remediation_points": 0
                }, {
                    "description": "Remove this logging statement.",
                    "engine_name": "checks",
                    "check_name": "javascript:S2228",
                    "location": {
                        "path": "source.js",
                        "lines": {
                            "begin": 6,
                            "end": 6
                        }
                    },
                    "type": "issue",
                    "categories": ["Security"],
                    "remediation_points": 0
                }, {
                    "description": "Remove this logging statement.",
                    "engine_name": "checks",
                    "check_name": "javascript:S2228",
                    "location": {
                        "path": "source.js",
                        "lines": {
                            "begin": 8,
                            "end": 8
                        }
                    },
                    "type": "issue",
                    "categories": ["Security"],
                    "remediation_points": 0
                }],
                "sid": "f770685b-c969-4d39-b9db-71377e7d5881"
            }
        },
        "technology": "angularjs",
        "status": "ACC",
        "resubmissions": 0,
        "solution_type": "UIX",
        "total_score": "45.0",
        "choice": null,
        "answer": "",
        "is_submitted": true,
        "slug": "75ee0",
        "submitted_at": "2017-05-14T09:10:22.558Z",
        "run_details": null,
        "attachments": "[]",
        "creator": {
            "email": "john@example.com"
        }
    }
    

    This endpoint retrieves the submission of a specific problem, identified by a slug submitted by a user who is identified by the email.

    HTTP Request

    GET https://api.doselect.com/platform/v1/problem/<slug>/submission/<email>/

    Create a Problem

    Request

    import requests
    
    url = 'https://api.doselect.com/platform/v1/problem/'
    headers = {
        "DoSelect-Api-Key": "88d4266fd4e6338d13b845fcf28",
        "DoSelect-Api-Secret": "385041b7bbc2320471b8551d",
        "Content-Type": "application/json"
    }
    payload = {
        "name": "Doselect API Problem",
        "problem_type": "PRJ",
        "time_limit_secs": 100,
        "tags": [
            "Regex"
        ],
        "insight_tags": [
            "Python2"
        ],
        "description": "This is not the problem you are looking for",
        "max_submissions": 5,
        "score": 75,
        "penalty": 1,
        "solving_time": "5",
        "stubs": {
            "python2": "print 'hello world'",
            "java7": "System.out.println('hello world')",
            "java": "System.out.println('hello world')"
        },
        "sample_solutions": {
            "python2": "def add(a,b): return a + b"
        },
        "technologies": [
            "python2",
            "java7",
            "lua"
        ]
    }
    response = requests.post(url, headers=headers, data=payload)
    
    curl -X POST "https://api.doselect.com/platform/v1/problem/" \
      -H "DoSelect-Api-Key: 88d4266fd4e6338d13b845fcf28" \
      -H "DoSelect-Api-Secret: 385041b7bbc2320471b8551d" \
      -d '{
        "name": "Doselect API Problem",
        "problem_type": "PRJ",
        "time_limit_secs": 100,
        "tags": [
            "Regex"
        ],
        "insight_tags": [
            "Python2"
        ],
        "description": "This is not the problem you are looking for",
        "max_submissions": 5,
        "score": 75,
        "penalty": 1,
        "solving_time": "5",
        "stubs": {
            "python2": "print 'hello world'",
            "java7": "System.out.println('hello world')",
            "java": "System.out.println('hello world')"
        },
        "sample_solutions": {
            "python2": "def add(a,b): return a + b"
        },
        "technologies": [
            "python2",
            "java7",
            "lua"
        ]
    }'
    

    Response

    {
        "attachments": [],
        "created": "2017-10-25T10:13:09.561690",
        "description": "This is not the problem you are looking for",
        "eval_mode": "ATF",
        "insight_tags": [
            "Python2"
        ],
        "is_active": true,
        "level": "EAS",
        "max_submissions": 5,
        "modified": "2017-10-25T10:13:09.568721",
        "name": "Doselect API Problem",
        "penalty": 1,
        "solving_time": "5",
        "problem_type": "SCR",
        "resource_uri": "/platform/v1/problem/nq4yq",
        "sample_solutions": "{}",
        "score": 75,
        "slug": "nq4yq",
        "tags": [
            "Regex"
        ],
        "technologies": [
            "python2",
            "java7",
            "lua"
        ],
        "testcases": [],
        "time_limit_secs": "42",
        "stubs": {
            "python2": "print 'hello world'",
            "java7": "System.out.println('hello world')",
            "java": "System.out.println('hello world')"
        }
    }
    

    This API partially creates problem, which can then be edited on the DoSelect platform.

    The fields accepted in the body of this request are:

    Field Name Type Description
    name string The name of the problem
    problem_type string The type of the problem (DBA, PRJ, UIX, SCR, MCQ, DSC, MLI or APP)
    description string The description of the problem
    max_submissions integer The maximum number of submissions allowed
    score integer The score of the problem
    mcq_options array A list of possible mcq options
    mcq_options_correct array The correct mcq option
    penalty integer The penalty for the problem
    time_limit_secs integer The time limit for this problem in seconds (Between 0-99)
    eval_mode string Evaluation mode for this problem (TXT IO Based or ATF Script Based)
    tags array A list of strings of discovery tags
    insight_tags array A list of strings of insight tags
    stubs dictionary A dictionary containing the stubs of the problem
    sample_solutions dictionary A dictionary containing the sample solutions of the problem
    technologies array A list of strings containing the slugs of allowed technologies
    author_email string Email of the creator of problem
    solving_time string Expected solving time of a problem in minutes

    The possible problem types are:

    Abbreviation Description
    DBA Database problem
    PRJ Project based problem
    UIX UI/UX problem
    SCR Coding problem
    MCQ Multiple choice question
    DSC Data science problem
    MLI Machine learning problem

    The stubs dictionary should have the technology slug as the key and the stub string as the value.

    The sample_solutions dictionary should have the technology slug as the key and the solution string as the value.

    The possible values of technology slugs are:

    Technology Slug Technology
    julia Julia
    haskell Haskell
    csharp C#
    go Go
    javascript JavaScript (NodeJS)
    scala Scala
    swift Swift
    perl Perl
    lua Lua
    clisp Clisp
    objectivec ObjectiveC
    php PHP
    ruby Ruby
    bash Bash
    clojure Clojure
    rust Rust
    c C
    cpp C++
    java7 Java 7
    python3 Python 3
    python2 Python 2
    java8 Java 8
    r R
    fsharp F#
    cpp14 C++14
    kotlin Kotlin
    mysql MySQL

    Clone a problem

    Request

    import requests
    
    url = 'https://api.doselect.com/platform/v1/problem/481bo/clone'
    headers = {
        "DoSelect-Api-Key": "88d4266fd4e6338d13b845fcf28",
        "DoSelect-Api-Secret": "385041b7bbc2320471b8551d",
        "Content-Type": "application/json"
    }
    
    response = requests.post(url, headers=headers)
    
    curl -X POST "https://api.doselect.com/platform/v1/problem/481bo/clone" \
      -H "DoSelect-Api-Key: 88d4266fd4e6338d13b845fcf28" \
      -H "DoSelect-Api-Secret: 385041b7bbc2320471b8551d"
    

    Response

    {
        "attachments": [],
        "created": "2017-11-24T09:11:12.103398",
        "description": "<div><!--block-->Jim is very health conscious. Determine whether he is.</div>",
        "eval_mode": "TXT",
        "insight_tags": [],
        "is_active": true,
        "is_locked": false,
        "level": "MED",
        "max_submissions": 0,
        "modified": "2017-11-24T09:11:12.230166",
        "name": "Nutrition calculator",
        "penalty": 0,
        "solving_time": "5"
        "problem_type": "SCR",
        "resource_uri": "/platform/v1/problem/q3w8q",
        "sample_solutions": {},
        "score": 100,
        "slug": "q3w8q",
        "stubs": {},
        "tags": [
            "CPP"
        ],
        "technologies": [],
        "testcases": [
            {
                "id": 20873,
                "input": "duck egg\n",
                "is_sample": false,
                "name": "Testcase #1",
                "output": "12.81g\n",
                "weight": 1
            }
        ],
        "time_limit_secs": null
    }
    

    This API clones a problem identified by the slug. The response will contain the data of the new problem.

    Locking / unlocking a problem

    DoSelect allows you to lock a problem to prevent inadvertent changes to it. Using this API, the lock status can be modified.

    For locking a problem:

    POST https://api.doselect.com/platform/v1/problem/<PROBLEM_SLUG>/lock

    For unlocking a problem:

    POST https://api.doselect.com/platform/v1/problem/<PROBLEM_SLUG>/unlock

    These endpoints return a status code of 200 if the operation is successful.

    Update a problem

    Request

    import requests
    
    url = 'https://api.doselect.com/platform/v1/problem/q3w8q/'
    headers = {
        "DoSelect-Api-Key": "88d4266fd4e6338d13b845fcf28",
        "DoSelect-Api-Secret": "385041b7bbc2320471b8551d",
        "Content-Type": "application/json"
    }
    
    payload = {
      "name": "Updated Problem Name",
      "tags": [
        "Java"
      ],
      "description": "A new description of the problem",
      "score": 10,
      "penalty": 5,
      "max_submissions": 10,
      "solving_time": "5"
    }
    
    
    response = requests.patch(url, data=payload, headers=headers)
    
    curl -X PATCH "https://api.doselect.com/platform/v1/problem/q3w8q" \
      -H "DoSelect-Api-Key: 88d4266fd4e6338d13b845fcf28" \
      -H "DoSelect-Api-Secret: 385041b7bbc2320471b8551d" \
      -d '{
      "name": "Updated Problem Name",
      "tags": [
        "Java"
      ],
      "description": "A new description of the problem",
      "max_submissions": 10,
      "solving_time": "5"
    }'
    

    Response

    {
        "attachments": [],
        "created": "2017-11-24T09:11:12.103398",
        "description": "A new description of the problem",
        "eval_mode": "TXT",
        "insight_tags": [],
        "is_active": true,
        "is_locked": false,
        "level": "MED",
        "max_submissions": 10,
        "modified": "2017-11-24T09:36:19.239739",
        "name": "Updated Problem Name",
        "penalty": 5,
        "solving_time": "5"
        "problem_type": "SCR",
        "resource_uri": "/platform/v1/problem/q3w8q",
        "sample_solutions": {},
        "score": 10,
        "slug": "q3w8q",
        "stubs": {},
        "tags": [
            "Java"
        ],
        "technologies": [],
        "testcases": [
            {
                "id": 20873,
                "input": "duck egg\n",
                "is_sample": false,
                "name": "Testcase #1",
                "output": "12.81g\n",
                "weight": 1
            }
        ],
        "time_limit_secs": null
    }
    

    This API updates a problem identified by it's slug. The allowed update fields are:

    Field Name Type Description
    name string The name of the problem
    description string The description of the problem
    tags array A list of strings of discovery tags
    score float Max points awarded if the solution is correct
    penalty float Max penalty if the solution is incorrect
    max_submissions integer Maximum number of submissions allowed on a problem
    author_email string Email of the editor
    solving_time string Expected solving time of a problem in minutes

    Please note that you must unlock a problem if it's locked in order to update it.

    Problem Testcase API

    The Problem testcase API allows you to retrieve all testcases of one problem on DoSelect. You can also create and delete the testcases of a problem.

    Get all testcases of a problem

    Request

    import requests
    
    url = "https://api.doselect.com/platform/v1/problem/nq4yq/testcase"
    headers = {
        "DoSelect-Api-Key": "88d4266fd4e6338d13b845fcf28",
        "DoSelect-Api-Secret": "385041b7bbc2320471b8551d",
        "Content-Type": "application/json"
    }
    response = requests.get(url, headers=headers)
    
    curl -X GET \
      https://api.doselect.com/platform/v1/problem/nq4yq/testcase \
      -H 'content-type: application/json' \
      -H 'doselect-api-key: 88d4266fd4e6338d13b845fcf28' \
      -H 'doselect-api-secret: 385041b7bbc2320471b8551dg'
    

    Response

    "objects": [
            {
                "code": "",
                "id": 20869,
                "input": "1",
                "is_sample": false,
                "level": "EAS",
                "name": "test case API 1",
                "negative_annotation": "If this test case passes, the code does not handles null values properly",
                "output": "3",
                "penalty": 5,
                "positive_annotation": "If this test case passes, the code handles null values properly",
                "problem": "/tardis/problem/nq4yq",
                "score": 50,
                "weight": 2
            },
    ]
    

    This API retrieves all testcases of a problem.

    The fields in the response body of this request are:

    Field Name Type Description
    code string The code for automatic problem evaluation
    weight integer The weight of the testcase's result
    negative_annotation string What it means if the testcase fails
    input string The input to be given
    name string The name of the testcase
    penalty integer The penalty if the testcase is wrong
    score integer The score if the testcase passes
    is_sample boolean True if it's a sample testcase, False otherwise
    positive_annotation string What it means if the testcase passes
    output string The expected output
    id integer The identifier of this testcase
    level string The level of the problem

    Create a testcase

    Request

    import requests
    
    url = "https://api.doselect.com/platform/v1/problem/nq4yq/testcase"
    headers = {
        "DoSelect-Api-Key": "88d4266fd4e6338d13b845fcf28",
        "DoSelect-Api-Secret": "385041b7bbc2320471b8551d",
        "Content-Type": "application/json"
    }
    payload = {
        "name": "test case API 3",
        "input": "",
        "output": "3",
        "technology": "python2",
        "is_sample": false,
        "weight": 2,
        "positive_annotation": "If this test case passes, the code handles null values properly",
        "negative_annotation": "If this test case passes, the code does not handles null values properly",
        "code": "",
        "score": 50,
        "penalty": 5
    
    }
    response = requests.post(url, headers=headers, data=payload)
    
    curl -X POST \
      https://api.doselect.com/platform/v1/problem/nq4yq/testcase \
      -H "DoSelect-Api-Key: 88d4266fd4e6338d13b845fcf28" \
      -H "DoSelect-Api-Secret: 385041b7bbc2320471b8551d" \
      -d '{
        "name": "test case API 3",
        "input": "",
        "output": "3",
        "is_sample": false,
        "weight": 2,
        "positive_annotation": "If this test case passes, the code handles null values properly",
        "negative_annotation": "If this test case passes, the code does not handles null values properly",
        "code": "",
        "score": 50,
        "penalty": 5
    
    }'
    

    Response

    {
        "code": "",
        "id": 21784,
        "input": "",
        "is_sample": false,
        "level": "EAS",
        "name": "test case API 3",
        "negative_annotation": "If this test case passes, the code does not handles null values properly",
        "output": "3",
        "penalty": 5,
        "positive_annotation": "If this test case passes, the code handles null values properly",
        "problem": "/tardis/problem/nq4yq",
        "score": 50,
        "weight": 2
    }
    

    This API creates a testcase for a problem.

    The fields accepted in the body of this request are:

    Field Name Type Description
    code string The code for automatic problem evaluation
    weight integer The weight of the testcase's result
    negative_annotation string What it means if the testcase fails
    input string The input to be given
    name string The name of the testcase
    penalty integer The penalty if the testcase is wrong
    score integer The score if the testcase passes
    is_sample boolean True if it's a sample testcase, False otherwise
    positive_annotation string What it means if the testcase passes
    output string The expected output

    Delete a testcase

    Request

    import requests
    
    url = "https://api.doselect.com/platform/v1/problem/nq4yq/testcase/21782"
    headers = {
        "DoSelect-Api-Key": "88d4266fd4e6338d13b845fcf28",
        "DoSelect-Api-Secret": "385041b7bbc2320471b8551d",
    }
    response = requests.delete(url, headers=headers)
    
    curl -X DELETE \
      https://api.doselect.com/platform/v1/problem/nq4yq/testcase/21782 \
      -H 'doselect-api-key: 88d4266fd4e6338d13b845fcf28=' \
      -H 'doselect-api-secret: 385041b7bbc2320471b8551d'
    

    Response

    204
    

    This API deletes a testcase of a problem. You need to identify the testcase by its id.

    This request will throw a 403 Forbidden and won't delete the testcase if anyone has already submitted solutions for this problem.

    PDF report API

    The PDF report API lets you send request to generate candidate's PDF report and get the same as a http response.

    Generate candidate's PDF report

    HTTP Request

    GET https://doselect.com/reports/test?access_code=<access_code>&generate_pdf=True

    import requests
    
    url = 'https://doselect.com/reports/test?access_code=MLAl5bGMyUjPlsE2etUQZ5xlF/COjZUEhLHvNPd99x%2Bc38xWxxyA%2B62W4TQAf8VqG6WvwzMtJRswQzA9evgAqqlA/hA3KOWmFnENlefQuEA%3D&generate_pdf=True'
    headers = {
        "DoSelect-Api-Key": "88d4266fd4e6338d13b845fcf28",
        "DoSelect-Api-Secret": "385041b7bbc2320471b8551d"
    }
    response = requests.get(url, headers=headers)
    
    curl "https://doselect.com/reports/test?access_code=MLAl5bGMyUjPlsE2etUQZ5xlF/COjZUEhLHvNPd99x%2Bc38xWxxyA%2B62W4TQAf8VqG6WvwzMtJRswQzA9evgAqqlA/hA3KOWmFnENlefQuEA%3D&generate_pdf=True" \
      -H "DoSelect-Api-Key: 88d4266fd4e6338d13b845fcf28" \
      -H "DoSelect-Api-Secret: 385041b7bbc2320471b8551d"
    

    Response

    
    JsonResponse with status 200 "If request accepted"
    {
      "status":"SUCCESS",
      "description":"PDF report generation in process."
    }
    
    JsonResponse with status 400 "If candidate is currently taking the test"
    {
      "status":"ERROR",
      "description":"Cannot generate the report. The user is currently taking the test."
    }
    
    JsonResponse with status 400 "If user hasn't attempted the test"
    {
      "status":"ERROR",
      "description":"Cannot generate the report. The user hasn't attempted the test."
    }
    
    JsonResponse with status 400 "If access code doesn't exists"
    {
      "status":"ERROR",
      "description":"No existing test session with provided access key"
    }
    
    HttpResponseUnauthorized (message: "Invalid auth key.", status: 401) "If incorrect DoSelect auth credentials provided"
    
    
    

    Generate candidate's PDF report api needs to call with query string "access_code AND generate_pdf". Where the value of access_code is an unique identifier of a candidate's test session and the value of generate_pdf should pass as True (Case sensitive). This endpoint initiate a request to generate candidate's PDF report for particular assessment/assignment:

    NOTE: Add DoSelect-Api-Key, DoSelect-Api-Secret in request headers for authentication.

    Get a candidate's PDF report

    GET https://doselect.com/reports/test?access_code=<access_code>&format=pdf

    import requests
    
    url = 'https://doselect.com/reports/test?access_code=MLAl5bGMyUjPlsE2etUQZ5xlF/COjZUEhLHvNPd99x%2Bc38xWxxyA%2B62W4TQAf8VqG6WvwzMtJRswQzA9evgAqqlA/hA3KOWmFnENlefQuEA%3D&format=pdf'
    headers = {
        "DoSelect-Api-Key": "88d4266fd4e6338d13b845fcf28",
        "DoSelect-Api-Secret": "385041b7bbc2320471b8551d"
    }
    response = requests.get(url, headers=headers)
    
    
    
    curl "https://doselect.com/reports/test?access_code=MLAl5bGMyUjPlsE2etUQZ5xlF/COjZUEhLHvNPd99x%2Bc38xWxxyA%2B62W4TQAf8VqG6WvwzMtJRswQzA9evgAqqlA/hA3KOWmFnENlefQuEA%3D&format=pdf" \
      -H "DoSelect-Api-Key: 88d4266fd4e6338d13b845fcf28" \
      -H "DoSelect-Api-Secret: 385041b7bbc2320471b8551d"
    

    Response

    
    Http Response 200 with pdf report "If request accepted and if pdf exists"
    
    Http Response 200 with html report "If request accepted and pdf doesn't exists"
    
    JsonResponse with status 400 "If candidate is currently taking the test."
    {
      "status":"ERROR",
      "description":"Cannot get the report. The user is currently taking the test."
    }
    
    JsonResponse with status 400 "If the user hasn't attempted the test."
    {
      "status":"ERROR",
      "description":"Cannot get the report. The user hasn't attempted the test."
    }
    
    JsonResponse with status 400 "If access code doesn't exists"
    {
      "status":"ERROR",
      "description":"No existing test session with provided access key"
    }
    
    HttpResponseUnauthorized (message: "Unauthorised access.", status: 401) "If incorrect DoSelect auth credentials provided"
    
    

    Get a candidate's PDF report api needs to call with query string "access_code AND format". Where the value of access_code is an unique identifier of a candidate's test session and the value of format should pass as pdf (Case sensitive). This endpoint gets PDF report of a candidate or return error if report doesn't exists for particular candidate.

    NOTE: Add DoSelect-Api-Key, DoSelect-Api-Secret in request headers for authentication.

    LearnFeed Item API

    The LearnFeed Item API allows you to add problems to your teams's learnfeed on DoSelect.

    Add problem to learn feed

    Request

    import requests
    
    url = "https://api.doselect.com/platform/v1/learnfeeditem/"
    
    payload = {
        "problem": "/platform/v1/problem/y9or8"
    }
    
    headers = {
        'DoSelect-Api-Key': "88d4266fd4e6338d13b845fcf28",
        'DoSelect-Api-Secret': "385041b7bbc2320471b8551d",
        'Content-Type': "application/json"
        }
    
    response = requests.request("POST", url, data=payload, headers=headers)
    
    curl -X POST \
      https://api.doselect.com/platform/v1/learnfeeditem/ \
      -H 'Content-Type: application/json' \
      -H 'DoSelect-Api-Key: 88d4266fd4e6338d13b845fcf28' \
      -H 'DoSelect-Api-Secret: 385041b7bbc2320471b8551d' \
      -d '{
        "problem": "/platform/v1/problem/y9or8"
    }'
    

    Response

    {
        "id": 22,
        "resource_uri": "/platform/v1/learnfeeditem/22",
        "slug": "e2yp2"
    }
    

    This endpoint adds a specific problem, identified by a slug to the company's learn feed. The company is identified using the API Key and secret which is used in authenticating a request.

    HTTP Request

    POST https://api.doselect.com/platform/v1/learnfeeditem/

    Payload Params

    Parameter Description
    problem The resource_uri of the problem to be added

    The URI of the problem will be in the format of /platform/v1/problem/<slug>

    Submission API

    The Submission API allows you to create a submission for a problem. After creating a submission, you will get notified via webhooks when the result becomes available.

    Create a new submission

    Request

    import requests
    
    url = "https://api.doselect.com/platform/v1/submission/"
    
    payload = {
        "code": "print 'Hello World'",
        "technology": "technology_slug",
        "code_url": "https://s3.amazon.com/zygon.zip",
        "problem_slug": "esows",
        "problem_type": "SCR",
        "email": "john@example.com",
        "learn_feed_item_id": 5
    }
    
    headers = {
        'DoSelect-Api-Key': "88d4266fd4e6338d13b845fcf28",
        'DoSelect-Api-Secret': "385041b7bbc2320471b8551d",
        'Content-Type': "application/json"
        }
    
    response = requests.request("POST", url, data=payload, headers=headers)
    
    curl -X POST \
      https://api.doselect.com/platform/v1/submission/ \
      -H 'Content-Type: application/json' \
      -H 'DoSelect-Api-Key: 88d4266fd4e6338d13b845fcf28' \
      -H 'DoSelect-Api-Secret: 385041b7bbc2320471b8551d' \
      -d '{
        "technology": "technology_slug",
        "problem_type": "SCR",
        "code": "print '\''Hello World'\''",
        "email": "john@example.com",
        "problem_slug": "esows",
        "code_url": "https://s3.amazon.com/zygon.zip",
        "learn_feed_item_id": 5
    }'
    

    Response

    {
        "status": "UNE",
        "resubmissions": 0,
        "learn_feed_item_id": 5,
        "created": "2018-04-11T05:26:53.233Z",
        "total_score": "0.0",
        "run_details": {},
        "modified": "2018-04-11T05:26:53.740Z",
        "problem_slug": "esows",
        "email": "john@example.com",
        "code": "print 'Hello World'",
        "analysis_details": {},
        "submitted_at": "2018-04-11T05:26:53.464Z",
        "slug": "rd3g0l",
        "solution_type": "SCR",
        "max_score": 150
    }
    

    This endpoint accepts a new submission for a specific problem, identified by a slug submitted by a user who is identified by the email.

    HTTP Request

    POST https://api.doselect.com/platform/v1/submission/

    Payload Params

    Parameter Description
    technology The slug which identifies the technology used for this submission
    problem_type The code for type of the problem
    code If the submission is a coding-type problem, the code of the submission
    code_url If the submission is a project-type problem, the publicly accessible url of the ZIP of the project
    problem_slug The slug which identifies the problem
    email Email of the user
    learn_feed_item_id Optional. The ID of the learn feed item related to the problem.
    choice Required for MCQ. Submitted option in a list
    solution_type Required for MCQ with default value "MCQ"

    The allowed problem types are:

    Problem type Slug
    Database DBA
    Project-based PRJ
    Front-end project UIX
    Coding SCR
    Multiple-choice MCQ

    The allowed technologies for each problem type are:

    Problem type Slug reference
    Database mysql (MySQL)
    Project-based java7 (Java 7), python3 (Python 3), python2 (Python 2), java8 (Java 8)
    Front-end project angularjs (AngularJS), jquery (jQuery), reactjs (React), backbonejs (Backbone), vanillajs (Vanilla JS)
    Coding julia (Julia), haskell (Haskell), csharp (C#), go (Go), javascript (JavaScript (NodeJS)), scala (Scala), swift (Swift), perl (Perl), lua (Lua), clisp (Clisp), objectivec (ObjectiveC), php (PHP), ruby (Ruby), bash (Bash), clojure (Clojure), rust (Rust), c (C), cpp (C++), java7 (Java 7), python3 (Python 3), python2 (Python 2), java8 (Java 8), r (R), fsharp (F#), cpp14 (C++14), kotlin (Kotlin)

    Get one submission

    Request

    import requests
    
    url = 'https://api.doselect.com/platform/v1/submission/mmoe0'
    headers = {
        "DoSelect-Api-Key": "88d4266fd4e6338d13b845fcf28",
        "DoSelect-Api-Secret": "385041b7bbc2320471b8551d"
    }
    response = requests.get(url, headers=headers)
    
    curl "https://api.doselect.com/platform/v1/submission/mmoe0" \
      -H "DoSelect-Api-Key: 88d4266fd4e6338d13b845fcf28" \
      -H "DoSelect-Api-Secret: 385041b7bbc2320471b8551d"
    

    Response

    {
        "analysis_details": {
            "quality": {
                "analysis_ended": "2017-03-27T07:10:03Z",
                "analysis_started": "2017-03-27T07:09:58Z",
                "issues": [{
                    "check_name": "global-require",
                    "remediation_points": 50000,
                    "description": "Unexpected require().",
                    "type": "issue",
                    "location": {
                        "path": "source.js",
                        "lines": {
                            "begin": 4,
                            "end": 4
                        }
                    },
                    "categories": ["Clarity"]
                }, {
                    "check_name": "no-process-exit",
                    "remediation_points": 50000,
                    "description": "Don't use process.exit(); throw an error instead.",
                    "type": "issue",
                    "location": {
                        "path": "source.js",
                        "lines": {
                            "begin": 19,
                            "end": 19
                        }
                    },
                    "categories": ["Bug Risk"]
                }],
                "score": "4.5",
                "sid": "ee2cfee4-94f2-4917-88cd-288ce9cc61f7",
                "status": "AC"
            }
        },
        "attachments": [],
        "code": "var a;\nvar fs=require(\"fs\");\nprocess.exit(1)",
        "created": "2017-09-25T08:14:41.304029",
        "creator": {
            "email": "john@example.com",
            "first_name": "John",
            "last_name": "Doe",
            "username": "johndoe"
        },
        "evaluated_at": null,
        "is_accepted": false,
        "modified": "2017-09-25T08:14:41.362048",
        "problem_slug": "7f3p0",
        "resource_uri": "/platform/v1/problem/7f3p0/submission/john@example.com",
        "resubmissions": 0,
        "run_details": {},
        "slug": "mmoe0",
        "solution_type": "SCR",
        "status": "NRE",
        "submitted_at": "2017-09-25T08:14:41.342872",
        "technology": "javascript",
        "total_score": "0.0",
        "max_score": 150
    
    }
    

    This endpoint retrieves a specific submission from the unique slug which is generated during creation:

    HTTP Request

    GET https://api.doselect.com/platform/v1/submission/<slug>

    The submission object returned contains a number of attributes. A few of them with their possible values and explanations are are described below:

    status

    Value Full-form Explanation
    UNE Unevaluated The submission has not been evaluated yet. This happens when it hasn't been submitted yet, or the evaluation is queued.
    ACC Accepted The submission has passed all test cases in the problem.
    PAC Partially correct The submission has passed some test cases, while failed the others.
    REJ Rejected The submission failed to pass any test cases in the problem.
    NRE Needs review If the problem must have at least one non-sample test case for the submission to get automatically evaluated. Otherwise, this status is set, which means the solution must be evaluated manually.

    Download code zip

    Request

    import requests
    
    url = 'https://api.doselect.com/platform/v1/submission/mmoe0/code-repo'
    headers = {
        "DoSelect-Api-Key": "88d4266fd4e6338d13b845fcf28",
        "DoSelect-Api-Secret": "385041b7bbc2320471b8551d"
    }
    response = requests.get(url, headers=headers)
    
    with open("code-repo.zip", "w+") as f:
        f.write(response.content)
    
    curl "https://api.doselect.com/platform/v1/submission/mmoe0/code-repo" \
      -H "DoSelect-Api-Key: 88d4266fd4e6338d13b845fcf28" \
      -H "DoSelect-Api-Secret: 385041b7bbc2320471b8551d"
      > code-repo.zip
    

    Response

    A zip file
    

    This endpoint retrieves the zip file of the code submitted identified by the unique slug which is generated during creation.

    HTTP Request

    GET https://api.doselect.com/platform/v1/submission/<slug>/code-repo

    Currently, this API will only support the downloading of code for PRJ and UIX submissions.

    Submit an existing submission

    Request

    import requests
    
    url = "https://api.doselect.com/platform/v1/submission/28g9a/submit/"
    
    headers = {
        'DoSelect-Api-Key': "88d4266fd4e6338d13b845fcf28",
        'DoSelect-Api-Secret': "385041b7bbc2320471b8551d",
        'Content-Type': "application/json"
        }
    
    response = requests.request("POST", url, headers=headers)
    
    curl -X POST \
      https://api.doselect.com/platform/v1/submission/28g9a/submit \
      -H 'Content-Type: application/json' \
      -H 'DoSelect-Api-Key: 88d4266fd4e6338d13b845fcf28' \
      -H 'DoSelect-Api-Secret: 385041b7bbc2320471b8551d'
    

    Response

    {
        "status": "SUCCESS",
        "message": "A new submission has been triggered for this solution."
    }
    

    This endpoint submits an existing submission for a specific problem, identified by the submission's slug.

    Code Lab API

    The Code Lab API allows you to retrieve Code Labs that have been created from your Learn account. This is a read-only API.

    Get all code labs

    You can get all code labs created in your Learn team account using the list endpoint:

    HTTP request

    GET https://api.doselect.com/platform/v1/codelab

    import requests
    
    url = 'https://api.doselect.com/platform/v1/codelab'
    headers = {
        "DoSelect-Api-Key": "88d4266fd4e6338d13b845fcf28",
        "DoSelect-Api-Secret": "385041b7bbc2320471b8551d"
    }
    response = requests.get(url, headers=headers)
    
    curl "https://api.doselect.com/platform/v1/codelab" \
      -H "DoSelect-Api-Key: 88d4266fd4e6338d13b845fcf28" \
      -H "DoSelect-Api-Secret: 385041b7bbc2320471b8551d"
    

    Response

    {
        "objects": [
            {
                "archived": false,
                "created": "2018-06-14T10:14:51.225572",
                "expiry_period": 30,
                "name": "Django Lab",
                "resource_uri": "/platform/v1/codelab/ykb92",
                "slug": "ykb92",
                "status": "PUB",
                "tasks": [],
                "workspace_specs": {
                    "cpu_intensive": false,
                    "memory": "1024"
                },
                "workspace_template_config": "build_steps:\n- command: cmd1 to run\n  name: cmd1 name\ncommands:\n  build: some build command\n  test: some test command\n",
                "workspace_template_status": "PUB"
            }
        ],
        "meta": {
            "total_count": 1,
            "next": null,
            "offset": 0,
            "limit": 10,
            "previous": null
        }
    }
    

    Get one code lab

    You can use the detail end point with the code lab's slug.

    HTTP Request

    GET https://api.doselect.com/platform/v1/codelab/<code_lab_slug>

    Request

    import requests
    
    url = 'https://api.doselect.com/platform/v1/codelab/ykb92'
    headers = {
        "DoSelect-Api-Key": "88d4266fd4e6338d13b845fcf28",
        "DoSelect-Api-Secret": "385041b7bbc2320471b8551d"
    }
    response = requests.get(url, headers=headers)
    
    curl "https://api.doselect.com/platform/v1/codelab/ykb92" \
      -H "DoSelect-Api-Key: 88d4266fd4e6338d13b845fcf28" \
      -H "DoSelect-Api-Secret: 385041b7bbc2320471b8551d"
    

    Response

    {
        "archived": false,
        "created": "2018-06-14T10:14:51.225572",
        "expiry_period": 30,
        "name": "Django Lab",
        "resource_uri": "/platform/v1/codelab/ykb92",
        "slug": "ykb92",
        "status": "PUB",
        "tasks": [],
        "workspace_specs": {
            "cpu_intensive": false,
            "memory": "1024"
        },
        "workspace_template_config": "build_steps:\n- command: cmd1 to run\n  name: cmd1 name\ncommands:\n  build: some build command\n  test: some test command\n",
        "workspace_template_status": "PUB"
    }
    

    Get all invites

    You can use the participants endpoint to retrieve all the invites created in a code lab.

    HTTP Request

    GET https://api.doselect.com/platform/v1/codelab/<slug>/participants

    Request

    import requests
    
    url = 'https://api.doselect.com/platform/v1/codelab/e2mlk/participants'
    headers = {
        "DoSelect-Api-Key": "88d4266fd4e6338d13b845fcf28",
        "DoSelect-Api-Secret": "385041b7bbc2320471b8551d"
    }
    response = requests.get(url, headers=headers)
    
    curl "https://api.doselect.com/platform/v1/codelab/e2mlk/participants" \
      -H "DoSelect-Api-Key: 88d4266fd4e6338d13b845fcf28" \
      -H "DoSelect-Api-Secret: 385041b7bbc2320471b8551d"
    

    Response

    {
        "objects": [
            {
                "codelab": "/platform/v1/codelab/e2mlk",
                "created": "2018-06-19T10:29:03.655146",
                "email": "dymmuser@example.com",
                "expiry": null,
                "id": 1,
                "is_accepted": false,
                "participant_access_url": "https://doselect.com/gateways/codelab/?access_code=EtjakDPoTOteT7KSINLrOXTKJ6KQPzMN6B%2FD1ou0ibq2IxcsMRNMyAQxaUN4Bml3",
                "resource_uri": "/platform/v1/codelabinvite/1",
                "status": null
            }
        ],
        "meta": {
            "limit": 10,
            "next": null,
            "offset": 0,
            "previous": null,
            "total_count": 1
        },
    }
    

    Create a new Code Lab invite

    New invites can be created by POSTing data to the participants endpoint. Please note that bulk invites are not allowed at the moment.

    HTTP Request

    POST https://api.doselect.com/platform/v1/codelab/<slug>/participants

    Request

    import requests
    
    url = 'https://api.doselect.com/platform/v1/codelab/e2mlk/participants'
    headers = {
        "DoSelect-Api-Key": "88d4266fd4e6338d13b845fcf28",
        "DoSelect-Api-Secret": "385041b7bbc2320471b8551d"
    }
    
    payload = {
        "email": "john@example.com"
    }
    
    response = requests.post(url, headers=headers, json=payload)
    
    curl -X POST \
      https://api.doselect.com/platform/v1/codelab/e2mlk/participants/ \
      -H 'content-type: application/json' \
      -H 'doselect-api-key: 88d4266fd4e6338d13b845fcf28' \
      -H 'doselect-api-secret: 385041b7bbc2320471b8551d' \
      -d '{
        "email": "john@example.com"
    }'
    

    Response

    {
        "codelab": "/platform/v1/codelab/e2mlk",
        "created": "2018-07-16T12:35:37.444250",
        "email": "john@example.com",
        "expiry": null,
        "id": 12,
        "is_accepted": false,
        "participant_access_url": "https://doselect.com/gateways/codelab/?access_code=nbysIEgzjEnRATE%2Fdcs3ZDLKZeoy3A3rO1tswlR7z7wxgNuwtPkSM62EvIdUj1QVTv3UsxebSq8rXFGM7N7OF%2FzWfjLsnAunSUpmh35h0BI%253D",
        "resource_uri": "/platform/v1/codelabinvite/12",
        "status": null
    }
    

    Embed API

    The Embed API allows you to embed a Test, Problem or a Code Lab from DoSelect on your platform. This API is designed keeping in mind that the platform which is using the embed need not store any state-related data on their end -- all of that is stored by DoSelect and can be retrieved using the REST Platform APIs.

    Client library

    The Embed API can be accessed using the embed client library, doselect-embed.js. This library provides a simple JavaScript interface for authentication, creating embed objects on your application, and retrieving general information related to the embedded objects.

    Setup

    Step 1: Install the doselect-embed.js library

    To use the Embed API, simply copy and paste the snippet below before the </body> tag on every page where you want the embed to appear.

    <script src="https://assets.doselect.com/embed/v3/doselect-embed.min.js"></script>

    Step 2: Configure user settings

    window.doselect = {
        "api_key": "88d4266fd4e6338d13b845fcf28",
        "email": "john@example.com",
        "full_name": "John Doe",
        "timezone": "Asia/Kolkata",
        "user_hash": "CLjME03fz+Jr36VaDwv2MbNeemtfA57IgWhwcR3GfdI="
    }
    
    <script src="https://assets.doselect.com/embed/v3/doselect-embed.min.js"></script>
    

    To display embed problems and tests with respect to user, update window.doselect object with user metadata and place it above the embed code snippet.

    The following details are needed for configuration. Please note that all parameters are required for the embed to work.

    Parameter Description
    api_key Your team account's API_KEY
    email Email of the current user in your application for which you want the embed objects
    full_name Full name of the current user
    timezone Timezone of the current user. This value should be a valid timezone string. You can refer to the full list of timezone strings here.
    user_hash The verification hash for this user, which must be generated on your server-side
    Generating user_hash

    The user_hash must be a server-side generated HMAC (hash based message authentication code), using SHA256, with the current user's email as the message and your API_SECRET as the key.

    The embed requests will fail if the user_hash is incorrect.

    Host authentication

    This is an optional feature which will enable you to add whitelisted hosts which will be able to open the embed. The host is identified using the Referer header of the request. The white-listed hosts can be added in your company's integrations settings in the Allowed Hosts section.

    By default, no hosts will be allowed to open the embed. You will have to add atleast one allowed host in the team settings.

    Host matching option Description
    Exact Match This will be an exact string match between the request and allowed domains
    Using the * wildcard This will match any number of characters
    Using the ? wildcard This will match one character

    The matching will convert https://api.doselect:8080/embed/problem/yo3kd to api.doselect:8080 and try to match that to the white-listed hosts.

    Problem embed

    You can embed a problem on your platform using the problem's slug, which uniquely identifies a problem on DoSelect. Add this HTML code where you want a problem to show up:

    <div class="doselect-embed" data-category="problem" data-slug="3myr6"
         data-config='{"allow_submission": true,
                        "custom_body_class": "custom_class1 custom_class2"}'></div>
    
    Attribute Description
    data-category Required. Defines the kind of embed. Should be either test or problem
    data-slug Required. Identification slug of the object being embedded
    data-config Optional. Specify optional config parameters for this embed. This value must be a valid JSON string.

    The following attributes are supported in the configuration object at the moment.

    Attribute Type Description
    allow_submission boolean Dynamically control if the submissions are allowed for a problem at the moment. This is only available in a problem embed.
    show_solution_revisions boolean Control if solution revisions should be visible.
    custom_body_class string Define custom class to the embed's body element. For multiple classes, use class names in a space seperated string.
    show_report boolean Control if the quality analysis of a solution should be visible in the embed. This only works for coding, selenium, data science and machine learning problems.

    Please note that the problem must be added to your Learn team's feed before it can be used in an embed.

    The allowed problem types in the embed are:

    Problem type Description
    DBA Database problem
    SCR Scripting/Coding problem
    MLI Machine learning problem
    DSC Data-science problem
    UIX UI/UX problem
    PRJ Project-based problem
    APP Full stack app problem

    Sample solutions of a problem

    The sample solution of a problem will be shown on the embed if the following conditions are met:

    Number Condition
    1 The max_submissions of a problem is set and it is non-zero.
    2 The number of submissions for this problem has reached the maximum number of submissions
    3 A sample solution exists for the technology the user has selected

    Test embed

    You can embed a test on your platform using the test's slug, which uniquely identifies a test on DoSelect. Add this HTML code where you want a test to show up:

    <div class="doselect-embed" data-category="test" data-slug="es6ts"
         data-config='{"allow_test_retake": true,
                        "custom_body_class": "custom_class1 custom_class2"}'></div>
    

    Please note that the test must be added to your Learn team's feed before it can be used in an embed.

    Attribute Description
    data-category Required. Defines the kind of embed. Should be test
    data-slug Required. Identification slug of the object being embedded
    data-config Optional. Specify optional config parameters for this embed. This value must be a valid JSON string.

    The following attributes are supported in the configuration object at the moment.

    Attribute Type Description
    allow_test_retake boolean Control if the test retake button is visible in the report.
    custom_body_class string Define custom class to the embed's body element. For multiple classes, use class names in a space seperated string.
    show_report boolean Control if the quality analysis of a solution should be visible in the embed. This only works for coding, selenium, data science and machine learning problems.

    Snippet runner embed

    The snippet runner embed provides a context-free code execution environment that you can embed on your platform to enable your users create arbitrary code snippets, and execute them. This component is especially useful in a learning environment where the users are being taught programming and need a place to play around with different technologies without any set-up.

    Each code runner is tied to a user email as specified in the user settings. All code snippets created by a user are saved on DoSelect platform and loaded whenever the snippet runner loads for the user. If you wish to group snippets on the basis of an entity, say course, you can pass an arbitrary string as the collection_id.

    The snippet runner support two types of code snippets: SCR (coding type), and DSC (data science type). The data science snippet type has additional features, such as ability to upload datasets, attach datasets to be available during runtime of a snippet, ability to plot graphs and return attachments, etc.

    <!-- SCR runner with all languages allowed and no collection. -->
    <div class="doselect-embed" data-category="snippet-runner"></div>
    
    <!-- SCR runner with Python 2, Python 3 and Java 8 allowed,
         for a collection called `full-stack-lab`, with custom_body_class. -->
    <div class="doselect-embed" data-category="snippet-runner"
        data-config='{"allowed_technologies": "python2,python3,java8",
                      "collection_id": "full-stack-lab",
                      "custom_body_class": "custom_class"}'></div>
    
    <!-- DSC runner with with all languages allowed,
         for a collection called `data-science-lab`, with multiple custom_body_class. -->
    <div class="doselect-embed" data-category="snippet-runner"
        data-config='{"type": "DSC",
                      "collection_id": "data-science-lab",
                      "custom_body_class": "custom_class1 custom_class2"}'></div>
    

    In the configuration object, the following attributes are allowed:

    Attribute Type Description
    type string Specifies the type of runner. Should be one of SCR and DSC. If no value is provided, defaults to SCR.
    allowed_technologies string Comma-separated values representing the programming languages allowed in this runner. This attribute is optional. If not provided, all programming languages on DoSelect will be allowed in the runner for that snippet type.
    collection_id string An arbitrary string to classify the collection of the snippets created under using this embed. If this is empty, all snippets created by the user will be loaded in the runner.
    custom_body_class string Define custom class to the embed's body element. For multiple classes, use class names in a space seperated string.

    The following programming languages are supported in the runner at the moment:

    Type Description Programming language slugs
    SCR Coding runner julia, haskell, csharp, go, javascript, scala, swift, perl, lua, clisp, objectivec, php, ruby, bash, clojure, rust, c, cpp, cpp14, java7, java8, python2, python3, r, fsharp, kotlin
    DSC Data science runner python2, python3, r

    Data science runner

    The data science runner has some additional features to facilitate seamless workflow for writing code for data science. The users can upload datasets, which can be then attached to be used in one or more snippets. After a dataset has been attached with a snippet, it will be available under the path /data during the code runtime. The maximum dataset size supported is 20 MB. Presently, there's no limit on the number of datasets that one user can upload.

    The following file types are allowed to be uploaded as datasets: zip, csv, xls, txt.

    Code Lab embed

    The code lab embed enables you to embed DoSelect Learn's Code Labs environment within your LMS for a seamless learning experience. After you've create a new Code Lab from your Learn Dashboard, you must publish it and make the status Active before you can embed it.

    <!-- Embed for the code lab with slug "tysgh" -->
    <div class="doselect-embed" data-category="code-lab" data-slug="tysgh" data-config='{ "expiry": "2020-02-20T02:00:00.000" }'></div>
    

    The following attributes are supported in the data-config object at the moment for code-lab.

    Attribute Type Required Description
    expiry datetime No Expiry of the codelab in datetime ISO format(UTC). example 2020-02-20T02:00:00.000

    Actions

    The doselect global object provides methods to take various actions on the embed objects on your app.

    Loading embeds

    Call doselect.startEmbed() to load all the embed objects on a page.

    Destroying an embed

    To close an embed, call doselect.closeFrame(category, slug). If the embed element is available in the current page, it will be destroyed.

    Fetch report

    To fetch the report for an embed, call doselect.fetchReport(category, slug).

    FAQ

    I've configured the doselect object properly, but the embed isn't loading. Why?

    There can be multiple reasons for this. Here's are a few things you should check for troubleshooting.

    Error Reference

    While using the Embed API, you might come across various errors if you've not properly configured your parameters properly.

    Internal API Endpoint Code Description Solution
    auth 400 The configuration is invalid Make sure you've followed the steps during the embed setup
    auth 400 You're using an admin email Make sure the email you're using isn't an admin or a recruiter. Try using a different or new email.
    auth 401 Either the hash or the referer is invalid Check the hash or add the referer to the allowed hosts
    auth 405 Method not allowed You were trying to access the resource using an invalid HTTP method.
    loadframe 400 Invalid embed div configuration Check the div attributes of the problem embed or test embed
    loadframe 403 The problem / test isn't in your learn feed Add the problem / test to the learn feed
    loadframe 405 Method not allowed You were trying to access the resource using an invalid HTTP method
    any 5xx Internal server error Please try again after some time. If it still persists, let us know.

    Webhooks

    The webhooks framework notifies you about various actions that have happened related to the resources on your team. You can add a webhook_url in your team settings. Whenever a new event occurs, we will make a POST request to this URL with a JSON payload in body.

    If you return anything other than an HTTP 2XX status to the webhook POST then we’ll try to deliver the webhook up to 5 times with a backoff.

    Tip: You can use a service like RequestBin to test webhook delivery.

    Payload

    For each webhook delivery on a URL, the POST request contains a JSON payload in the body with information about the action.

    The meta object contains metadata about the current webhook delivery, like the sender, action, timestamp and delivery_id.

    The object attribute contains a contextual object.

    Payload body

    {
        "meta": {
            "sender": "test-session",
            "action": "end",
            "timestamp": "2017-10-07T10:41:31.846531+00:00",
            "delivery_id": "441cd01e-d82d-485c-95d8-c8c498417649"
        },
        "object": {
            "report_uri": "https://api.doselect.com/platform/v1/test/k716y/candidates/mibukuyij@storj99.com/report",
            "test_uri": "https://api.doselect.com/platform/v1/test/k716y",
            "email": "mibukuyij@storj99.com",
            "test_slug": "k016y"
        }
    }
    

    Webhook Security

    In using a webhook, there is a possibility that an attacker might be able to forge webhook notifications which might result in unwanted actions being taken.

    To prevent that, in each webhook delivery from DoSelect, the POST request will contain a DoSelect-Webhook-Signature header.

    For verification, on your server side, you need to generate a HMAC (hash based message authentication code), using SHA256, with the current request's delivery_id as the message and your API_SECRET as the key.

    The calculated and the request hashes should match, indicating that the message is authentic and was indeed sent by DoSelect.

    Solution

    The actions sent by solution are listed below. These actions are only sent for solutions whose problems have been added to your account's learnfeed.

    Sender Action Description
    submission create Solution is created (saved for the first time)
    submission submit Solution is submitted by the user
    submission evaluated Solution is evaluated and the scores are ready.

    The Solution webhooks will have the following fields:

    Field Name Type Description
    submission_slug string The identifier for that submission
    submission_uri string The URI for a particular submission
    problem_slug string The identifier for the problem
    problem_uri string The URI of the problem
    email string The email of the user
    code string The latest submitted code of the user
    code_repo_uri string URI pointing to the latest saved UIX-PRJ code

    Example payload

    {
        "meta":{
            "sender": "submission",
            "action": "submit",
            "timestamp": "2017-10-07T10:41:31.846531+00:00",
            "delivery_id": "441cd01e-d82d-485c-95d8-c8c498417649"
        },
        "object":{
            "submission_slug": "7yt6ss",
            "submission_uri": "https://api.doselect.com/platform/v1/submission/7yt6ss",
            "problem_uri": "https://api.doselect.com/platform/v1/problem/rra3l",
            "problem_slug":"rra3l",
            "email": "mibukuyij@storj99.com",
            "code": "print 'Hello world test.' "
        }
    }
    

    Test Session

    The actions sent by a test session are listed below. These actions are sent for all tests associated with your account on DoSelect.

    Sender Action Description
    test-session begin The candidate has started taking the test
    test-session end The candidate has submitted the test, or the test was auto-submitted
    test-session report The candidate's test report has been generated

    The test webhooks will have the following fields:

    Field Name Type Description
    report_uri string The URI of the test report
    test_uri string The URI of the test
    test_slug string The identifier for the test
    email string The email of the user taking the test

    Example payload

    {
        "meta": {
            "sender": "test-session",
            "action": "end",
            "timestamp": "2017-10-07T10:41:31.846531+00:00",
            "delivery_id": "441cd01e-d82d-485c-95d8-c8c498417649"
        },
        "object": {
            "report_uri": "https://api.doselect.com/platform/v1/test/k716y/candidates/mibukuyij@storj99.com/report",
            "test_uri": "https://api.doselect.com/platform/v1/test/k716y",
            "email": "mibukuyij@storj99.com",
            "test_slug": "k016y"
        }
    }
    

    Test Config

    The actions sent by a test config are listed below. These actions are sent for all tests associated with your account on DoSelect.

    Sender Action Description
    test-config update Test configuration settings have been updated

    The test config webhooks will have the following fields:

    Field Name Type Description
    test_uri string The URI of the test
    test_slug string The identifier for the test

    Example payload

    {
            "meta": {
                    "action": "update",
                    "timestamp": "2017-10-30T07:08:18.457736+00:00",
                    "delivery_id": "faa8f070-9644-4112-8a4b-40865afdd5bf",
                    "sender": "test-config"
            },
            "object": {
                    "test_slug": "o94yw",
                    "test_uri": "http://api.doselect.com/platform/v1/test/o94yw"
            }
    }
    

    Problem

    The actions sent by a problem are listed below. These actions are sent for all private problems on DoSelect.

    Sender Action Description
    problem create A new problem has been created
    problem edit The problem has been edited

    The Problem webhooks will have the following fields:

    Field Name Type Description
    problem_uri string The URI of the problem
    problem_slug string The identifier for the problem
    creator_email string The email of the user who made the problem

    Example payload

    {
            "meta": {
                    "action": "create",
                    "timestamp": "2017-10-30T07:08:18.457736+00:00",
                    "delivery_id": "faa8f070-9644-4112-8a4b-40865afdd5bf",
                    "sender": "problem"
            },
            "object": {
                    "creator_email": "",
                    "problem_slug": "o94yw",
                    "problem_uri": "http://api.doselect.com/platform/v1/problem/o94yw"
            }
    }
    

    Help

    The API platform's has a public issue tracker which is hosted here - github.com/doselect/api-platform-support. If you have any feature requests, need any clarification on something from the docs, or have come across any bugs in general, please create an issue and someone from DoSelect will take a look at it at the earliest. If you're actively integrating the APIs with your application and need some guidance, you may send an email to api-platform-support@doselect.com with details.

    The API Platform is in limited release at the moment. You must have developer options enabled for your DoSelect team in order to be able to use these APIs. Please contact your account manager or write to support@doselect.com for help.

    Changelog

    Date Description
    Jan 4, 2023 Added the api key authentication to the pdf admin report
    Nov 15, 2023 Changed data type of percentage field from integer to float
    Jun 18, 2021 Added Extend an invite's test retake endpoint for adding a retake for a particular test invite.
    May 05, 2021 Added in_learn_feed in the Get one problem API. Also, added insights and tags into a problem in the Get a candidate's report API.
    Jun 15, 2020 Added ability to generate and get pdf report through API.
    Jul 17, 2019 Added author_logs filter and author_email parameter in Problem API. Updated reset invite warning notice.
    May 10, 2019 Increased the platform API ratelimits.
    Apr 26, 2019 Added in_learn_feed and archived filters in Test API. Added in_learn_feed in Problem API.
    Mar 26, 2019 Added allow_test_retake field in the Test embed configuration object and enabled versioning of doselect-embed.js library.
    Jan 21, 2019 Added total_test_score field in the Test API.
    Aug 6, 2018 Added ability to lock and unlock a problem, enable updating score and penalty in Problem API
    Jul 16, 2018 Added Code Lab embed and REST APIs
    Jun 18, 2018 Added custom_body_class attribute on data-config object for problem / test embed and snippet runner embed
    Jun 01, 2018 Added rate limits for our client APIs
    May 29, 2018 Added an API for bulk creation of invites
    May 22, 2018 Added an API for downloading the code zip and added code_repo_uri to the submission response
    May 15, 2018 Added DSC (data science type) in snippet runner embed
    May 11, 2018 Added conditions governing sample solutions behaviour in problem embed.
    May 02, 2018 Added test_name to the user invite API response and updated the allowed embed problem types
    Apr 25, 2018 Added docs for the user invite API
    Apr 18, 2018 Updated the solution webhook docs and added email restriction in embed and added max_score field to submission API response
    Apr 12, 2018 Added allowed problem types in problem embed
    Apr 11, 2018 Added the response to the create submission API and updates the docs for when webhook is triggered and added docs for host authentication
    Apr 06, 2018 Added Solution Revision API.
    Apr 03, 2018 Added update invite API
    Mar 15, 2018 Added Snippet Runner embed.
    Mar 12, 2018 Added a webhook triggered on solution evaluation.
    Jan 31, 2018 Added Data science and Machine learning to allowed problem types in problem creation.
    Jan 19, 2018 Added support for controlling visibility of solution revisions in problem embed.
    Dec 04, 2017 Added public_access_url to the test report.
    Nov 30, 2017 Update start_time and expiry in invite reset API.
    Nov 28, 2017 Added learn_feed_item_id to the create submission API.
    Nov 27, 2017 Added API to reset an invite and added start_time to the create invite api.
    Nov 24, 2017 Added API to clone a problem, update a problem and add problem to learnfeed APIs.
    Nov 15, 2017 sample_solutions and technologies can be added while creating a new problem.
    Nov 01, 2017 Added problem testcase API.
    Oct 30, 2017 Added problem creation and edit webhooks and code in submit webhook.
    Oct 26, 2017 Added problem creation API.
    Oct 25, 2017 Added DoSelect-Webhook-Signature header in Webhooks.
    Oct 18, 2017 Added data-config attribute in problem embed.
    Oct 16, 2017 Added webhook senders for test session report.
    Oct 9, 2017 Added webhook senders for test session and solution.