Create Test Link
-
Description
Create new test link for a given test -
URL structure
https://api.interviewmocha.com/v2/org/tests/{testId}/testlinks
-
Request Method
POST
-
Request Data
Request URL ParametersParameter Description Default Data Type Is Mandatory testId Test Id associated with particular test None Int64 Yes Parameter Description Default Data Type Is Mandatory testLinkName Name of test link None String Yes accessTime Represent access time set for current test link 0 Int Yes timeZoneId Time zone in which test should be accessible as per given start datetime and end datetime Account Default Int Yes inviteCandidateOnly Candidate invited through email can appear for test 0 Int No imageProctoring Enable image proctoring for test link 0 Int No emailToStakeholder Send email to stakeholders when candidate complete the test Account Email String No testLinkStatus Enable or disable test link 1 Int No Parameter Description Data Type Values accessTime Zero(0) denotes that test can be accessed anytime Int64 0 accessTime One(1) denotes that test is time bound Int64 1 accessTime Two(2) denotes that test is slot wise Int64 2
Description: Test is accessible to anyone with test URL or access key
Parameter Description Default Data Type Is Mandatory timeZoneId Time zone in which test should be accessible as per given start datetime and end datetime Account Default Int Yes
Description: Using time bound invitation, any invitation sent with these settings make it mandatory to candidate to give test within that date time period.
For Example:Candidate can access test from 2nd Feb 2018 04:00PM to 3rd Feb 2018 05:00 PM
Following parameters needs to be included in request body if Access Time = 1
Parameter Description Data Type Is Mandatory startDateTime UTC date time in string
Format Example: 2018-02-15T16:00:00
(15th Feb 2018 04:00:00 PM)String Yes endDateTime UTC date time in string
Format Example: 2018-02-16T17:00:00
(16th Feb 2018 05:00:00 PM)String Yes timeZoneId Time zone in which test should be accessible as per given start datetime and end datetime Int Yes
Description: Using slot wise invitation, any invitation sent with these settings make it mandatory to candidate to give test within that date and specifically in that time period.
Time part of startDateTime marks the starting time and time part of endDateTime marks the ending time.
For Example:Candidate can access test from 2nd Feb 2018 to 3rd Feb 2018 In only 4:00 PM to 05:00 PM time slot on both days 2nd Feb and 3rd Feb 2018.
Following parameters needs to be included in request body if Access Time = 2
Parameter Description Data Type Is Mandatory startDateTime UTC date time in string
Format Example: 2018-02-15T16:00:00
(15th Feb 2018 04:00:00 PM)String Yes endDateTime UTC date time in string
Format Example: 2018-02-16T17:00:00
(16th Feb 2018 05:00:00 PM)String Yes timeZoneId Time zone in which test should be accessible as per given start datetime and end datetime Int Yes -
Test Link Status Table
Parameter If Then testLinkStatus 1 Test link is active testLinkStatus 3 Test link is inactive TimeZoneId Table
More information -
Response Data
ParametersArgument Name Description Return Data Type statuscode Status code returned with every response String description Status code message String result Wrapper Object Object result.testLinkId Unique Id of newly created test link Int64 result.testId Test Id associated with particular test Int64 result.testLinkName Name of test link String result.testLinkAccessKey Unique access key required to appear for test String result.accessTime Represent access time set for current test link Int result.startDateTime UTC date time in string String result.endDateTime UTC date time in string String result.timeZoneId Time zone in which test should be accessible as per given start datetime and end datetime Int result.inviteCandidateOnly Candidate invited through email can appear for test Int result.imageProctoring Enable image proctoring for test link Int result.emailToStakeholder Send email to stakeholders when candidate complete the test String result.testLinkStatus Enable or disable test link Int -
Sample Code
Example Curl request will look like this:curl -i -H "x-api-key:YOUR_API_KEY_HERE" -H "content-type:application/json;charset=utf-8" -X POST https://api.interviewmocha.com/v2/org/tests/840702/testlinks -d '{ "testLinkName": "PICT1", "accessTime": 1, "timeZoneId": 1720, "inviteCandidateOnly": 0, "imageProctoring": 1, "emailToStakeholder": "amey.interviewmocha@gmail.com", "testLinkStatus": 1, "startDateTime": "2018-03-19T16:00:00", "endDateTime": "2018-03-20T16:00:00" }'
{ "statuscode": "200.1", "description": "The request has succeeded.", "result": { "testLinkId": 35189, "testId": 840702, "testLinkName": "PICT1", "testLinkAccessKey": "1664d120ab", "accessTime": 1, "startDateTime": "2018-03-19T16:00:00", "endDateTime": "2018-03-20T16:00:00", "timeZoneId": 1720, "inviteCandidateOnly": 0, "imageProctoring": 1, "emailToStakeholder": "test@interviewmocha.com", "testLinkStatus": 1 } }