Note: Version 2 of the Surpass API is now available. For any customers not already using API v1, please refer to the API v2 Developer Portal.The GetResults web method in the Surpass API returns a separate url for each exam that is returned from the parameters you have specified in the request. The URL returned is the web address you will need to call to run the GetResult method to find out the high level information regarding that result.
The input parameters that are required for the GetResults web method are as follows:
|testReference||Type: String, max length: 50, mandatory||The test reference of the exams you would like the web method to return. This is specified in the Test Creation section of Surpass Editions.|
|centreReference||Type: String, optional||The centre reference of the exams you would like the web method to return. This is specified in the Setup section of Surpass Editions.|
|subjectReference||Type: String, optional||The subject reference of the exams you would like the web method to return. This is specified in the Setup section of Surpass Editions.|
|startRangeDateTime||Type: DateTime, mandatory||The web method will only return results on or after this date/time.|
|endRangeDateTime||Type: DateTime, mandatory||The web method will only return results before this date/time.|
|pageNumber||Type: int, mandatory||Results are returned in pages to limit the number of responses returned, this value denotes the page number. When calling this for the first time the user should send ‘1’, the number of pages will be included as part of the response’s header.|
The GetResult web method can be called directly by browsing to the url, the above parameters will need to form part of the url that is sent.
An example of this call is as follows:
https://[YourSurpassEnvironment].surpass.com/api/v1/TestResults/GetResults?testReference=BTL Demo Test¢reReference=BTL Centre 123&subjectReference=BTLDemo&startRangeDateTime=2013-12-02T00:00:00&endRangeDateTime=2013-12-17T00:00:00&pageNumber=1
- The DateTime value is any able to parse by C#. This also must be kept inside double quotes. An example DateTime is as follows: "2013-12-18T07:23:26.550375+00:00"
- To remove optional parameters such as centreReference and subjectReference the parameter should be left out of the URL, an example of the call without the optional nodes has been provided below:
To successfully call GetResults the user specified in the header of the request must have the 'View Results' permission in Surpass and be associated to the relevant centre and subject contained within the request.
The response from the GetResults method will detail all exams that successfully match the input parameters requested by the user. Information contained within the GetResults response will provide the user with the URL to call the GetResult method.
If the call was unsuccessful then you will receive an error message, all error messages available in the Surpass API can be found here.
An example of the response has been included below: