Prospects¶
The prospects API allows you to create a new prospective student. You need to authenticate using an API Key in order to call this service; see the Authentication section for further details
Creating prospective student¶
- URL
/prospect/create-prospective-student
- HTTP Method
POST
- Client Library Message Name
Prospect.CreateProspectiveStudentRequest
You should POST details of the prospective student to the prospects service. We will perform validation on the details you provide, such as checking that all the required fields are filled in and that you’ve provided valid EC codes. If the prospective student details pass validation we’ll return an empty HTTP 200 OK response to let you know that we’ve handed the record off to our back-end system for further processing.
Our back-end system will process the request and if specified will send an email to the prospective student. If you supply the Counsellor Name, Email and Telephone details then we can include these in the email response to your Prospect as a reminder of who to contact, and we can also send a copy of the email to the Counsellor.
Sample Request¶
Error
Failed to run contract transformer command: bin\Api.ContractTransformer.exe
{
"AgentOfficeCode": "2983",
"FirstNames": "John",
"LastName": "Smith",
"Email": "john.smith@example.com",
"SchoolCode": "BRI",
"StartDateMonth": 5,
"StartDateYear": 2016,
"CounsellorName": "Jane Jones",
"CounsellorEmail": "jjones@testagent.com",
"SendEmail": true,
"EnquiryDate": "2015-12-09"
}
Sample Response - Passed Validation¶
An empty response is returned.
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Cache-Control: no-cache
Content-Length: 2
{}
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8
Cache-Control: no-cache
Content-Length: 213
<CreateProspectiveStudentResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/EcEnglish.Api.ServiceContract.Prospect" />
Sample Response - Failed Validation¶
This response will be returned along with a HTTP 404 Invalid code for requests that fail validation.
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8
Cache-Control: no-cache
Content-Length: 459
{
"ResponseStatus": {
"ErrorCode": "StringLength",
"Message": "'FirstNames' must be between 0 and 100 characters",
"Errors": [
{
"ErrorCode": "StringLength",
"FieldName": "FirstNames",
"Message": "'FirstNames' must be between 0 and 100 characters"
},
{
"ErrorCode": "Required",
"FieldName": "SchoolCode",
"Message": "'SchoolCode' is required"
}
]
}
}
HTTP/1.1 400 Bad Request
Content-Type: application/xml; charset=utf-8
Cache-Control: no-cache
Content-Length: 844
<ErrorResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
<ResponseStatus>
<ErrorCode>StringLength</ErrorCode>
<Message>'FirstNames' must be between 0 and 100 characters</Message>
<StackTrace i:nil="true" />
<Errors>
<ResponseError>
<ErrorCode>StringLength</ErrorCode>
<FieldName>FirstNames</FieldName>
<Message>'FirstNames' must be between 0 and 100 characters</Message>
</ResponseError>
<ResponseError>
<ErrorCode>Required</ErrorCode>
<FieldName>SchoolCode</FieldName>
<Message>'SchoolCode' is required</Message>
</ResponseError>
</Errors>
<Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" i:nil="true" />
</ResponseStatus>
</ErrorResponse>
Request fields¶
Field | Type | Required? | Description |
---|---|---|---|
AgentOfficeCode | text(10) | Yes | EC code for the agent’s office, see Agent offices |
FirstNames | text(100) | Yes | The first names of the prospective student |
LastName | text(100) | Yes | The last name of the prospective student |
text(100) | Yes | The email address of the prospective student | |
SchoolCode | text(10) | Yes | EC code for the school the prospect wishes to attend, see Schools |
CourseCode | text(10) | No | EC code for the course the prospect wishes to attend, see Products |
StartDateMonth | int (1..12) | No | The prospective student’s start date month |
StartDateYear | int (1900..2100) | No | The prospective student’s start date year |
CounsellorName | text(100) | No | The name of the student counsellor |
CounsellorEmail | text(100) | No | The email address of the student counsellor |
CounsellorTelephone | text(100) | No | The telephone number of the student counsellor |
SendEmail | bool | Yes | Should an email be sent to the prospective student |
EnquiryDate | date | Yes | The date the prospective student enquired |